Skip to content

Commit f5c8d6c

Browse files
committed
refactor: extract ANSI strip helper and improve worktree list format
Deduplicate the ANSI-stripping sed pattern into _forgit_strip_ansi and adopt the [XY] bracket prefix style (consistent with ga) for worktree list output. The Y position now encodes both lock (L) and prunable (P) states, with L taking precedence when both present.
1 parent a5a323e commit f5c8d6c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,17 @@ If you're having issues after updating, and commands such as `forgit::add` or al
195195
| <kbd>Alt</kbd> - <kbd>W</kbd> | Toggle preview wrap |
196196
| <kbd>Ctrl</kbd> - <kbd>S</kbd> | Toggle sort |
197197
| <kbd>Ctrl</kbd> - <kbd>R</kbd> | Toggle selection |
198-
| <kbd>Ctrl</kbd> - <kbd>Y</kbd> | Copy commit hash/stash ID/worktree path* |
198+
| <kbd>Ctrl</kbd> - <kbd>Y</kbd> | Copy commit hash/stash ID/worktree path<sup>1</sup> |
199199
| <kbd>Ctrl</kbd> - <kbd>K</kbd> / <kbd>P</kbd> | Selection move up |
200200
| <kbd>Ctrl</kbd> - <kbd>J</kbd> / <kbd>N</kbd> | Selection move down |
201201
| <kbd>Alt</kbd> - <kbd>K</kbd> / <kbd>P</kbd> | Preview move up |
202202
| <kbd>Alt</kbd> - <kbd>J</kbd> / <kbd>N</kbd> | Preview move down |
203203
| <kbd>Alt</kbd> - <kbd>E</kbd> | Open file in default editor (when possible) |
204+
| <kbd>Alt</kbd> - <kbd>L</kbd> | Toggle worktree lock/unlock<sup>2</sup> |
205+
206+
<sup>1</sup> Available when the selection contains a commit hash, stash ID, or worktree path.
207+
<sup>2</sup> Only available in the worktree browser (`gw`).
204208

205-
\* Available when the selection contains a commit hash, stash ID, or worktree path.
206209
For Linux users `FORGIT_COPY_CMD` should be set to make copy work. Example: `FORGIT_COPY_CMD='xclip -selection clipboard'`.
207210

208211
# ⚙ Options

0 commit comments

Comments
 (0)