-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding more movement keys #153
Conversation
Implemented a min function Added actions for Home, End, PageUp and PageDown Fixes ktr0731#125
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.
Thank you for your contribution! I left some comments.
fuzzyfinder.go
Outdated
@@ -415,6 +428,9 @@ func (f *finder) readKey() error { | |||
f.stateMu.Lock() | |||
defer f.stateMu.Unlock() | |||
|
|||
// Max number of lines to scroll by using PgUp and PgDn | |||
const pageScrollBy = 15 |
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.
Could you scroll the list based on the actual screen size?
fuzzyfinder.go
Outdated
case tcell.KeyPgDn: | ||
f.state.y -= min(pageScrollBy, f.state.y) | ||
f.state.cursorY -= min(pageScrollBy, f.state.cursorY) | ||
case tcell.KeyHome: |
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.
Since the action of Home in fzf is beginning-of-line
, go-fuzzyfinder's one should also be the same behavior.
fuzzyfinder.go
Outdated
f.state.y = len(f.state.matched) - 1 | ||
_, height := f.term.Size() | ||
f.state.cursorY = min(height-3, len(f.state.matched)-1) | ||
case tcell.KeyEnd: |
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.
The same as the above comment. This should be the same behavior of end-of-line
.
Codecov Report
@@ Coverage Diff @@
## master #153 +/- ##
==========================================
- Coverage 85.67% 85.15% -0.53%
==========================================
Files 5 5
Lines 775 795 +20
==========================================
+ Hits 664 677 +13
- Misses 97 104 +7
Partials 14 14 |
That should be it |
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.
LGTM!
Implemented a min function
Added actions for Home, End, PageUp and PageDown
Fixes #125