Code Monkey home page Code Monkey logo

shade.nvim's People

Contributors

alex-popov-tech avatar sunjon 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

shade.nvim's Issues

Invalid window id on `help only`

If i start nvim with help only window, I got and invalid window id error:

> nvim -c 'help | only'

Error detected while processing VimEnter Autocommands for "*":
E5108: Error executing lua .../shade.nvim/lua/shade.lua:166: Invalid window id: 1003

And then, if I open a new split window, I got the same error for shade.lua:155 line

Invalid window is when closing Neogit

Similar to #19 I get an Invalid window id: error when exiting [neogit].

E5108: Error executing lua ...nvim/site/pack/packer/start/neogit/lua/neogit/status.lua:712: Vim(call):E5108: Error executing lua ...che/nvim/site/pack/packer/start/shade.nvim/lua/shade.lua:322: Invalid window id: 1082

Repro steps

  1. Open neovim with minimal_init.lua file nvim --clean -u minimal_init.lua
  2. Open Neogit :Neogit
  3. Quit the window with q
  4. See error

minimal_init.lua

local install_path = "/tmp/nvim/site/pack/packer/start/packer.nvim"
local compile_path = install_path .. "/plugin/packer_compiled.lua"
vim.opt.packpath = "/tmp/nvim/site"

local function load_plugins()
  require("packer").startup({
    function(use)
      use("wbthomason/packer.nvim")
      use("sunjon/Shade.nvim")
      use({ "TimUntersberger/neogit", requires = "nvim-lua/plenary.nvim" })
    end,
    config = { compile_path = compile_path, package_root = "/tmp/nvim/site/pack" },
  })
end

_G.load_config = function()
  require("shade").setup()
  require("neogit").setup()
end

if vim.fn.isdirectory(install_path) == 0 then
  vim.fn.system({ "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path })
end
load_plugins()
require("packer").sync()
vim.cmd([[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]])

Disable shade for certain filetypes

Is there a way to disable shade for certain filetypes? I am using mundo for the undo history, but with shade active it is not as useful:

mundo

So maybe ab ignore list or similar would be helpful? Or expose the command ShadeDisable, ShadeEnable, and ShadeToggle so there is a possibility to use autocommands.

Numbers appear broken

  • nvim --version: NVIM v0.5.0-dev+1256-gd19348923
  • Operating system/version:
DISTRIB_ID=ManjaroLinux
DISTRIB_RELEASE=21.0
DISTRIB_CODENAME=Ornara
DISTRIB_DESCRIPTION="Manjaro Linux"
  • $TERM: alacritty
  • font: Cica

Steps to reproduce

nvim -u minvimrc -i NONE

" minvimrc
set encoding=utf-8

filetype plugin indent on
if has('vim_starting')
  let s:pluin_manager_dir='~/.config/nvim/.plugged/vim-plug'
  execute 'set runtimepath+=' . s:pluin_manager_dir
endif
call plug#begin('~/.config/nvim/.plugged')
Plug '~/ghq/github.com/sunjon/Shade.nvim'
call plug#end()

set nobackup
set nowritebackup
set noswapfile
set updatecount=0
set backspace=indent,eol,start
language messages en_US.utf8

lua << EOF

require'shade'.setup {
  overlay_opacity = 15,
  opacity_step = 1,
  keys = {
    brightness_up = '<C-up>',
    brightness_down = '<C-down>',
    toggle = '<Space>ss',
  },
  -- debug = true,
}

EOF

Actual behaviour

shade-nvim

Expected behaviour

I want the numbers to be displayed correctly.
When I set the width to 18, it displays correctly.

width = 16,

collect

Thank you!

Newbie question

Where does the config element go? Could you please add that to the readme with an example

shade ignores transparency

the Shade plugin itself works very well but I've enabled transparency in my neovim and it seems Shade disables that transparency and changes it to a black background.

Shade breaks colorscheme

I don't know why this is happening, but when using shade, my colorscheme seems to also be affected.

Terminal: Alacritty
NVIM version: NVIM v0.6.1

With Shade enabled

image

Without Shade

image

Breaks nvim-cmp LSP documentation

It seems this plugin breaks the LSP documentation from showing:
image

It took me a while to track down what the cause was - by systematically removing bits of my config until I removed this plugin and bam the documentation was working again. It could be a combination with the rest of my setup as well. Happy to help debug further just let me know what you need.

I like the idea of this plugin! It makes it nice to see which split I am/was working in :)

Active file highlight not restored after using git-messenger

  1. Calling git-messenger correctly shades the rest of the file.

Screen Shot 2022-04-14 at 5 07 25 PM

2. Moving cursor away turns off the git-messenger ui, but the active file brightness is not restored afterwards.

Screen Shot 2022-04-14 at 5 09 06 PM

Is this expected? This does look like an edge case to the regular way of switching between buffers.

Mason Install Window broken

Hi guys,

I would like to thank you guys for this plugin because before installing I had issues to know in with part of neovim I was working when I had to do something on another program and return to it. However, recently I am having the problem that will be better explained by the screenshots below:

MasonOK
Before or when I deactivate the plugin

MasonProblem
With the plugin on

Lemme know how I can help you guys to solve this issue

Best, Eddie

Error when using tabs

Do the following:

  • :tabnew
  • :tabclose

Error:

Error detected while processing WinClosed Autocommands for "*":                                    
E5108: Error executing lua ...are/nvim/site/pack/packer/start/shade.nvim/lua/shade.lua:280: Invalid window
 id: 1010
Error detected while processing WinEnter Autocommands for "*":
E5108: Error executing lua ...are/nvim/site/pack/packer/start/shade.nvim/lua/shade.lua:255: Invalid window
 id: 1010

Don't use this plugin with nvim-tree.lua

It will cause a lot of error like the following:

E5108: Error executing lua ...e/pack/packer/start/nvim-tree.lua/lua/nvim-tree/view.lua:347: Vim:E444: Cannot close last window

Which will cost you so much time and find nothing.

Unshaded zones on window resize

Hi!
If I narrow the size of active window/buffer/split, a newly opened part of inactive window appears to be unshaded.
I guess, some autocmd needs to be added to reshade inactive windows/buffers/splits on every resize
image

Bad performace when scrolling

After installing this and using the setup() in the readme, I noticed that my neovim was really laggy when I scroll by holding down J or K. However when I run neovim with nvim -u NORC and then :luafile my config it works just fine.

"Invalid window ID" when using with Vista.vim

Hello. I use vista.vim for symbol lookups and it seems that I can reliably make Shade error by doing the following:

  1. Open a document
  2. Open Vista (I use the command :Vista!! to toggle) - Vista opens correctly
  3. Close vista (again I use :Vista!!) - Vista hides correctly but the part that was occupied by the side panel is now "Shaded"
  4. Open Vista again - I receive an error

The error is the following:

Error detected while processing WinEnter Autocommands for "*":                                                                                                       
E5108: Error executing lua /home/penaz/.config/nvim/plugged/shade.nvim/lua/shade.lua:178: Invalid window id: 1003

Thank you in advance for your help.

Conflict with Goyo

Behavior : Launching Goyo plugin in a split then switching split causes a core dump of nvim

Terminal error message:

/src/nvim/ui_compositor,c.358: compose_line Assertion until>col failed

Expected Behavior: revert to normal highlighting but without core dump


NVIM v0.6.0-dev
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-QYeQt9/neovim-0.5.0+ubuntu2+git202107071802-3de777d25-d569569c9=. -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/build/neovim-QYeQt9/neovim-0.5.0+ubuntu2+git202107071802-3de777d25-d569569c9/build/config -I/build/neovim-QYeQt9/neovim-0.5.0+ubuntu2+git202107071802-3de777d25-d569569c9/src -I/build/neovim-QYeQt9/neovim-0.5.0+ubuntu2+git202107071802-3de777d25-d569569c9/.deps/usr/include -I/usr/include -I/build/neovim-QYeQt9/neovim-0.5.0+ubuntu2+git202107071802-3de777d25-d569569c9/build/src/nvim/auto -I/build/neovim-QYeQt9/neovim-0.5.0+ubuntu2+git202107071802-3de777d25-d569569c9/build/include
Compiled by buildd@lgw01-amd64-030

Features: +acl +iconv +tui
See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Plugin changes the highlight groups of terminal

Great plugin, so hoping it fixes whatever issues come up.

My neovim terminal's colours get all distorted with this plugin. I am using sainnhe/edge but I guess this might happen in general. Can you check?

E5108: Error executing lua [string ":lua"]:1: module 'shade' not found

Hello ๐Ÿ‘‹

I'm using neovim v.0.7.2 with a vimrc file written in vimscript.
I already have different lua plugins which work well (e.g. neotree, nvim-treesitter, ...) but I can't get Shade to work properly.

I added this to my vimrc:

    " sunjon/Shade.nvim: Dim inactive windows {{{
        Plug 'sunjon/Shade.nvim'
lua <<EOF
require'shade'.setup({
  overlay_opacity = 50,
  opacity_step = 1,
  keys = {
    brightness_up    = '<C-Up>',
    brightness_down  = '<C-Down>',
    toggle           = '<Leader>s',
  }
})
EOF
    " }}}

Made sure to run :PlugInstall and I have the repo cloned in my ~/.vim/plugged directory.

But when I start neovim I get the following error:

Error detected while processing /home/statox/.vimrc:
line  209:
E5108: Error executing lua [string ":lua"]:1: module 'shade' not found:
        no field package.preload['shade']
        no file './shade.lua'
        no file '/home/runner/work/neovim/neovim/.deps/usr/share/luajit-2.1.0-beta3/shade.lua'
        no file '/usr/local/share/lua/5.1/shade.lua'
        no file '/usr/local/share/lua/5.1/shade/init.lua'
        no file '/home/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/shade.lua'
        no file '/home/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/shade/init.lua'
        no file './shade.so'
        no file '/usr/local/lib/lua/5.1/shade.so'
        no file '/home/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/shade.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
        [C]: in function 'require'
        [string ":lua"]:1: in main chunk

I'm not sure if the issue comes from the plugin or from my setup, could you point me in the right direction?

Thank you in advance and congrats on your plugin which looks really good!

Broken background update on colorscheme switch at runtime

It seems like shade is preventing the background color of some words from changing on cholorscheme switching at runtime (when using :colorscheme)

Actual Behaviour

actual

Expected Behaviour (after removing shade)

expected

tested with all variants of both ayu and iceberg with only shade and the two aforementioned colorscheme plugins using packer.

shade was setup with zero config

require'shade'.setup()

lose background color?

au ColorScheme * hi Normal ctermbg=none guibg=none cause lose background color?

not use Shade.nvim and au ColorScheme * hi Normal ctermbg=none guibg=none before colorscheme

1

use Shade.nvim and au ColorScheme * hi Normal ctermbg=none guibg=none before colorscheme

au ColorScheme * hi Normal ctermbg=none guibg=none
colorscheme xxx

3-fix

change the order:

colorscheme xxx
au ColorScheme * hi Normal ctermbg=none guibg=none

5

but I still want to use au ColorScheme * hi Normal ctermbg=none guibg=none before colorscheme

Change autocomands for lua

https://github.com/sunjon/Shade.nvim/blob/master/lua/shade.lua#L259

I think nvim already has autocomands, no need to keep old vimscript calls:

  -- setup autocommands -- TODO: set a precalculated winid
  api.nvim_exec([[
    augroup shade
    au!
    au WinEnter,VimEnter * call v:lua.require'shade'.autocmd('WinEnter',  win_getid())
    au WinClosed         * call v:lua.require'shade'.autocmd('WinClosed', expand('<afile>'))
    au TabEnter          * call v:lua.require'shade'.autocmd('TabEnter',  win_getid())
    au OptionSet         diff call v:lua.require'shade'.autocmd('OptionSet', win_getid())
    augroup END
  ]], false)

Unmaintained?

Hi. Is this project unmaintained?

If so, I request to archive it and encourage others to fork it. Thanks.

Shade cant work with telescope

Error detected while processing WinClosed Autocommands for "*":
E5108: Error executing lua ...share/nvim/site/pack/packer/opt/shade.nvim/lua/shade.lua:326: Invalid window id: 1008
stack traceback:
        [C]: in function 'nvim_win_close'
        ...share/nvim/site/pack/packer/opt/shade.nvim/lua/shade.lua:326: in function 'on_win_closed'
        ...share/nvim/site/pack/packer/opt/shade.nvim/lua/shade.lua:439: in function 'fn'
        ...share/nvim/site/pack/packer/opt/shade.nvim/lua/shade.lua:456: in function <...share/nvim/site/pack/packer/opt/shade.nvim/lua/shade.lua:428>
Error detected while processing WinEnter Autocommands for "*":
E5108: Error executing lua ...share/nvim/site/pack/packer/opt/shade.nvim/lua/shade.lua:182: Invalid window id: 1006
stack traceback:
        [C]: in function 'nvim_win_get_option'
        ...share/nvim/site/pack/packer/opt/shade.nvim/lua/shade.lua:182: in function 'shade_tabpage'
        ...share/nvim/site/pack/packer/opt/shade.nvim/lua/shade.lua:295: in function 'on_win_enter'
        ...share/nvim/site/pack/packer/opt/shade.nvim/lua/shade.lua:436: in function 'fn'
        ...share/nvim/site/pack/packer/opt/shade.nvim/lua/shade.lua:456: in function <...share/nvim/site/pack/packer/opt/shade.nvim/lua/shade.lua:428>
Error detected while processing TabEnter Autocommands for "*":
E5108: Error executing lua ...share/nvim/site/pack/packer/opt/shade.nvim/lua/shade.lua:194: Invalid window id: 1008
stack traceback:
        [C]: in function 'nvim_win_close'
        ...share/nvim/site/pack/packer/opt/shade.nvim/lua/shade.lua:194: in function 'remove_all_overlays'
        ...share/nvim/site/pack/packer/opt/shade.nvim/lua/shade.lua:442: in function 'fn'
        ...share/nvim/site/pack/packer/opt/shade.nvim/lua/shade.lua:456: in function <...share/nvim/site/pack/packer/opt/shade.nvim/lua/shade.lua:428>

Please remove print

Shade.nvim/lua/shade.lua

Lines 416 to 426 in 4286b5a

M.toggle = function()
if state.active then
remove_all_overlays()
print("off")
state.active = false
else
create_tabpage_overlays(0)
print("on")
state.active = true
end
end

Please remove print("off") and print("on")

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.