Skip to content

Commit f9368c4

Browse files
Fix search history deletion.
1 parent 875620b commit f9368c4

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

Keymap.hs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,13 @@ search_down = char (unkey KeyDown) `meta` \_ -> updateSearch \case
142142
zipp -> zipp
143143

144144
search_del :: LexerS
145-
search_del = char (unkey KeyDC) `meta` \_ -> updateSearch \case
146-
Zipper _ back (pv:rest) -> Zipper pv back rest
147-
Zipper _ back _ -> Zipper "" back []
145+
search_del = char (unkey KeyDC) `meta` \_ sst -> let
146+
(r, sst', ml) = flip updateSearch sst \case
147+
Zipper _ back (pv:rest) -> Zipper pv back rest
148+
Zipper _ back _ -> Zipper "" back []
149+
newhist = let Zipper cur _ _ = schZipper $ schSpec sst
150+
in filter (/=cur) $ schHist sst
151+
in (r, sst'{schHist = newhist}, ml)
148152

149153
search_esc :: LexerS
150154
search_esc = char '\ESC' `meta`

hmp3-ng.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cabal-version: 2.2
22

33
name: hmp3-ng
4-
version: 2.17.2
4+
version: 2.17.3
55
synopsis: A 2019 fork of an ncurses mp3 player written in Haskell
66
description: An mp3 player with a curses frontend. Playlists are populated by
77
passing file and directory names on the command line. 'h' displays

0 commit comments

Comments
 (0)