m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-16 23:33:39 -05:00

Enhance click-header event

* Expose the name of the mouse action as $FZF_KEY
* Trigger click-header on mouse up
* Enhanced clickable header for `kill` completion
This commit is contained in:
Junegunn Choi
2025-01-27 01:10:08 +09:00
parent 2c15cd7923
commit e91f10ab16
8 changed files with 151 additions and 54 deletions

View File

@@ -626,15 +626,13 @@ func (r *LightRenderer) mouseSequence(sz *int) Event {
// middle := t & 0b1
left := t&0b11 == 0
// shift := t & 0b100
// ctrl := t & 0b1000
mod := t&0b1100 > 0
drag := t&0b100000 > 0
ctrl := t&0b10000 > 0
alt := t&0b01000 > 0
shift := t&0b00100 > 0
drag := t&0b100000 > 0 // 32
if scroll != 0 {
return Event{Mouse, 0, &MouseEvent{y, x, scroll, false, false, false, mod}}
return Event{Mouse, 0, &MouseEvent{y, x, scroll, false, false, false, ctrl, alt, shift}}
}
double := false
@@ -658,7 +656,7 @@ func (r *LightRenderer) mouseSequence(sz *int) Event {
}
}
}
return Event{Mouse, 0, &MouseEvent{y, x, 0, left, down, double, mod}}
return Event{Mouse, 0, &MouseEvent{y, x, 0, left, down, double, ctrl, alt, shift}}
}
func (r *LightRenderer) smcup() {