mirror of
https://github.com/junegunn/fzf.git
synced 2026-07-10 10:36:28 +08:00
Preserve wrap state across change-preview-window
toggle-preview-wrap (and -wrap-word) modifies t.activePreviewOpts.wrap, but change-preview-window resets t.previewOpts to t.initialPreviewOpts, discarding the user's toggle. Carry wrap and wrapWord over so toggles survive a layout change. Explicit wrap / nowrap tokens in the new spec still win, so cycling and the empty-token reset are unaffected. Close #4791
This commit is contained in:
@@ -7819,6 +7819,11 @@ func (t *Terminal) Loop() error {
|
||||
t.previewOpts = t.initialPreviewOpts
|
||||
t.previewOpts.command = currentPreviewOpts.command
|
||||
|
||||
// Carry over toggle-driven state so toggle-preview-wrap survives
|
||||
// a change-preview-window. Tokens below can still override.
|
||||
t.previewOpts.wrap = currentPreviewOpts.wrap
|
||||
t.previewOpts.wrapWord = currentPreviewOpts.wrapWord
|
||||
|
||||
// Split window options
|
||||
tokens := strings.Split(a.a, "|")
|
||||
if len(tokens[0]) > 0 && t.initialPreviewOpts.hidden {
|
||||
|
||||
Reference in New Issue
Block a user