rbong / vim-flog

A blazingly fast, stunningly beautiful, exceptionally powerful git branch viewer for Vim/Neovim.
750 stars 22 forks source link

mini.trailspace only gets disabled in Flog buffer after Ctrl-N or Ctrl-P #142

Closed ccjmne closed 3 weeks ago

ccjmne commented 3 weeks ago

Hey,

I'm a very new user of vim-flog and am stoked to start using it extensively: thank you for your great project! I just checked out the new release, 3.0.0 (from a mere few minutes ago!) and am experiencing some issue with mini.trailspace with Neovim.

Here's a recording of what I'm experiencing: asciicast

Here's a description of what I'm doing in the recording:

The previous version I had installed just prior to upgrading to 3.0.0 would exhibit precisely the same issue.

Maybe I am doing something wrong?

Thanks in advance!

ccjmne commented 3 weeks ago

I just noticed that note in the README:

Highlighting is done only in modifiable buffer by default, only in Normal mode, and stops in Insert mode and when leaving window.

I'm not too sure which buffer that is (sorry, gonna have to do some reading, I'm really that new to using this tool), but here's a screenshot showing that the current buffer I see the mini.trailspace highlights is indeed not modifiable:

image

Other than that, I figured the following might be of some relevance:

ccjmne commented 3 weeks ago

Ah, of course, I only notice your request for feedback open for a few weeks (#135) now... my apologies.

rbong commented 3 weeks ago

You're more than welcome to post any new issues as you see fit.

It does appear to be a problem with mini.trailspace, we're setting b:minitrailspace_disabled as soon as possible. The buffer is not modifiable, but that's after setting the buffer content. See also this comment

Workaround in init.lua:

vim.api.nvim_create_autocmd(
  "User",
  {
    pattern = { "FlogUpdate" },
    callback = function (ev)
      require("mini.trailspace").unhighlight()
    end,
  }
)
ccjmne commented 3 weeks ago

Excellent, thank you very much!