Code Monkey home page Code Monkey logo

codewindow.nvim's Introduction

Codewindow.nvim

Codewindow.nvim is a minimap plugin for neovim, that is closely integrated with treesitter and the builtin LSP to display more information to the user.

Codewindow in action

How it works

Opening the minimap creates a floating window that will follow the active window around, always staying on the right, filling the entire height of said window.

In this floating window you can see the text rendered out using braille characters. Unless disabled, it will also try to get the treesitter highlights from the active buffer and apply them to the minimap1. If the builtin LSP reports an error or a warning, it will also appear as a small red or yellow dot next to the line the issue is in. The current viewport is shown as 2 white lines around the block of code being observed.

The minimap updates every time you leave insert mode, change the text in normal mode or the builtin LSP reports new diagnostics.

You can also focus the minimap, this lets you quickly move through the code to get to a specific point.

Installation

Packer:

use {
  'gorbit99/codewindow.nvim',
  config = function()
    local codewindow = require('codewindow')
    codewindow.setup()
    codewindow.apply_default_keybinds()
  end,
}

Configuration

The setup method accepts an optional table as an argument with the following options (with the defaults):

{
  active_in_terminals = false, -- Should the minimap activate for terminal buffers
  auto_enable = false, -- Automatically open the minimap when entering a (non-excluded) buffer (accepts a table of filetypes)
  exclude_filetypes = { 'help' }, -- Choose certain filetypes to not show minimap on
  max_minimap_height = nil, -- The maximum height the minimap can take (including borders)
  max_lines = nil, -- If auto_enable is true, don't open the minimap for buffers which have more than this many lines.
  minimap_width = 20, -- The width of the text part of the minimap
  use_lsp = true, -- Use the builtin LSP to show errors and warnings
  use_treesitter = true, -- Use nvim-treesitter to highlight the code
  use_git = true, -- Show small dots to indicate git additions and deletions
  width_multiplier = 4, -- How many characters one dot represents
  z_index = 1, -- The z-index the floating window will be on
  show_cursor = true, -- Show the cursor position in the minimap
  screen_bounds = 'lines' -- How the visible area is displayed, "lines": lines above and below, "background": background color
  window_border = 'single' -- The border style of the floating window (accepts all usual options)
  relative = 'win' -- What will be the minimap be placed relative to, "win": the current window, "editor": the entire editor
  events = { 'TextChanged', 'InsertLeave', 'DiagnosticChanged', 'FileWritePost' } -- Events that update the code window
}

config changes get merged in with defaults, so defining every config option is unnecessary (and probably error prone).

The default keybindings are as follows:

<leader>mo - open the minimap
<leader>mc - close the minimap
<leader>mf - focus/unfocus the minimap
<leader>mm - toggle the minimap

To create your own keybindings, you can use the functions:

codewindow.open_minimap()
codewindow.close_minimap()
codewindow.toggle_minimap()
codewindow.toggle_focus()

To change how the minimap looks, you can define the following highlight groups somewhere in your config:

CodewindowBorder -- the border highlight
CodewindowBackground -- the background highlight
CodewindowWarn -- the color of the warning dots
CodewindowError -- the color of the error dots
CodewindowAddition -- the color of the addition git sign
CodewindowDeletion -- the color of the deletion git sign
CodewindowUnderline -- the color of the underlines on the minimap
CodewindowBoundsBackground -- the color of the background on the minimap

-- Example
vim.api.nvim_set_hl(0, 'CodewindowBorder', {fg = '#ffff00'})

Working alongside other plugins

I'll try to make sure, that most plugins can be made to work without any issues alongside codewindow. If you find a usecase that should be supported, but can't be, then open an issue detailing the plugin used and the issue at hand.

For the most part most plugins can simply be made to work by making them ignore the Codewindow filetype.

Performance

I tested the performance on the lua/codewindow/highlight.lua file in the repository, which was at the time of testing 179 lines long. Updating the minimap took 7.7ms on average.

Related projects

TODO

  • Help pages for the functions
  • Faster updates - theoretically only the lines that were edited need updating
  • Git support - I have a free column on the right reserved for it
  • More display options - like floating to the left, not full height, etc. etc.
  • Code cleanup - I'm putting this on the bottom, because I know I won't get to it

Footnotes

  1. Because one character in the minimap represents several in the actual buffer, it will show the highlights that occured the most in that region. โ†ฉ

codewindow.nvim's People

Contributors

akinsho avatar danielfgray avatar dhruvinsh avatar dsully avatar gorbit99 avatar iciaran avatar luckasranarison avatar nex-s avatar nyngwang avatar ofseed avatar pocco81 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

codewindow.nvim's Issues

Is it possible to add this option?

it will be cool if you could provide an option like auto_enable to open the minimap whenever the cursor moves into a buffer of a filetype that is not in the list exclude_filetypes.

Error: /nvim/lazy/codewindow.nvim/lua/codewindow/highlight.lua:241: Invalid buffer id: 51

Error executing vim.schedule lua callback: ...e/nvim/lazy/codewindow.nvim/lua/codewindow/highlight.lua:241: Invalid buffer id: 51
stack traceback:
	[C]: in function 'nvim_buf_clear_namespace'
	...e/nvim/lazy/codewindow.nvim/lua/codewindow/highlight.lua:241: in function 'display_cursor'
	...local/share/nvim/lazy/codewindow.nvim/lua/codewindow.lua:17: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>

It might be that some API calls can be protected by checking whether or not it's valid using nvim_buf_is_valid.

codewindow-issue-61-invalid_buf_id.mov

These are the two autocmds I used in the DEMO: (with the augroup name removed.)

-- if I remove the first one then the error disappear, but then the minimap will not be closed.
vim.api.nvim_create_autocmd({ 'WinLeave', 'TermEnter' }, {
  callback = vim.schedule_wrap(function ()
    require('codewindow').close_minimap()
  end)
})
vim.api.nvim_create_autocmd({ 'CursorHold' }, {
  callback = vim.schedule_wrap(function ()
    if vim.api.nvim_win_get_config(0).relative == 'editor'
      and vim.api.nvim_buf_is_valid(0)
    then
      pcall(require('codewindow').open_minimap)
    end
  end)
})

Question: would it be possible for treesitter highlights to stretch fully?

(I'm not very familiar with treesitter's internals or terminology, so please bear with me)

I'm not sure if the following two examples regarding syntax highlighting count as expected behavior, but if they do, I'd like to "fix" them:

Example 1

Let's say I have a license file:

 ... the terms of this License, in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied...

treesitter highlights the a) ... line teal (in my particular case). That line has around 350 chars, all of which are teal, however Codewindow only highlights the beginning of them:

image

(This is an average GPL v3 license. It has many a), b), c), ..., points that are all highlighted green, but they appear all white (default fg color))

It gets worse when I set width_multiplier = 1... there is no color at this point:

image

Example 2

This also happens while editing some actual code. For instance, this Lua chunk:

image

It appears almost entirely white, even though the actual code in the buffer looks like a rainbow with only a couple words having a white fg.

Questions

  1. How does Codewindow calculate the length of the highlights?
  2. What would it take for it to render colors appropriately and not just truncate most of it and fall back to <user's fg color>?

[Feautre Request] Configurable float location

Coming from https://github.com/wfxr/minimap.vim, the pane is opened on the far right and fixed for all windows interacted with.

Is it possible to have the float always be on the far right of the visible window instead of the currently interacted pane?

Reasoning is that swapping panes with window movement, it's a bit jarring having the codewindow relocate/popup and having it always align left/right of the window viewport, it'll be less jarring when changing panes.

Error: Invalid Window (id:1000)

Here is the error log I receive in the terminal after closing buffers and exiting Neovim with the codewindow toggled on:

Error executing vim.schedule lua callback: ...k/packer/start/codewindow.nvim/lua/codewindow/window.lua:90: Invalid window id: 1000
stack traceback:
	[C]: in function 'nvim_win_set_buf'
	...k/packer/start/codewindow.nvim/lua/codewindow/window.lua:90: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>

Why does this error occur and how can we get it fixed?

share: A smoother version when working with floating window

I just removed my custom autocmds for a smoother version to auto-enable minimap on floating windows, since one of the floating windows I'm working with has its content covered by it.

But it's still worth sharing with people what I did before I will actually forget it.

The problem

  1. I only want to enable minimap for floating windows so that it can work with NeoZoom.lua
  2. the current method auto_enable = true will first show the minimap in the middle of the screen before it's moved to the right of the floating window.

the demo of problem 2. can be seen in the same demo of #62.

Solution

create the autocmds yourself with the usage of vim.schedule_wrap. (I actually tried to use it in my PR for #61, but unfortunately, I didn't find the cause/culprit line(s) of problem 2.)

expand
vim.api.nvim_create_autocmd({
  'TermEnter', 'TermOpen',
  'BufLeave'
}, {
  group = curfile_augroup,
  callback = function ()
    require('codewindow').close_minimap()
  end
})
vim.api.nvim_create_autocmd({ 'BufEnter' }, {
  group = curfile_augroup,
  callback = vim.schedule_wrap(function ()
    if vim.api.nvim_win_get_config(0).relative == 'editor' then
      require('codewindow').open_minimap()
    end
  end)
})

What should/could be done?

I believe problem 1. (enable only for floating windows) can be provided by an option and 2. (directly move the minimap to the right) should be the default behavior of auto_enable = true.

[ Feature ] Keymap with cmd

hi for now the only way to keymap this plugin is this

keymap('n', '<leader>mm', codewindow.toggle_minimap, { desc = 'toggle minimap' })

but it would be nice and more flexible to have the option of a command in the cmd

keymap('n', '<leader>mm', '<cmd>Codewindow toggle_minimap<cr>', { desc = 'toggle minimap' })

basically commands like this ':Codewindow toggle'

[Feature Request] Style options for cursor display

Some subtler options for the cursor display set with show_cursor would be great. E.g.:

  • Highlight the active line rather than displaying the cursor itself
  • Represent the cursor as another circle at the minimap's edge, rather than as a block
  • Represent the cursor as another circle that travels along the minimap border

Frame 2 (1)

[Feature Request] Mouse click movement

Mouse click movement would allow jumping to lines of the file. Current behavior is the float is ignored when clicking and is passed to underlying buffer. If clicking the float could select line numbers to jump to, it'd be more intuitive.

[Feature Request] Cursor highlight group

Could a cursor highlight group be added to change the text color for the braille on the lines the cursor covers.

How the cursor location is set is great, but adding a means of highlighting the entire set of lines where the cursor is would add more emphasis.

e.g.

vim.api.nvim_set_hl(0, "CodewindowCursor", {link="ContentCursor"})

image

Error when closing window splits

I have two problems, but mostly this one:

NeoVim: 0.7.2

When having multiple splits open - as well as the codewindow - if I switch between the two splits and then close either one, I get an error message like below, but with different window ID's:

Error executing lua callback: ...e/nvim/plugged/codewindow.nvim/lua/codewindow/window.lua:72: Invalid window id: 1009
stack traceback:
	[C]: in function 'nvim_win_get_width'
	...e/nvim/plugged/codewindow.nvim/lua/codewindow/window.lua:72: in function 'get_window_config'
	...e/nvim/plugged/codewindow.nvim/lua/codewindow/window.lua:87: in function <...e/nvim/plugged/codewindow.nvim/lua/codewindow/window.lua:84>

If I open the split and close it immediately with <C-w><q>, then all is fine, but it is the switching that causes this issue.
I have tried disabling various other plugins to try and pin-point the issue to no avail.

My Plugged init:

Plug 'gorbit99/codewindow.nvim'
[...]
require("codewindow").setup()
require('codewindow').apply_default_keybinds()

I also have no tree-sitter colors showing up, and not sure if it's tied to this issue.

Minimap not switching, when moving tabs.

The minimap goes to the correct buffer when switching between windows within a tab, however when the tab is swtiched the minimap stays on the previous tab and has to be retoggled twice to appear in the new tab. Also focusing the minimap from the second tab will return you to the first tab with the minimap.

Invalid window id when trying to edit files in floating window with codewindow.nvim open

I got the following error message when I try to edit a buffer:

Error executing vim.schedule lua callback: ...k/packer/start/codewindow.nvim/lua/codewindow/window.lua:67: Invalid window id: 1026
stack traceback:
        [C]: in function 'nvim_win_get_buf'
        ...k/packer/start/codewindow.nvim/lua/codewindow/window.lua:67: in function ''
        vim/_editor.lua: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

Screencast:

Exclude Minimap in NvimTree

Is there some sort of config where the minimap does not show up whenever the plugin nvimtree is open? Right now I have the minimap show up autmatically only in certain file types, thru the auto_enable setting. But whenever I open nvimtree, the minimap moves from the current buffer, into the nvimtree window (and obviously covers most of it, since it's just a side bar type of file explorer, and not wide at all).

Is there anything I can do to prevent the minimap from appearing in the nvimtree pane/window? I'm not sure if I can put something into exclude_filetypes that would accomplish this, but not effect the minimap from opening in files that I do want.

Thanks!

[Feature Request] Git changes on the Minimap

Adding highlight of changes reported by Git on the Minimap would be lovely. Is there a chance this is ever going to be added?

I was thinking of maybe highlighting the changes the way wfxr/minimap.vim does with the g:minimap_git_colors option.

Here's how it looks with that option enabled:
image
The purple highlighted line is the one with Git changes on it.

[Feature Request] Minimap for strict buffers only

I started using the codewindow.nvim plugin in Neovim and so far I love it. But there is one drawback which is very annoying.
I use Nvim-Tree plugin which is essentially a file explorer plugin embedded in Neovim and soon as I switch buffers to open a new file the codewindow also shifts and displays the minimap of the nvim-tree plugin buffer. Can we make the minimap such that it doesn't shift buffers when moving through multiple buffers as well? Or atleast some how filter some types of buffers from having the minimap?

Stacktrace when quitting.

Error executing vim.schedule lua callback: .../pack/packer/opt/codewindow.nvim/lua/codewindow/text.lua:87: Failed to delete line
stack traceback:
	[C]: in function 'nvim_buf_set_lines'
	.../pack/packer/opt/codewindow.nvim/lua/codewindow/text.lua:87: in function 'update_minimap'
	...ack/packer/opt/codewindow.nvim/lua/codewindow/window.lua:95: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>โŽ

This happens when opening any file, and then quitting Neovim.

Feature/Idea: Only enable if 1 non-excluded filetype window is open

Say I have neo-tree open to my left (disabled codewindow here), and I have a main window with codemap to my right. Now, I might split to my right for a bit, in that time period while there's more than 1 window with code open, I'd like codewindow to be disabled as it gets too cluttered and hard to read code then with multiple split windows. I wonder if you have an easy way to do this, I'm sure this can be done in a hacky programmatic way in my config, but I'd rather not and see if you have a simple fix/autocmd suggestion :)

Thanks,
Amaan

Winbar makes codewindow too high

Hi,

I have winbar enabled in my neovim config.
Unfortunately this makes the codewindow one line too high and so my statusline gets covered by it.

With winbar enabled:
grafik

Without winbar:
grafik

Feature: let users configure events

Codewindow tends to be very slow (at least on my machine) while editing big files (800+ LOC). This is particularly noticeable when typing. I read through the source code, and found that the Codewindow in being update on TextChanged (relevant file: https://github.com/gorbit99/codewindow.nvim/blob/master/lua/codewindow/window.lua#L94)

I would like to be able to customize all (or to the very least, the one I mentioned above) event(s), mainly those that trigger Codewindow's updates. This shouldn't be that hard to implement.

An alternative solution (though not the best option) could be to delete these augroups and define them myself (on my config):

vim.api.nvim_del_augroup_by_name("CodewindowAugroup")
llocal augroup = vim.api.nvim_create_augroup('CodewindowAugroup', {})
-- .. define the autocmds to my liking 

Codewindow not working well with Neotree

When I toggle minimap in my current buffer it shows on right side as expected. then i open Neotree to browse my files and now in that buffer i see minimap. It dissapear from my code buffer and appear in other buffer that should not have it (like file explorer).
Other visual problem I have is that in my code buffer minimap bottom is overlapping with status bar (it covers bottom right corner) so I can't see percentage for file, TS icon.

Other than that I see no other major issues. Nice work!

`W18: Invalid character in group name` on startup

When starting nvim with this plugin I get the following message spam. Any ideas what might be causing this?

Error detected while processing /home/kovas/.config/nvim/init.lua:
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name
W18: Invalid character in group name

Random highlight behaviour

For some reason, I get different highlights each time I open the same file, some parts of the highlights are like moving around. Sorry I couldn't edit the video and it's quite hard to see but focus on the block of code with the green and orange color on the minimap.

highlight.bug.webm

Is it possible that this plugin can work with floating window?

I'm the author of NeoZoom.lua, which is a plugin that will open the current buffer into a floating window. I will be happy to see that it can work with codewindow.nvim :) Currently it looks like this:

Before zoom-in:

After zoom-in: As you can see the minimap is not shown (or maybe it's shown but covered by the floating window created by NeoZoom.lua)

If there is possible to adjust the z-index of the minimap (considering it's also a floating window?), maybe it would be a good idea for users to customize the z-index.

Feature Request: "Disabled Buffers" rather than "Disabled Files"

More than likely you are already working on this for the rewrite, and if that is the case, you can just give a thumbs up.

Code window is opening in buffers where it is not supposed to, and sometimes makes those buffers unusable. Because they are buffers without a file type, the user is unable to disable them via the exclude_filetypes configuration variable. So my suggestion is to configure via a exclude_buffers variable instead of the exclude_filetype variable.

Not the most creative suggestion, just an obvious one.

Moving to a different window whilst the minimap is open throws a cursor position error

Hi,

Great plugin ๐Ÿ‘๐Ÿฟ

Just tried it out and noticed that when I open the minimap in one window then open another split and change buffer it throws the error below. Keeping the window open and having it automatically switch/render the new buffer doesn't seem to work currently.

Error executing vim.schedule lua callback: ...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:176: Cursor position outside buffer                                                      
stack traceback:                                                                                                                                                                                
        [C]: in function 'nvim_win_set_cursor'                                                                                                                                                  
        ...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:176: in function 'display_screen_bounds'                                                                                    
        ...ack/packer/start/codewindow.nvim/lua/codewindow/text.lua:96: in function 'update_minimap'                                                                                            
        ...ite/pack/packer/start/codewindow.nvim/lua/codewindow.lua:20: in function 'open_minimap'                                                                                              
        ...ite/pack/packer/start/codewindow.nvim/lua/codewindow.lua:13: in function ''                                                                                                          
        vim/_editor.lua: in function ''                                                                                                                                                         
        vim/_editor.lua: in function <vim/_editor.lua:0> 

I'm not sure what the dot colours represent

๐Ÿ‘‹๐Ÿป

In the below screenshot you can see that some dots have been coloured (e.g. at the top some are green, a little bit below that there are some orange and blue dots) and I'm not sure why?

Screenshot 2022-10-26 at 09 27 21

In other files this can be a bit more distracting...

Screenshot 2022-10-26 at 09 35 06

I don't know if this is an mistake on the part of the plugin? (e.g. it's using highlight groups set by my current colour scheme) or if the colours are supposed to represent something? (e.g. it's some kind of treesitter parsing and it's trying to use the same syntax colours as the buffer content).

I'm guessing the dots are using some kind of diagnostic 'sign' symbol maybe.

Is this the case? How can I get rid of these additional colours if they are indeed meaningless in relation to what minimap is displaying (don't want to break any diagnostic stuff that my current buffer's LSP might be using for example).

Thanks!

Segmentation fault (core dumped) | ...highlight.lua:109: attempt to index a nil value

Nvim has been crashing on :quit lately, and creating a core dump. Today, I was able to catch an error message:

assertion "!entered_free_all_mem" failed: file "/home/user/neovim/src/nvim/log.c", line 145, function "logmsg"

This lead me to pull any updates to Neovim-0.8 Release and build a fresh copy. Doing so allowed the above error message to away, but in it's place I received the below monster.

Error executing vim.schedule lua callback: ...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: attempt to index a nil value
stack traceback:
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: in function 'fn'
	...l/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:210: in function 'for_each_tree'
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:83: in function 'extract_highlighting'
	...ack/packer/start/codewindow.nvim/lua/codewindow/text.lua:97: in function 'update_minimap'
	...ite/pack/packer/start/codewindow.nvim/lua/codewindow.lua:22: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: attempt to index a nil value
stack traceback:
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: in function 'fn'
	...l/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:210: in function 'for_each_tree'
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:83: in function 'extract_highlighting'
	...ack/packer/start/codewindow.nvim/lua/codewindow/text.lua:97: in function 'update_minimap'
	...ite/pack/packer/start/codewindow.nvim/lua/codewindow.lua:22: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:222: Invalid buffer id: 5
stack traceback:
	[C]: in function 'nvim_buf_clear_namespace'
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:222: in function 'display_cursor'
	...ite/pack/packer/start/codewindow.nvim/lua/codewindow.lua:14: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: attempt to index a nil value
stack traceback:
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: in function 'fn'
	...l/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:210: in function 'for_each_tree'
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:83: in function 'extract_highlighting'
	...ack/packer/start/codewindow.nvim/lua/codewindow/text.lua:97: in function 'update_minimap'
	...ite/pack/packer/start/codewindow.nvim/lua/codewindow.lua:22: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: attempt to index a nil value
stack traceback:
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: in function 'fn'
	...l/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:210: in function 'for_each_tree'
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:83: in function 'extract_highlighting'
	...ack/packer/start/codewindow.nvim/lua/codewindow/text.lua:97: in function 'update_minimap'
	...ite/pack/packer/start/codewindow.nvim/lua/codewindow.lua:22: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: attempt to index a nil value
stack traceback:
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: in function 'fn'
	...l/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:210: in function 'for_each_tree'
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:83: in function 'extract_highlighting'
	...ack/packer/start/codewindow.nvim/lua/codewindow/text.lua:97: in function 'update_minimap'
	...ite/pack/packer/start/codewindow.nvim/lua/codewindow.lua:22: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: attempt to index a nil value
stack traceback:
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: in function 'fn'
	...l/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:210: in function 'for_each_tree'
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:83: in function 'extract_highlighting'
	...ack/packer/start/codewindow.nvim/lua/codewindow/text.lua:97: in function 'update_minimap'
	...ite/pack/packer/start/codewindow.nvim/lua/codewindow.lua:22: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: attempt to index a nil value
stack traceback:
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: in function 'fn'
	...l/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:210: in function 'for_each_tree'
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:83: in function 'extract_highlighting'
	...ack/packer/start/codewindow.nvim/lua/codewindow/text.lua:97: in function 'update_minimap'
	...ite/pack/packer/start/codewindow.nvim/lua/codewindow.lua:22: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: attempt to index a nil value
stack traceback:
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: in function 'fn'
	...l/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:210: in function 'for_each_tree'
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:83: in function 'extract_highlighting'
	...ack/packer/start/codewindow.nvim/lua/codewindow/text.lua:97: in function 'update_minimap'
	...ite/pack/packer/start/codewindow.nvim/lua/codewindow.lua:22: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: attempt to index a nil value
stack traceback:
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: in function 'fn'
	...l/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:210: in function 'for_each_tree'
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:83: in function 'extract_highlighting'
	...ack/packer/start/codewindow.nvim/lua/codewindow/text.lua:97: in function 'update_minimap'
	...ite/pack/packer/start/codewindow.nvim/lua/codewindow.lua:22: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: attempt to index a nil value
stack traceback:
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: in function 'fn'
	...l/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:210: in function 'for_each_tree'
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:83: in function 'extract_highlighting'
	...ack/packer/start/codewindow.nvim/lua/codewindow/text.lua:97: in function 'update_minimap'
	...ite/pack/packer/start/codewindow.nvim/lua/codewindow.lua:22: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: attempt to index a nil value
stack traceback:
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: in function 'fn'
	...l/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:210: in function 'for_each_tree'
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:83: in function 'extract_highlighting'
	...ack/packer/start/codewindow.nvim/lua/codewindow/text.lua:97: in function 'update_minimap'
	...ite/pack/packer/start/codewindow.nvim/lua/codewindow.lua:22: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: attempt to index a nil value
stack traceback:
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: in function 'fn'
	...l/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:210: in function 'for_each_tree'
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:83: in function 'extract_highlighting'
	...ack/packer/start/codewindow.nvim/lua/codewindow/text.lua:97: in function 'update_minimap'
	...ite/pack/packer/start/codewindow.nvim/lua/codewindow.lua:22: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: attempt to index a nil value
stack traceback:
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: in function 'fn'
	...l/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:210: in function 'for_each_tree'
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:83: in function 'extract_highlighting'
	...ack/packer/start/codewindow.nvim/lua/codewindow/text.lua:97: in function 'update_minimap'
	...ite/pack/packer/start/codewindow.nvim/lua/codewindow.lua:22: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: attempt to index a nil value
stack traceback:
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: in function 'fn'
	...l/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:210: in function 'for_each_tree'
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:83: in function 'extract_highlighting'
	...ack/packer/start/codewindow.nvim/lua/codewindow/text.lua:97: in function 'update_minimap'
	...ite/pack/packer/start/codewindow.nvim/lua/codewindow.lua:22: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: attempt to index a nil value
stack traceback:
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: in function 'fn'
	...l/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:210: in function 'for_each_tree'
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:83: in function 'extract_highlighting'
	...ack/packer/start/codewindow.nvim/lua/codewindow/text.lua:97: in function 'update_minimap'
	...ite/pack/packer/start/codewindow.nvim/lua/codewindow.lua:22: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: attempt to index a nil value
stack traceback:
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: in function 'fn'
	...l/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:210: in function 'for_each_tree'
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:83: in function 'extract_highlighting'
	...ack/packer/start/codewindow.nvim/lua/codewindow/text.lua:97: in function 'update_minimap'
	...ite/pack/packer/start/codewindow.nvim/lua/codewindow.lua:22: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: attempt to index a nil value
stack traceback:
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: in function 'fn'
	...l/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:210: in function 'for_each_tree'
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:83: in function 'extract_highlighting'
	...ack/packer/start/codewindow.nvim/lua/codewindow/text.lua:97: in function 'update_minimap'
	...ite/pack/packer/start/codewindow.nvim/lua/codewindow.lua:22: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...te/pack/packer/start/hologram.nvim/lua/hologram/init.lua:47: Invalid buffer id: 5
stack traceback:
	[C]: in function 'nvim_buf_get_extmarks'
	...te/pack/packer/start/hologram.nvim/lua/hologram/init.lua:47: in function 'buf_render_images'
	...te/pack/packer/start/hologram.nvim/lua/hologram/init.lua:17: in function <...te/pack/packer/start/hologram.nvim/lua/hologram/init.lua:17>
Error executing vim.schedule lua callback: ...te/pack/packer/start/hologram.nvim/lua/hologram/init.lua:47: Invalid buffer id: 5
stack traceback:
	[C]: in function 'nvim_buf_get_extmarks'
	...te/pack/packer/start/hologram.nvim/lua/hologram/init.lua:47: in function 'buf_render_images'
	...te/pack/packer/start/hologram.nvim/lua/hologram/init.lua:17: in function <...te/pack/packer/start/hologram.nvim/lua/hologram/init.lua:17>
Error executing vim.schedule lua callback: ...te/pack/packer/start/hologram.nvim/lua/hologram/init.lua:47: Invalid buffer id: 5
stack traceback:
	[C]: in function 'nvim_buf_get_extmarks'
	...te/pack/packer/start/hologram.nvim/lua/hologram/init.lua:47: in function 'buf_render_images'
	...te/pack/packer/start/hologram.nvim/lua/hologram/init.lua:17: in function <...te/pack/packer/start/hologram.nvim/lua/hologram/init.lua:17>
Error executing vim.schedule lua callback: ...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: attempt to index a nil value
stack traceback:
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:109: in function 'fn'
	...l/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:210: in function 'for_each_tree'
	...acker/start/codewindow.nvim/lua/codewindow/highlight.lua:83: in function 'extract_highlighting'
	...ack/packer/start/codewindow.nvim/lua/codewindow/text.lua:97: in function 'update_minimap'
	...k/packer/start/codewindow.nvim/lua/codewindow/window.lua:97: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>[1]    36445 segmentation fault (core dumped)  nvim

I am going to disable hologram, which doesn't work too well, and see if that cleans up the issue. Any suggestions on what could be causing this? Or, how I screwed up my configuration?

[Feature] Allow configuring the window's appearance

It would be nice if the user could change some simple things about the window, e.g.

  • the window border style
  • the window highlights etc.

image

For example, in my case I change the border of all floating windows by all plugins to match my desired custom window border and tweak the highlights to match, but currently this isn't possible.
Also, as you can see in the screengrab the signcolumn is coloured which is probably because I highlight the background of diagnostic signs but not the sign column itself, but the highlights are probably taken from the signs themselves

Codewindow affects the packer.nvim lazy load

As title says, if I fire the codewindow first and try to to load lazy-loaded plugin for example NvimTree or Neogit it will never works.
Steps to reproduce:

  • lazy load some plugin
  • fire codewindow (<leader> m m)
  • try to open lazy load plugin (for example :NvimTreeToggle) will end in error, E492: Not an editor command: NvimTreeToggle

Onedark Plugin highlights override Codewindow's

I am using navarasu/onedark.vim colorscheme, and with it, I am unable to change CodeWindow's color manually.
The highlight group named in onedark/highlights.lua uses FloatBorder to change the borders of the window instead of Codewindow's built-in CodewindowBorder and CodewindowBackground.

Something interesting happens with this plugin though.

When setting the custom highlights:

vim.api.nvim_set_hl(0, 'CodewindowBorder', {fg = '#ffff00'})
vim.api.nvim_set_hl(0, 'CodewindowBackground', {fg = '#ffff00'})

I do not get the expected outcome. Instead, I get some random chunks inside the window being colored (mostly "grey" parts in this example), and the border being unaffected.

For now I am using vim.api.nvim_set_hl(0, 'FloatBorder', {fg = '#4fa6ed'}) (this also works for bg)

Highlights Disabled Highlights Enabled FloatBorder used
image image image

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.