SCI_LINEDOWN goes down only one display line, hence when line wrapping was enabled and a line wrapped over more than two lines, it was impossible to go to the next actual line when pressing j.
Note that this still doesn't emulate vim behavior correctly where caret-x position is saved for actual lines and not display lines. But this change at least makes j go the next line when wrapping is enabled.
Note that I'm not completely sure whether this change retains all workarounds [mentioned in `cmd_goto_up`](https://github.com/geany/geany-plugins/blob/341cab4e13c122b2b74e6f31a43be9ad...). You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany-plugins/pull/748
-- Commit Summary --
* vimode: Fix goto_down with line wrapping
-- File Changes --
M vimode/src/cmds/motion.c (2)
-- Patch Links --
https://github.com/geany/geany-plugins/pull/748.patch https://github.com/geany/geany-plugins/pull/748.diff
Yep, looks good to me. I don't use wrapping much so I haven't noticed this. I can imagine there will be more problems with wrapping with some other commands.
Your patch works correctly because SET_POS_NOX() doesn't update the remembered x position and subsequent SCI_LINEDOWN recovers it. It's real pity there's no getter for the remembered x position in Scintilla and that we have to do stuff like this.
@frlan Can be merged I think.
@pcworld Just a note - I don't look at the geany-plugins page that often and I'm not subscribed to receive all the pull requests so if you want to submit some other patches, it's better to @techee me so I'm notified something is happening.
@techee Good for merging anyway?
@frlan Yeah, it can be merged.
Merged #748 into master.
github-comments@lists.geany.org