fix: insert r_padding within final highlight#1368
fix: insert r_padding within final highlight#1368shadmansaleh merged 1 commit intonvim-lualine:masterfrom
Conversation
6f2c715 to
4af1035
Compare
| if self.status:reverse():find('%*%%.*#.*#%%') == 1 then | ||
| -- When component has changed the highlight at the end | ||
| -- we will add the padding before the highlight terminates | ||
| self.status = self.status:sub(1, -3) .. string.rep(' ', r_padding) .. self.status:sub(-2, -1) |
There was a problem hiding this comment.
Explain this line please. Why are you removing only last 2 chars and not the HL group mapping %#group_name# ?
There was a problem hiding this comment.
This line inserts padding at the end of the <text> part of a string of the form %#Group#<text>%*, so the only characters to hold out are the last two characters %*.
|
What's the point of having a HL marker at end of a component anyway? it'll get reset for the next component either way. If it's because the source you're taking data from already has HL markers then you can just remove the HL marker in user config side with |
|
There isn't a separate HL marker at the end, it's just that if a component is wrapped in a HL marker, |
|
See the screenshots in the OP: this PR addresses the miscolored space after |
When a component ends with a custom highlight, any
r_paddingshould be added inside that highlight, not after, just like howl_paddingis added inside a custom starting highlight. This PR takes care of that.This is required to fully address folke/trouble.nvim#569 (see also folke/trouble.nvim#616 for the fix to trouble.nvim's own part in the issue).
Before:

After:
