diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2025-02-09 13:37:22 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2025-02-09 13:37:22 +0900 |
| commit | 1be1991299b6a5d9d8407b8c9b84f8da1da3c15a (patch) | |
| tree | 304c0515a6f8c70660ae933537c500a07748bfd5 /src | |
| parent | 67dd7e1923f8084de1064bf54659100626c1e0ef (diff) | |
| download | fzf-1be1991299b6a5d9d8407b8c9b84f8da1da3c15a.tar.gz | |
Add exclude-current action
https://github.com/junegunn/fzf/pull/4231#issuecomment-2646063208
Diffstat (limited to 'src')
| -rw-r--r-- | src/options.go | 2 | ||||
| -rw-r--r-- | src/terminal.go | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/options.go b/src/options.go index 4a6c3b2b..185fdbcd 100644 --- a/src/options.go +++ b/src/options.go @@ -1605,6 +1605,8 @@ func parseActionList(masked string, original string, prevActions []*action, putA appendAction(actBell) case "exclude": appendAction(actExclude) + case "exclude-current": + appendAction(actExcludeCurrent) default: t := isExecuteAction(specLower) if t == actIgnore { diff --git a/src/terminal.go b/src/terminal.go index 60ddaa71..a9456df6 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -585,6 +585,7 @@ const ( actHideHeader actBell actExclude + actExcludeCurrent ) func (a actionType) Name() string { @@ -4926,6 +4927,12 @@ func (t *Terminal) Loop() error { } } changed = true + case actExcludeCurrent: + if item := t.currentItem(); item != nil { + denylist = append(denylist, item.Index()) + t.deselectItem(item) + changed = true + } case actExecute, actExecuteSilent: t.executeCommand(a.a, false, a.t == actExecuteSilent, false, false, "") case actExecuteMulti: |
