-
Notifications
You must be signed in to change notification settings - Fork 300
Bugfix/fix welcome buffer layer #2522
Bugfix/fix welcome buffer layer #2522
Conversation
fix navigation of commands
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
@@ -156,6 +158,10 @@ export class NeovimEditor extends Editor implements Oni.Editor { | |||
return this._onNeovimQuit | |||
} | |||
|
|||
public get onEmptyBuffer() { |
There was a problem hiding this comment.
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
create common getBorder function
move quick commands to the top of the welcome screen fix getBorder function to return default border of same size
re-arrange buttons for initial positioning
@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 |
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
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
andk
for navigation and<enter>
to select, this PR also adds a method to the oni api calledgetActiveSection
which returns a string representing the active section of the editor e.g. the particular sidebar element or the menu or commandlineOutstanding
enter
key passthroughadd sessions to welcome screenleave for another PR