rasa
rasa copied to clipboard
Vim mode
Each of these keys don't work as intended at certain points in the document:
Normal Mode
- [ ] o -- On the last line of the document
- [ ] A -- On the last line of the document
- [x] $ -- On the last line of the document
- [x] O -- On the first line of the document
- [x] I -- (Capital 'i') On the first line of the document
- [x] 0 -- (Zero) On the first line of the document -- From my investigation: In Vim.hs, these keys use the functions startOfLine and endOfLine. Both these functions search for a newline character which I assume is missing at the start and end of the document.
Insert Mode
-
[ ] Backspace -- At the start of any line will Backspace will delete any text to the right of the cursor, then once the line is empty will cause the cursor to disappear on that line and delete the line beneath it.
-
[ ] x -- Will delete empty lines.
I think we can generalize the problems to 2 core issues: the functions startOfLine, endOfLine and delete on the start of a line
Yes; @robinvd is correct; I'll let you guys work through on this one, but to give you a place to start I'd recommend implementing some new variant of startOfLine and endOfLine which depend on Coords instead of newlines 👍; startOfLine will be a bit easier, so try that one first 😁
#48 fixes the movements 😁
Remaining issues are:
Aon last line doesn't go 'past' the last character,oon last line carries the last characterxand Backspace are still broken on empty lines.
You are forgetting the Backspace on the start of the line. I think the issue is that moveByN (-1) doesnt travel past lines. Maybe we need a function that just moves in a 2 dimensional space over the text