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

vimode: Fix caret position change when performing line operations #1139

Merged
merged 2 commits into from
May 7, 2023

Conversation

techee
Copy link
Member

@techee techee commented Nov 23, 2021

This pull request fixes the problem related to caret position change reported in #1136.

techee added 2 commits May 7, 2023 20:58
The previous code was incorrect. The new code just

1. Goes to the last position in document
2. Goes one position before that
3. Checks if the lines corresponding to (1) and (2) are identical - in this
case the NL is missing at EOF
When current position is changed in the document and this position is
outside the visibility of the current screen, when returning
back, the call of SCI_GOTOPOS causes window scroll to a different position
than before.

To avoid this problem, insert_eof_nl_if_missing() and remove_char_from_eof()
avoid setting the position now and, instead, insert/remove the EOL
character using operations that don't change caret position.
@techee techee merged commit c6af6c3 into geany:master May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant