Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re-initializing Editor widget with contents results in cursor being stuck at 1st line #56

Closed
listx opened this issue May 19, 2016 · 3 comments

Comments

@listx
Copy link

listx commented May 19, 2016

Example (apply this diff to EditDemo.hs):

diff --git a/programs/EditDemo.hs b/programs/EditDemo.hs
index f300f88..05ad2f0 100644
--- a/programs/EditDemo.hs
+++ b/programs/EditDemo.hs
@@ -62,6 +62,7 @@ appEvent st ev =
         V.EvKey V.KEsc [] -> M.halt st
         V.EvKey (V.KChar '\t') [] -> M.continue $ switchEditors st
         V.EvKey V.KBackTab [] -> M.continue $ switchEditors st
+        V.EvKey (V.KChar ' ') [] -> M.continue st { _edit2 = (E.editor secondEditor (str . unlines) Nothing "hello\nworld")}
         _ -> M.continue =<< T.handleEventLensed st (currentEditorL st) ev

 initialState :: St

Then run it, press "TAB" (optional), then press SPACE to re-initialize/modify the 2nd editor widget to have the contents "hello\nworld". Although the words are rendered correctly (world being on the 2nd line), the cursor thinks that it's all on one line. It looks as if the cursor is hovering over extra blank space if you press Right arrow, but that appears to be the buffer where the word world is stored.

Tested on the latest 0.6.1 version by using cabal sandbox on GHC 7.10.3.

@listx listx changed the title re-initializing Editor widget with contents results in cursor location being stuck at 1st line re-initializing Editor widget with contents results in cursor being stuck at 1st line May 19, 2016
@jtdaugherty
Copy link
Owner

Thanks for the report! I'll investigate this in the next day or two as soon as I get time.

@jtdaugherty
Copy link
Owner

This fix is released in 0.6.2: http://hackage.haskell.org/package/brick-0.6.2

@listx
Copy link
Author

listx commented May 20, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants