mirror of
https://github.com/jtdaugherty/brick.git
synced 2024-11-26 09:06:56 +03:00
Improve editor cursor placement with moveCursorClosest from text-zipper 0.12
This commit is contained in:
parent
8eb41ca8c3
commit
c832aef14a
@ -128,7 +128,7 @@ library
|
||||
contravariant,
|
||||
stm >= 2.4.3,
|
||||
text,
|
||||
text-zipper >= 0.11,
|
||||
text-zipper >= 0.12,
|
||||
template-haskell,
|
||||
deepseq >= 1.3 && < 1.5,
|
||||
unix,
|
||||
|
@ -125,7 +125,7 @@ handleEditorEvent e ed = return $ applyEdit f ed
|
||||
VtyEvent ev ->
|
||||
handleVtyEvent ev
|
||||
MouseDown n _ _ (Location pos) | n == getName ed ->
|
||||
Z.moveCursor (swap pos)
|
||||
Z.moveCursorClosest (swap pos)
|
||||
_ -> id
|
||||
handleVtyEvent ev = case ev of
|
||||
EvPaste bs -> case decodeUtf8 bs of
|
||||
|
Loading…
Reference in New Issue
Block a user