-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
ColorHelper adds duplicated (two) colorbox phantoms if a view is splitted #187
Comments
I'm going to need to find a clear way to associate two separate views as being the same view. |
Okay, I think we can distinguish the two views from each other but still link them back together: >>> sublime.active_window().active_view().id()
244
>>> sublime.active_window().active_view().is_primary()
False
>>> sublime.active_window().active_view().buffer().primary_view().id()
240 I'm going to have to sit down and go over how to handle this information throughout all the code, but it should be fixable, at least on ST 4081+. |
In older builds |
That's a good point. I'll start using the obvious method in 4081+ to see if issues are restricted to previews and where the necessary checks need to be. Once I identify all of that, I can implement a backwards-compatible way. This shows how often I use |
There is a bug in Sublime. If the primary view of a clone is closed, the clone does not become the primary. |
I may just need to track previews by the buffer id instead of triggering on whether the view is a clone or not. |
Looks like tracking previews by buffer id is going to be the fix. This should be backwards compatible as well. That's not to say you can't create some edge cases that will trip up ColorHelper. You could create a clone and set the clone to a different syntax than the primary. Doing so may cause some confusing phantoms in one view vs the other as clones share phantoms, but there is nothing I can really do about that right now. Ideally, the primary would be the source reference for the phantoms, but checking primary support is kind of broken in Sublime. Anyways, things are looking much better now: |
If I change the syntax of one view, all clones change accordingly. That's also what I'd expect to happen as syntax should be bound to buffer rather than to a view into it. |
Nope. That's not happening to me. I tried exactly that and both view's update to the new syntax. Tried both normal and SAFE MODE with ST 4113. |
I think you meant ST 4112 unless you have super-secret access to new builds 🙂.
Again, that is fine. That's just not what I'm seeing. With all of that said though, the scenario I mention is not a likely one. I wouldn't imagine many people trying to work with cloned views in different syntaxes. If no one else has this issue, maybe it is a local issue with mine, or specific to macOS, who knows. Regardless, it was an issue for me before the fix and after the fix, so it is nothing introduced with the fix. I'm more noting it as something they may or may not happen, but it sounds like it probably won't affect you. |
Hmm, yeah, there is something on my system causing this weird issue with different syntaxes selected. Safe mode fixes it. I'll dig deeper. |
It seems Sublime doesn't actually change the views syntax. When you change one view to a different syntax, calling This is weird, and a problem for another day. This syncing of views seems a bit fragile or maybe there is a better way I can manage things in BH 🤷🏻. |
I'm still inclined to believe there are more Sublime bugs related to clone. Even in safe mode, you can create a primary view and a clone view, change one syntax, and yes they sync up, but close the clone and the primary will still report the old syntax, but show the new syntax. Here we have a CSS view whose clone was changed to Plain Text. The clone was closed, and while the primary view still shows Plain Text, if you request the syntax (in multiple ways) from the view you get CSS. But test for the scope and you get Plain Text. Things seem a bit buggy with clones in general, so I'm not even sure if it is worth putting in the effort to see why BracketHighlighter may interfere. Regardless, the filed bug will be fixed, but I am almost certain ColorHelper may run into some bug related to clones weird settings handling. |
Would probably worth a core issue then, with all the details found. |
I've added the info to the recent clone issue I created. |
Description
Seems ColorHelper has some issues with ST4's new multi-tab features. As soon as a view is cloned into the same group, a second color box appears.
... or a third ...
Support Info
Steps to Reproduce Issue
The text was updated successfully, but these errors were encountered: