Add support for moving to a specific line (#1196)
* Add support for moving to a specific line * Update documentation
This commit is contained in:
1 parent
27d316c006
commit
b5c83dbf7a
6 files changed
+36
-8
No files matched your search
@@ -1099,6 +1099,19 @@ func (nav *nav) low() bool {
|
||||
return old != dir.ind
|
||||
}
|
||||
|
||||
func (nav *nav) move(index int) bool {
|
||||
old := nav.currDir().ind
|
||||
|
||||
switch {
|
||||
case index < old:
|
||||
return nav.up(old - index)
|
||||
case index > old:
|
||||
return nav.down(index - old)
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func (nav *nav) toggleSelection(path string) {
|
||||
if _, ok := nav.selections[path]; ok {
|
||||
delete(nav.selections, path)
|
||||
|
||||
Reference in new issue
Block a user