Skip to content

Commit b52c252

Browse files
committed
Use defined constants
1 parent 04c7105 commit b52c252

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

v2/keyloop.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@ func Loop(tty *vt100.TTY, fnord FilenameOrData, lineNumber LineNumber, colNumber
14341434
// Do not reset cut/copy/paste status
14351435

14361436
// First check if we just moved to this line with the arrow keys
1437-
justMovedUpOrDown := kh.PrevHas("↓", "↑")
1437+
justMovedUpOrDown := kh.PrevHas(downArrow, upArrow)
14381438
if e.macro != nil {
14391439
e.Home()
14401440
} else if !justMovedUpOrDown && e.EmptyRightTrimmedLine() && e.SearchTerm() == "" {
@@ -1461,7 +1461,7 @@ func Loop(tty *vt100.TTY, fnord FilenameOrData, lineNumber LineNumber, colNumber
14611461
// Do not reset cut/copy/paste status
14621462

14631463
// First check if we just moved to this line with the arrow keys, or just cut a line with ctrl-x
1464-
justMovedUpOrDown := kh.PrevHas("↓", "↑", "c:24")
1464+
justMovedUpOrDown := kh.PrevHas(downArrow, upArrow, "c:24")
14651465
if e.AtEndOfDocument() || e.macro != nil {
14661466
e.End(c)
14671467
} else if !justMovedUpOrDown && e.AfterEndOfLine() && e.SearchTerm() == "" {
@@ -2048,7 +2048,7 @@ func Loop(tty *vt100.TTY, fnord FilenameOrData, lineNumber LineNumber, colNumber
20482048
const arrowKeyHighlightTime = 1200 * time.Millisecond
20492049

20502050
// Draw and/or redraw everything, with slightly different behavior over ssh
2051-
justMovedUpOrDown := kh.PrevIsWithin(arrowKeyHighlightTime, "↓", "↑")
2051+
justMovedUpOrDown := kh.PrevIsWithin(arrowKeyHighlightTime, downArrow, upArrow)
20522052
e.RedrawAtEndOfKeyLoop(c, status, justMovedUpOrDown, true)
20532053

20542054
notEmptyLine := !e.EmptyLine()
@@ -2069,7 +2069,7 @@ func Loop(tty *vt100.TTY, fnord FilenameOrData, lineNumber LineNumber, colNumber
20692069
}
20702070
highlightTimerMut.Lock()
20712071
defer highlightTimerMut.Unlock()
2072-
justMovedUpOrDownOrLeftOrRight := kh.PrevIsWithin(arrowKeyHighlightTime, "↓", "↑")
2072+
justMovedUpOrDownOrLeftOrRight := kh.PrevIsWithin(arrowKeyHighlightTime, downArrow, upArrow)
20732073
if e.waitWithRedrawing.Load() {
20742074
e.waitWithRedrawing.Store(false)
20752075
} else if !justMovedUpOrDownOrLeftOrRight && regularEditingRightNow {

0 commit comments

Comments
 (0)