rename move commands to high/middle/low

cc #824
This commit is contained in:
Gokcehan 2022-05-08 14:03:32 +03:00
parent 01fe12b2ce
commit 7feb42db34
6 changed files with 33 additions and 33 deletions

14
doc.go
View File

@ -31,9 +31,9 @@ The following commands are provided by lf:
jump-prev (default '[') jump-prev (default '[')
top (default 'gg' and '<home>') top (default 'gg' and '<home>')
bottom (default 'G' and '<end>') bottom (default 'G' and '<end>')
hi-screen (default 'H') high (default 'H')
mid-screen (default 'M') middle (default 'M')
lo-screen (default 'L') low (default 'L')
toggle toggle
invert (default 'v') invert (default 'v')
unselect (default 'u') unselect (default 'u')
@ -298,11 +298,11 @@ Change the current working directory to the next/previous jumplist item.
Move the current file selection to the top/bottom of the directory. Move the current file selection to the top/bottom of the directory.
hi-screen (default 'H') high (default 'H')
mid-screen (default 'M') middle (default 'M')
lo-screen (default 'L') low (default 'L')
Move the current file selection to the top/middle/bottom of the screen. Move the current file selection to the high/middle/low of the screen.
toggle toggle

View File

@ -35,9 +35,9 @@ The following commands are provided by lf:
jump-prev (default '[') jump-prev (default '[')
top (default 'gg' and '<home>') top (default 'gg' and '<home>')
bottom (default 'G' and '<end>') bottom (default 'G' and '<end>')
hi-screen (default 'H') high (default 'H')
mid-screen (default 'M') middle (default 'M')
lo-screen (default 'L') low (default 'L')
toggle toggle
invert (default 'v') invert (default 'v')
unselect (default 'u') unselect (default 'u')
@ -310,11 +310,11 @@ Change the current working directory to the next/previous jumplist item.
Move the current file selection to the top/bottom of the directory. Move the current file selection to the top/bottom of the directory.
hi-screen (default 'H') high (default 'H')
mid-screen (default 'M') middle (default 'M')
lo-screen (default 'L') low (default 'L')
Move the current file selection to the top/middle/bottom of the screen. Move the current file selection to the high/middle/low of the screen.
toggle toggle

12
eval.go
View File

@ -963,27 +963,27 @@ func (e *callExpr) eval(app *app, args []string) {
app.ui.loadFile(app.nav, true) app.ui.loadFile(app.nav, true)
app.ui.loadFileInfo(app.nav) app.ui.loadFileInfo(app.nav)
} }
case "hi-screen": case "high":
if !app.nav.init { if !app.nav.init {
return return
} }
if app.nav.hiScreen() { if app.nav.high() {
app.ui.loadFile(app.nav, true) app.ui.loadFile(app.nav, true)
app.ui.loadFileInfo(app.nav) app.ui.loadFileInfo(app.nav)
} }
case "mid-screen": case "middle":
if !app.nav.init { if !app.nav.init {
return return
} }
if app.nav.midScreen() { if app.nav.middle() {
app.ui.loadFile(app.nav, true) app.ui.loadFile(app.nav, true)
app.ui.loadFileInfo(app.nav) app.ui.loadFileInfo(app.nav)
} }
case "lo-screen": case "low":
if !app.nav.init { if !app.nav.init {
return return
} }
if app.nav.loScreen() { if app.nav.low() {
app.ui.loadFile(app.nav, true) app.ui.loadFile(app.nav, true)
app.ui.loadFileInfo(app.nav) app.ui.loadFileInfo(app.nav)
} }

14
lf.1
View File

@ -46,9 +46,9 @@ The following commands are provided by lf:
jump-prev (default '[') jump-prev (default '[')
top (default 'gg' and '<home>') top (default 'gg' and '<home>')
bottom (default 'G' and '<end>') bottom (default 'G' and '<end>')
hi-screen (default 'H') high (default 'H')
mid-screen (default 'M') middle (default 'M')
lo-screen (default 'L') low (default 'L')
toggle toggle
invert (default 'v') invert (default 'v')
unselect (default 'u') unselect (default 'u')
@ -347,12 +347,12 @@ Change the current working directory to the next/previous jumplist item.
Move the current file selection to the top/bottom of the directory. Move the current file selection to the top/bottom of the directory.
.PP .PP
.EX .EX
hi-screen (default 'H') high (default 'H')
mid-screen (default 'M') middle (default 'M')
lo-screen (default 'L') low (default 'L')
.EE .EE
.PP .PP
Move the current file selection to the top/middle/bottom of the screen. Move the current file selection to the high/middle/low of the screen.
.PP .PP
.EX .EX
toggle toggle

6
nav.go
View File

@ -943,7 +943,7 @@ func (nav *nav) bottom() bool {
return old != dir.ind return old != dir.ind
} }
func (nav *nav) hiScreen() bool { func (nav *nav) high() bool {
dir := nav.currDir() dir := nav.currDir()
old := dir.ind old := dir.ind
@ -959,7 +959,7 @@ func (nav *nav) hiScreen() bool {
return old != dir.ind return old != dir.ind
} }
func (nav *nav) midScreen() bool { func (nav *nav) middle() bool {
dir := nav.currDir() dir := nav.currDir()
old := dir.ind old := dir.ind
@ -973,7 +973,7 @@ func (nav *nav) midScreen() bool {
return old != dir.ind return old != dir.ind
} }
func (nav *nav) loScreen() bool { func (nav *nav) low() bool {
dir := nav.currDir() dir := nav.currDir()
old := dir.ind old := dir.ind

View File

@ -146,9 +146,9 @@ func init() {
gOpts.keys["<home>"] = &callExpr{"top", nil, 1} gOpts.keys["<home>"] = &callExpr{"top", nil, 1}
gOpts.keys["G"] = &callExpr{"bottom", nil, 1} gOpts.keys["G"] = &callExpr{"bottom", nil, 1}
gOpts.keys["<end>"] = &callExpr{"bottom", nil, 1} gOpts.keys["<end>"] = &callExpr{"bottom", nil, 1}
gOpts.keys["H"] = &callExpr{"hi-screen", nil, 1} gOpts.keys["H"] = &callExpr{"high", nil, 1}
gOpts.keys["M"] = &callExpr{"mid-screen", nil, 1} gOpts.keys["M"] = &callExpr{"middle", nil, 1}
gOpts.keys["L"] = &callExpr{"lo-screen", nil, 1} gOpts.keys["L"] = &callExpr{"low", nil, 1}
gOpts.keys["["] = &callExpr{"jump-prev", nil, 1} gOpts.keys["["] = &callExpr{"jump-prev", nil, 1}
gOpts.keys["]"] = &callExpr{"jump-next", nil, 1} gOpts.keys["]"] = &callExpr{"jump-next", nil, 1}
gOpts.keys["<space>"] = &listExpr{[]expr{&callExpr{"toggle", nil, 1}, &callExpr{"down", nil, 1}}, 1} gOpts.keys["<space>"] = &listExpr{[]expr{&callExpr{"toggle", nil, 1}, &callExpr{"down", nil, 1}}, 1}