mirror of
https://github.com/junegunn/fzf.git
synced 2025-12-22 20:21:29 +08:00
Fix change-nth
* Proper clean-up of caches * Force rerender list after the action
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user