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

Sometimes when I press arrow up or down the cursor jumps a whole paragraph. How do I make it always move only one row at a time? #1193

Open
bitcoinmeetups opened this issue Sep 23, 2018 · 3 comments

Comments

@bitcoinmeetups
Copy link

Sometimes when I press arrow up or down the cursor jumps a whole paragraph. How do I make it always move only one row at a time?

@pbsds
Copy link
Contributor

pbsds commented Oct 30, 2018

This is probably due to how micro handles line wrapping.
Micro simply jumps to the next line of text when you press down, but this is unintuitive due to the wrapped lines spanning multiple rows in the terminal.

@terokarvinen
Copy link

terokarvinen commented Apr 27, 2021

Working up/down movement with soft-wrapped lines would be an important feature, and it's a common feature in text editors.

When writing prose (blogs, research...) it would be natural to write one paragraph in one line, and let micro wrap it to current window size. Current behavior where up/down arrow jumps whole paragraphs makes it infeasible to use soft wrap. But when soft wrap is disabled, other people editing those documents find the excess line feeds odd.

This bug has been discussed already in 2016 in "Up/Down navigation ignores soft-wrap" #498 . That bug was closed with a comment introducing a plugin emulating correct up/down arrow behavior, micro-natural-navigation-plugin. https://github.com/samdmarshall/micro-natural-navigation-plugin . Unfortunately, the plugin repository is now archived, so the plugin is probably unsupported.

Luckily, the source code of the archived plugin is still available. Based on the short Lua code of the plugin, adding this feature built-in to micro is possible.

Correct cursor movement on wrapped lines would be a useful feature in micro itself.

@terokarvinen
Copy link

I tested the discontinued natural-navigation-plugin, and it does not work in micro 2.0.8. Maybe it could still be useful example for implementing this behavior.

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