Comments (6)
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.
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.
Alrighty. I just completed the gps part of the statusbar. Here's how the statusbar looks like.
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.
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 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)
- Improve debuggability of Lua-based mappings (etc)
- Print timing info at end of run
- nvim does not respect local settings HOT 2
- This line only works in .vim files HOT 2
- Undefined global key HOT 2
- E117: Unknown function: <SNR>140_CheckColorScheme HOT 2
- autoload HOT 5
- use Docker HOT 2
- Consider using some limited parallelism during install HOT 1
- Mutt HOT 3
- Figure out pattern for project-local reusable helpers
- Migrate to `vim.keymap` Lua API (new in Neovim v0.7.0)
- Implement "not" semantics for specifying which aspects to install
- zsh prompt looks weird HOT 2
- How does everything work?
- error while running a full install. netcat has no installation candidate HOT 4
- Prompt with non-breaking space doesn't work in Alacritty, ideas?
- Set up nvim-treesitter
- Figure out what is turning off `'spell'` in Markdown files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wincent.