-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
Limit selection highlighting to within a single line and avoid crash #1447
Conversation
I can't reproduce the original crash. Is there a sample file you can provide that reliably crashes? |
@danirabbit It did not seem particularly difficult to reproduce the crash provided the recipe above is followed - the important thing is that the selection includes the line ending and there are multiple highlights. I'll push a file in a minute though. |
@danirabbit Try this file. Place the cursor at the beginning of (e.g) Make sure you have the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay, so I can still reproduce the crash if I select a line by double clicking it, but only sometimes. I can't find good reproduction conditions.
But also, this breaks highlighting matches when selecting with the keyboard
So I dunno about this fix. It seems to only stop crashing sometimes and it breaks the functionality of the plugin, but also only sometimes
@danirabbit Yes, its difficult to fix properly when the cause is obscure. Must some kind of race I guess - I can reliably reproduce on my system and the fix seem reliable here too. I'll convert to draft pending the cause being identified better. |
This did not fix it for me. It is odd, it doesn't seem to be even hitting the plug-in code before it crashes, so this may be an issue with gtksourceview. |
Closing in favour of #1470 |
Fixes #1443
To reproduce issue:
<Shift>Down
(The repeated line is selected and highlighted)BackSpace
to delete the highlighted lineThis PR stops the highlight word selection plugin highlighting selections covering more than one line as deleting such selections with
BackSpace
causes a crash. The exact cause of the crash was not determined as it did not yield a useful backtrace.Also, in passing, the current search context is cancelled earlier when the selection changes.