mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-13 13:53:47 -05:00
Add pos(...) action to move the cursor to the numeric position
# Put the cursor on the 10th item seq 100 | fzf --sync --bind 'start:pos(10)' # Put the cursor on the 10th to last item seq 100 | fzf --sync --bind 'start:pos(-10)' Close #3069 Close #395
This commit is contained in:
@@ -890,7 +890,7 @@ const (
|
||||
|
||||
func init() {
|
||||
executeRegexp = regexp.MustCompile(
|
||||
`(?si)[:+](execute(?:-multi|-silent)?|reload|preview|change-query|change-prompt|change-preview-window|change-preview|(?:re|un)bind)`)
|
||||
`(?si)[:+](execute(?:-multi|-silent)?|reload|preview|change-query|change-prompt|change-preview-window|change-preview|(?:re|un)bind|pos)`)
|
||||
splitRegexp = regexp.MustCompile("[,:]+")
|
||||
actionNameRegexp = regexp.MustCompile("(?i)^[a-z-]+")
|
||||
}
|
||||
@@ -1197,6 +1197,8 @@ func isExecuteAction(str string) actionType {
|
||||
return actChangePrompt
|
||||
case "change-query":
|
||||
return actChangeQuery
|
||||
case "pos":
|
||||
return actPosition
|
||||
case "execute":
|
||||
return actExecute
|
||||
case "execute-silent":
|
||||
|
||||
Reference in New Issue
Block a user