mirror of
https://github.com/TermoraDev/termora.git
synced 2026-01-15 18:02:58 +08:00
feat: vim 支持鼠标滚动
This commit is contained in:
@@ -65,10 +65,11 @@ class TerminalPanelMouseTrackingAdapter(
|
||||
}
|
||||
|
||||
override fun mouseWheelMoved(e: MouseWheelEvent) {
|
||||
if (shouldSendMouseData) {
|
||||
if (this.shouldSendMouseData || terminalModel.isAlternateScreenBuffer()) {
|
||||
val unitsToScroll = e.unitsToScroll
|
||||
val encode = terminal.getKeyEncoder()
|
||||
.encode(TerminalKeyEvent(if (e.wheelRotation < 0) KeyEvent.VK_UP else KeyEvent.VK_DOWN))
|
||||
if (encode.isBlank()) return
|
||||
|
||||
for (i in 0 until abs(unitsToScroll)) {
|
||||
ptyConnector.write(encode)
|
||||
|
||||
Reference in New Issue
Block a user