Fix change-nth
Some checks are pending
CodeQL / Analyze (go) (push) Waiting to run
Test fzf on Linux / build (push) Waiting to run
Test fzf on macOS / build (push) Waiting to run

* Proper clean-up of caches
* Force rerender list after the action
This commit is contained in:
Junegunn Choi
2025-01-13 12:45:01 +09:00
parent d83eb2800a
commit ba0935c71f
6 changed files with 36 additions and 9 deletions

View File

@@ -1626,6 +1626,10 @@ func (t *Terminal) adjustMarginAndPadding() (int, int, [4]int, [4]int) {
return screenWidth, screenHeight, marginInt, paddingInt
}
func (t *Terminal) forceRerenderList() {
t.prevLines = make([]itemLine, len(t.prevLines))
}
func (t *Terminal) resizeWindows(forcePreview bool, redrawBorder bool) {
t.forcePreview = forcePreview
screenWidth, screenHeight, marginInt, paddingInt := t.adjustMarginAndPadding()
@@ -4639,6 +4643,7 @@ func (t *Terminal) Loop() error {
if len(tokens) > 1 {
a.a = strings.Join(append(tokens[1:], tokens[0]), "|")
}
t.forceRerenderList()
case actChangeQuery:
t.input = []rune(a.a)
t.cx = len(t.input)
@@ -5101,7 +5106,7 @@ func (t *Terminal) Loop() error {
req(reqList)
case actToggleHscroll:
// Force re-rendering of the list
t.prevLines = make([]itemLine, len(t.prevLines))
t.forceRerenderList()
t.hscroll = !t.hscroll
req(reqList)
case actTrackCurrent: