Fix count when parsing bottom command (#1240)
* Fix count when parsing `bottom` command
* Revert "Fix count when parsing `bottom` command"
This reverts commit a0b6bb5a13.
* Alternate implementation
* Add comment
This commit is contained in:
1 parent
24e224ca65
commit
88b3c999af
2 files changed
+8
-6
No files matched your search
@@ -1447,7 +1447,7 @@ func (e *callExpr) eval(app *app, args []string) {
|
||||
return
|
||||
}
|
||||
var moved bool
|
||||
if e.count == 0 {
|
||||
if e.count == 1 {
|
||||
moved = app.nav.top()
|
||||
} else {
|
||||
moved = app.nav.move(e.count - 1)
|
||||
@@ -1461,7 +1461,9 @@ func (e *callExpr) eval(app *app, args []string) {
|
||||
return
|
||||
}
|
||||
var moved bool
|
||||
if e.count == 0 {
|
||||
if e.count == 1 {
|
||||
// Different from Vim, which would treat a count of 1 as meaning to
|
||||
// move to the first line (i.e. the top)
|
||||
moved = app.nav.bottom()
|
||||
} else {
|
||||
moved = app.nav.move(e.count - 1)
|
||||
|
||||
Reference in new issue
Block a user