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

Split window plugin shows circle markers for markers created by plugins in the main window #3603

Open
techee opened this issue Oct 16, 2023 · 5 comments
Labels
splitwindow Related to the buil-in SplitWindow plugin

Comments

@techee
Copy link
Member

techee commented Oct 16, 2023

For instance, in the screenshot below, the split view shows a circle where the git-changebar shows a diff and these markers are life-added/removed as the code is edited.

I had a look at the code but I don't understand how it is possible that the split window's Scintilla gets affected by the marker change in the main window. From what I understand, the split window plugin shares the underlying Scintilla buffer with the main window so the changes made in one editor appear in the other editor. But this IMO shouldn't affect things like markers because the Scintilla instances are separate.

I kind of understand why it's the white circle - it's the marker number 0 and it's not set to the right value for the split window but I don't understand why it appears at all. I also tried adding some extra code to git-changebar to make sure that e.g. some Geany callback doesn't return the split window's Scintilla but it doesn't seem to be the case.

(This is not some recent regression - I tried it with Geany 1.38 and it behaves the same way.)

Screenshot 2023-10-16 at 13 35 06
@techee techee added the splitwindow Related to the buil-in SplitWindow plugin label Oct 16, 2023
@elextr
Copy link
Member

elextr commented Oct 16, 2023

Do the change markers have to be set up in each Scintilla individually? If so it probably isn't being done on the split because the plugins don't know about its existence (as its a plugin itself).

@techee
Copy link
Member Author

techee commented Oct 16, 2023

Do the change markers have to be set up in each Scintilla individually? If so it probably isn't being done on the split because the plugins don't know about its existence (as its a plugin itself).

This is what I would expect - but then the markers shouldn't appear at all. I would expect no markers at all in the splitview plugin.

@elextr
Copy link
Member

elextr commented Oct 16, 2023

Scintilla docs, "By default, all 32 markers are set to SC_MARK_CIRCLE with a black foreground and a white background."

It would appear that the marker is added to the shared buffer, but the rendering is in each Scintilla.

@techee
Copy link
Member Author

techee commented Oct 16, 2023

It would appear that the marker is added to the shared buffer

Oh, I misread the code - I thought it was using SCI_GETCHARACTERPOINTER and that would be sharing just gchar *. But it's SCI_GETDOCPOINTER so it's the Scintilla's "document" which is shared and it probably stores the information about markers too.

So yeah, it's less mysterious now and also probably not something we can fix easily.

@elextr
Copy link
Member

elextr commented Oct 16, 2023

Yeah, makes sense, the markers are per line, and lines exist in the document, not the view.

So per line data has to exist in the document, and per line data is where the marker number is stored, which shows as a white circle for any marker not properly set up in the view, for example in the split window view.

I don't think there is much we can do about any artefacts of interfering plugins, there have been cases of plugins using overlapping hard coded marker numbers etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
splitwindow Related to the buil-in SplitWindow plugin
Projects
None yet
Development

No branches or pull requests

2 participants