@@ -678,8 +678,10 @@ func Loop(tty *vt100.TTY, fnord FilenameOrData, lineNumber LineNumber, colNumber
678
678
679
679
e .CursorBackward (c , status )
680
680
681
- // Check if it has been pressed 2 times the last 200ms, if so, give it an extra boost
682
- if kh .TwoLastAre (leftArrow ) && kh .AllWithin (200 * time .Millisecond ) {
681
+ // Move extra if the key is held down
682
+ if kh .TwoLastAre (leftArrow ) && kh .AllWithin (200 * time .Millisecond ) && kh .LastChanged (200 * time .Millisecond ) {
683
+ e .CursorBackward (c , status )
684
+ e .CursorBackward (c , status )
683
685
e .CursorBackward (c , status )
684
686
}
685
687
@@ -704,12 +706,9 @@ func Loop(tty *vt100.TTY, fnord FilenameOrData, lineNumber LineNumber, colNumber
704
706
705
707
e .CursorForward (c , status )
706
708
707
- if kh .TwoLastAre (leftArrow ) && kh .AllWithin (200 * time .Millisecond ) {
709
+ // Move extra if the key is held down
710
+ if kh .TwoLastAre (rightArrow ) && kh .AllWithin (200 * time .Millisecond ) && kh .LastChanged (200 * time .Millisecond ) {
708
711
e .CursorForward (c , status )
709
- }
710
-
711
- // Check if it has been pressed 2 times the last 200 ms, if so, give it an extra boost
712
- if kh .TwoLastAre (rightArrow ) && kh .AllWithin (200 * time .Millisecond ) {
713
712
e .CursorForward (c , status )
714
713
e .CursorForward (c , status )
715
714
}
@@ -731,8 +730,8 @@ func Loop(tty *vt100.TTY, fnord FilenameOrData, lineNumber LineNumber, colNumber
731
730
732
731
e .CursorUpward (c , status )
733
732
734
- // Check if it has been pressed 2 times the last 200 ms, if so, give it an extra boost
735
- if kh .TwoLastAre (upArrow ) && kh .AllWithin (200 * time .Millisecond ) {
733
+ // Move extra if the key is held down
734
+ if kh .TwoLastAre (upArrow ) && kh .AllWithin (200 * time .Millisecond ) && kh . LastChanged ( 200 * time . Millisecond ) {
736
735
e .CursorUpward (c , status )
737
736
}
738
737
@@ -754,8 +753,8 @@ func Loop(tty *vt100.TTY, fnord FilenameOrData, lineNumber LineNumber, colNumber
754
753
755
754
e .CursorDownward (c , status )
756
755
757
- // Check if it has been pressed 2 times the last 200 ms, if so, give it an extra boost
758
- if kh .TwoLastAre (downArrow ) && kh .AllWithin (200 * time .Millisecond ) {
756
+ // Move extra if the key is held down
757
+ if kh .TwoLastAre (downArrow ) && kh .AllWithin (200 * time .Millisecond ) && kh . LastChanged ( 200 * time . Millisecond ) {
759
758
e .CursorDownward (c , status )
760
759
}
761
760
0 commit comments