Skip to content

Fix E539: replace dot-containing highlight group names in gitinfo() - #7

Closed
glepnir with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-e539-illegal-character-crash
Closed

Fix E539: replace dot-containing highlight group names in gitinfo()#7
glepnir with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-e539-illegal-character-crash

Conversation

Copilot AI commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Neovim's statusline parser rejects . inside %#...# highlight group tokens with E539: Illegal character, killing the render coroutine. gitinfo() was producing strings like %#@diff.plus# and %#@diff.Head# via a prefix + dot-joined alias scheme.

Changes

  • lua/modeline/provider.lua
    • Replace alias entries with dot-free names: { 'ModeLineGitHead', 'diffAdded', 'diffChanged', 'diffRemoved' }
    • Drop the @diff. prefix in the format string: %%#@diff.%s#%%#%s#
    • Define ModeLineGitHead (linked to Title) via nvim_set_hl with default = true at the top of gitinfo()
-- before
local alias = { 'Head', 'plus', 'minus', 'delta' }
('%%#@diff.%s#%s%%*'):format(alias[i], signs[i] .. dict[order[i]])

-- after
vim.api.nvim_set_hl(0, 'ModeLineGitHead', { link = 'Title', default = true })
local alias = { 'ModeLineGitHead', 'diffAdded', 'diffChanged', 'diffRemoved' }
('%%#%s#%s%%*'):format(alias[i], signs[i] .. dict[order[i]])

Co-authored-by: glepnir <41671631+glepnir@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix E539: Illegal character crash in lua/modeline/provider.lua Fix E539: replace dot-containing highlight group names in gitinfo() Aug 13, 2026
Copilot AI requested a review from glepnir August 13, 2026 12:04
Copilot stopped work on behalf of glepnir due to an error August 13, 2026 12:08
@glepnir glepnir closed this Aug 13, 2026
Copilot stopped work on behalf of glepnir due to an error August 13, 2026 12:08
Copilot stopped work on behalf of glepnir due to an error August 13, 2026 12:09
@glepnir glepnir reopened this Aug 13, 2026
@glepnir glepnir closed this Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants