Fork me on GitHub
Filipe Silva12:02:03

have you noticed namespace requires not being highlighted sometimes?


Can't say I have. Is it new?


Not highlighted as in no rainbows?

Filipe Silva12:02:43

I think not, I'm pretty sure I saw it happen before

Filipe Silva12:02:57

they show up like this

Filipe Silva12:02:02

then when I click on the editor


That is probably new...

Filipe Silva12:02:33

I think I only see this happening when: • I have multiple editors side by side • I am switching between them • I am alt tabbing • I am scrolling up and down


Highlight is quite fokused on the currently active editor. Maybe that is what is (not) going on...


What if you scroll the content without clicking there?

Filipe Silva12:02:42

ok, I think I have a more detailed repro now that I write those things down: • open two editors side by side • scroll them down enough that you don't see the requires • alt tab to another window • alt tab back to editor • scroll both editors without clicking them • the one that wasn't active won't have rainbow parens/brackets on sections that were not visible

Filipe Silva12:02:56

yes it happens when scrolling without selecting

Filipe Silva12:02:15

and not just on require stuff

Filipe Silva12:02:20

I think it's everything

Filipe Silva12:02:41

then I made the editor active

Filipe Silva12:02:51

I don't think this is an important thing, I just thought I'd mention it because I noticed it


Yeah, Calva only does that work on the active editor. An issue would be nice. It's fixable with some amount of work. But also, the issue can help people figure out that we know about it.

Filipe Silva12:02:05

don't even need to alt tab really


Awesome. Thanks!


meh, there is an issue in 2.0.77


best way I can describe it is that the rainbow'ing applies to the visible buffer, not the file.


If I have a long function, and it shows balanced, fine. Then I scroll so that the top 'defn' line goes off the top of the screen, it shows one imbalanced paren (at the end). As I scroll more off the top, it looks like that situation holds


Rainbows are now applied to the visible buffer, yes. But it tries to take enough of the context outside to not be thrown out of balance when forms start above the visible top. Can you repro with some open source code?


I just discovered that yes, in fact, there were unbalanced parens, but waaayy back in the (ns)


still seems like odd behavior


OK. Yes, it relies on balance above the rainbowed range, and it is a bit undefined what happens when there is a lack of balance. Can you try this build and see if it handles the situation better or worse for that case you have there?


Anyway, generally, if I have done things right, a bracket marked as imbalanced should mean that there is something out of balance in the file, above/before the marked bracket. Hopefully close, but in the case of having scrolled a bit down from the actual error it can be quite a bit away.


In the build I just linked to I go some extra mile to not be thrown out of balance. Theoretically it improves 50% of the cases. But the important part is that I think I might have a chance of always knowing where the error originated and thus options to surface that knowledge to the user. It is all still just at the edges of my mental grasp of it, but I can ”sense” this possibility. Hopefully my intuition is founded in something in reality. 😃

calva 4

I can't tell much of a difference - honestly - at least not in that particular file.


Probably because your imbalance was amongst the other 50%. 😎