rasa icon indicating copy to clipboard operation
rasa copied to clipboard

Vim mode

Open obrien-chris opened this issue 8 years ago • 4 comments

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.

obrien-chris avatar Feb 25 '17 22:02 obrien-chris

I think we can generalize the problems to 2 core issues: the functions startOfLine, endOfLine and delete on the start of a line

robinvd avatar Feb 26 '17 18:02 robinvd

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 😁

ChrisPenner avatar Feb 26 '17 19:02 ChrisPenner

#48 fixes the movements 😁

Remaining issues are:

  • A on last line doesn't go 'past' the last character,
  • o on last line carries the last character
  • x and Backspace are still broken on empty lines.

ChrisPenner avatar Feb 27 '17 15:02 ChrisPenner

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

robinvd avatar Mar 02 '17 17:03 robinvd