Skip to content
This repository was archived by the owner on Apr 1, 2020. It is now read-only.

Conversation

akinsho
Copy link
Member

@akinsho akinsho commented Aug 23, 2018

This PR will fix #1413 and #1459 it uses the handle input method on the buffer layers to define a custom input handler for the welcome layer which is fairly simple i.e. j and k for navigation and <enter> to select, this PR also adds a method to the oni api called getActiveSection which returns a string representing the active section of the editor e.g. the particular sidebar element or the menu or commandline

Outstanding

  • Hide cursor when welcome is active
  • Fix welcome commands (some...)
  • Allow enter key passthrough
  • Add tests

add sessions to welcome screen leave for another PR

@codecov
Copy link

codecov bot commented Aug 24, 2018

Codecov Report

Merging #2522 into master will increase coverage by 0.83%.
The diff coverage is 48.8%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2522      +/-   ##
==========================================
+ Coverage    43.6%   44.43%   +0.83%     
==========================================
  Files         351      351              
  Lines       14176    14260      +84     
  Branches     1845     1862      +17     
==========================================
+ Hits         6181     6336     +155     
+ Misses       7758     7697      -61     
+ Partials      237      227      -10
Impacted Files Coverage Δ
browser/src/Editor/NeovimEditor/NeovimSurface.tsx 65.21% <ø> (ø) ⬆️
...wser/src/Editor/NeovimEditor/BufferLayerManager.ts 62.96% <ø> (ø) ⬆️
browser/src/Plugins/Api/Oni.ts 37.36% <0%> (-4.62%) ⬇️
browser/src/Editor/NeovimEditor/HoverRenderer.tsx 26.31% <100%> (ø) ⬆️
browser/src/UI/components/common.ts 92.85% <100%> (+0.12%) ⬆️
.../Services/VersionControl/VersionControlManager.tsx 56.11% <100%> (+0.71%) ⬆️
...ser/src/Editor/NeovimEditor/WelcomeBufferLayer.tsx 53.92% <51.72%> (+1.64%) ⬆️
browser/src/Editor/BufferManager.ts 47.32% <80%> (+12.18%) ⬆️
browser/src/Editor/NeovimEditor/NeovimEditor.tsx 8.84% <9.09%> (-0.26%) ⬇️
...er/src/Editor/NeovimEditor/NeovimEditorCommands.ts 11.94% <0%> (-0.35%) ⬇️
... and 21 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e3f65e6...bb113de. Read the comment docs.

@@ -156,6 +158,10 @@ export class NeovimEditor extends Editor implements Oni.Editor {
return this._onNeovimQuit
}

public get onEmptyBuffer() {
Copy link
Member Author

@akinsho akinsho Aug 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created an onEmptyBuffer event so that we can trigger opening the welcome buffer as needed as opposed to having it only as a one off (in which case a user could potentially return to the welcome buffer in the same session) for example I remember from my brief time with atom that if you closed all the open files it would render something like our welcome screen again

EDIT: Renamed this to onShowWelcomeScreen for clarity

@akinsho akinsho changed the title [WIP] Bugfix/fix welcome buffer layer Bugfix/fix welcome buffer layer Aug 27, 2018
@akinsho
Copy link
Member Author

akinsho commented Aug 28, 2018

@CrossR @TalAmuyal I've finished development on this would love it if you could review, atm I've left the sessions out for now since its already turned out fairly large (PRwise I mean) there are a couple of buttons that don't work largely because I wasn't sure what @bryphe had in mind re what those buttons should do but I didnt want to remove them either since we'd likely end up forgetting to implement them

@CrossR CrossR self-requested a review August 28, 2018 09:00
Copy link
Collaborator

@TalAmuyal TalAmuyal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got a single comment.
It is optional.
In any case, approved :)

Also, GREAT JOB!

this.editors.activeEditor.mode === "cmdline_normal"
)
}
switch (true) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why switch instead of if ... else if ... else?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh just preference on my part, no other reason really

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Welcome Menu - Input and loading
2 participants