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: Handle folded lines correctly #1338

Merged
merged 2 commits into from
May 21, 2024
Merged

Conversation

techee
Copy link
Member

@techee techee commented Apr 25, 2024

This PR addresses some issues of the plugin with folded lines - see the individual commits.

I'd also like to automatically set the cursor position when a block gets folded to be set on the visible line (and not hidden somewhere inside the fold) but right now I don't know how to correctly react to the fold events - see https://sourceforge.net/p/scintilla/bugs/2438/

@scresto09 Do the changes look OK to you and does the plugin behave correctly with them?

@scresto09
Copy link
Contributor

Hello,

After read the https://sourceforge.net/p/scintilla/bugs/2438/ report, I think the best way to automatically set the cursor position on the visible line is surely to track the SCN_MARGINCLICK event.

I did some modification to handle this with the commit 5608b74 in pull request #1326

What do you think about this ?
Thanks

@scresto09
Copy link
Contributor

It seems there are some issues with the changes in commit 907b9bc, for example the cursor can no longer go up to the first line, or when some lines wrap.

I've made some changes to try and fix this with the commit 274ff97 . What do you think about this ?
Thanks

We need to perform the moves based on visible lines and not plain document
lines as the latter may be folded and then the moves are made incorrectly.
…ming a command

Without this, using e.g. 'w' to go to the next word makes the cursor
go "inside" the fold and disappear. Vim seems to auto-expand the fold
in such situations so do the same.
@techee techee merged commit 23d0a58 into geany:master May 21, 2024
2 checks passed
@scresto09
Copy link
Contributor

scresto09 commented May 22, 2024

OK, it works fine, thanks

@scresto09
Copy link
Contributor

I just create #1349 for SCN_MARGINCLICK part.

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.

None yet

2 participants