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

Vim mode #47

Open
4 of 8 tasks
obrien-chris opened this issue Feb 25, 2017 · 4 comments
Open
4 of 8 tasks

Vim mode #47

obrien-chris opened this issue Feb 25, 2017 · 4 comments

Comments

@obrien-chris
Copy link

obrien-chris commented Feb 25, 2017

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
  • $ -- On the last line of the document
  • O -- On the first line of the document
  • I -- (Capital 'i') On the first line of the document
  • 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.

@robinvd
Copy link
Contributor

robinvd commented Feb 26, 2017

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

@ChrisPenner
Copy link
Owner

ChrisPenner commented Feb 26, 2017

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 😁

robinvd pushed a commit to robinvd/rasa that referenced this issue Feb 26, 2017
robinvd pushed a commit to robinvd/rasa that referenced this issue Feb 26, 2017
robinvd pushed a commit to robinvd/rasa that referenced this issue Feb 26, 2017
@ChrisPenner
Copy link
Owner

#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.

@robinvd
Copy link
Contributor

robinvd commented Mar 2, 2017

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

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

3 participants