Giter Site home page Giter Site logo

Comments (6)

wincent avatar wincent commented on June 25, 2024

You should be able to debug this by strategically inserting some print(vim.inspect(value)) statements right before the lines where the error is being thrown. You'll probably find that in a spot like this (not sure if this is the exact spot that is error, but it will be something like this):

local fg = pinnacle.extract_fg(status_highlight)
local bg = pinnacle.extract_bg("StatusLine")
print(vim.inspect(fg))
print(vim.inspect(bg))
vim.cmd("highlight User4 " .. pinnacle.highlight({ bg = bg, fg = fg }))

If, say, fg or bg ends up being an empty string, that could cause the :highlight command to error, and so the next step is debugging why the associated highlight group (eg. StatusLine, or Identifier etc) doesn't have that set.

I'm using base16-vim, and I find that all the highlight groups have defined values. In your local set-up, something else must be happening; fixing it might mean doing something to the colorscheme, or to your statusline.lua file.

I'm currently using TreeSitter and when I try to implement the blur/focus methods you use, I can't get TreeSitter disabled for the inactive buffers. How would you deal with this?
Also, how would I add the gps to the statusline right after the file type next to the filename?

I'm not using either of those, so I don't have any specific advice to offer about them.

from wincent.

SingularisArt avatar SingularisArt commented on June 25, 2024

After a little digging, I found the issue. For some reason, when using the pinnacle plugin, the highlight variable was being set to: ctermbg=#505050 ctermfg=#d0d0d0 gui=italic. So, I just added :gsub("cterm", "gui") at the end of each line when modifying the highlight variable.

I'm going to keep this issue open since I'm currently working on getting the statusbar to work with gps and to get TreeSitter working along with the focus/blur method. Once I've completed these tasks, I'll post my results here and close the issue, just in case anyone else wants the same.

from wincent.

SingularisArt avatar SingularisArt commented on June 25, 2024

Alrighty. I just completed the gps part of the statusbar. Here's how the statusbar looks like.

Screenshot_2022-08-30_14-15-40

Here's the code (I put this right after: .. "%)" -- End item group.)

      .. "%*" -- Reset highlight group.
      .. "%3*" -- Switch to User3 highlight group (bold).
      .. "%= %<%{%v:lua.require'nvim-navic'.get_location()%} %=" -- Navic in Center.
      .. "%*" -- Reset highlight group.

Of course, to get this working, you need to have nvim-navic installed and configured.
Here's my configuration for nvim-navic.

I'll try and get the TreeSitter + focus/blur done today and close this issue as soon as possible.

from wincent.

SingularisArt avatar SingularisArt commented on June 25, 2024

Finally. I figured out the final issue. I disable TreeSitter and IndentLine by adding the following autocmds:

autocmd("BufEnter", "*", "TSBufEnable highlight")
autocmd("BufEnter", "*", "IndentBlanklineToggle")
autocmd("BufLeave", "*", "TSBufDisable highlight")
autocmd("BufLeave", "*", "IndentBlanklineDisable")

This does bring about the following issues. When opening something like a float, it disables highlighters and indentation, but after leaving, it doesn't bring them back.

@wincent How would you create an autocmd that only triggers when leaving a buffer, and then re-entering another buffer?

from wincent.

wincent avatar wincent commented on June 25, 2024

@wincent How would you create an autocmd that only triggers when leaving a buffer, and then re-entering another buffer?

Unfortunately, autocmds are notoriously fiddly, especially once you have multiple plug-in installed, firing autocmds, listening to autocmds, suppressing autocmds (eg. with :noautocmd, 'eventignore') etc. I don't really have any generic advice here, other than using 'verbose', :verbose, 'verbosefile' to capture debug information about what events are being triggered, and in what order, and to work from there.

from wincent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.