f-person / git-blame.nvim

Git Blame plugin for Neovim written in Lua
GNU General Public License v3.0
839 stars 41 forks source link

Commit message with `%` character causes lualine E539: Illegal character error #109

Closed yungthai closed 8 months ago

yungthai commented 8 months ago

When showing a commit message on the lualine winbar or statusline:

      local git_blame = require("gitblame")

      opts.winbar = {
         lualine_c = {
           { git_blame.get_current_blame_text, cond = git_blame.is_blame_text_available },
          },
       }

It appears when navigating to any committed change that has a % character in its commit message, lualine will throw a E539: Illegal character error.

Steps to reproduce:

This plugin may need "to escape % in it's output as they have special meaning in statusline".

yungthai commented 8 months ago

https://github.com/nvim-lualine/lualine.nvim/issues/873

yungthai commented 8 months ago

https://github.com/SmiteshP/nvim-navic/issues/65

yungthai commented 8 months ago

This plugin already escapes the % character.

However, it's the adjacent character after the % (e.g. a space, quotation mark " or ', etc...) that causes the lualine E539 error.

Thus it's more suitable to further manipulate the commit message string within the user's lualine configuration.

Apology for the added noise.

f-person commented 8 months ago

Apology for the added noise.

Hey! No problem! Maybe this will help someone who stumbles upon something similar sometime in the future :)