Skip to content

Commit f74ba32

Browse files
Control-C exits search; other control chars ignored. (#140)
1 parent 50208a7 commit f74ba32

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Keymap.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,15 @@ searchMode stype = step where
8686
step z = renderSearch stype z $> KeyMap (`dispatch` z)
8787

8888
dispatch c z
89-
| c == '\ESC' = clearMessage *> leave
89+
| c `elem` ['\ESC', '\^C']
90+
= clearMessage *> leave
9091
| c `elem` enter' = commit z
9192
| c `elem` delete' = step $ zipEdit dropLast z
9293
| k == KeyUp = step $ zipUp z
9394
| k == KeyDown = step $ zipDown z
9495
| k == KeyDC = histDelete z
95-
| c > '\255' = step z -- ignore other special keys
96+
| c < ' ' || c > '\255'
97+
= step z -- ignore other special keys
9698
| otherwise = step $ zipEdit (++ [c]) z
9799
where k = charToKey c
98100

0 commit comments

Comments
 (0)