Git Product home page Git Product logo

dim.lua's Introduction

Hey I'm Astro

Developer lost in space

Trophy


dim.lua's People

Contributors

0oastro avatar akinsho avatar coffebar avatar gelio avatar github-actions[bot] 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

dim.lua's Issues

Treesitter error on exiting neovim

Hi ๐Ÿ‘‹๐Ÿฟ

Thanks for this plugin, it's really cool. I'm currently running nvim 0.8 nightly and noticed that when I leave neovim I now get this output. It seems that something invalid is being sent to the query function. I'm not super familiar with how the query is being use, but maybe you can pick something out of the output

Error detected while processing DiagnosticChanged Autocommands for "*":
E5108: Error executing lua ...-c87a5eb/share/nvim/runtime/lua/vim/treesitter/query.lua:434: bad argument #2 to 'handler' (string expected, got nil)
stack traceback:
	[C]: in function 'handler'
	...-c87a5eb/share/nvim/runtime/lua/vim/treesitter/query.lua:434: in function 'match_preds'
	...-c87a5eb/share/nvim/runtime/lua/vim/treesitter/query.lua:519: in function '(for generator)'
	...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:105: in function 'fn'
	...b/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:194: in function 'for_each_tree'
	...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:85: in function 'get_treesitter_hl'
	...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:47: in function 'highlight_word'
	...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:129: in function 'hig_unused'
	[string ":lua"]:1: in main chunk
	[C]: in function 'nvim_exec_autocmds'
	...m/HEAD-c87a5eb/share/nvim/runtime/lua/vim/diagnostic.lua:1414: in function 'reset'
	...r/neovim/HEAD-c87a5eb/share/nvim/runtime/lua/vim/lsp.lua:955: in function <...r/neovim/HEAD-c87a5eb/share/nvim/runtime/lua/vim/lsp.lua:947>%

Normal usage major bug

During normal usage, the following errors appear:

image

followed by

image

These errors keep returning so the only way to resolve them is to keep the plugin disabled.

To reproduce this, create a Python file and start typing def hello(w:. A similar issue can be seen when deleting the top half of a function.

Throws error with nightly nvim and treesitter

Upon exiting nvim I see this in the shell:

Error detected while processing DiagnosticChanged Autocommands for "*":
E5108: Error executing lua ...ganf/usr/share/nvim/runtime/lua/vim/treesitter/query.lua:434: bad argument #1 to 'handler' (string expected, got nil)
stack traceback:
	[C]: in function 'handler'
	...ganf/usr/share/nvim/runtime/lua/vim/treesitter/query.lua:434: in function 'match_preds'
	...ganf/usr/share/nvim/runtime/lua/vim/treesitter/query.lua:519: in function '(for generator)'
	/home/ajitid/.local/share/nvim/plugged/dim.lua/lua/dim.lua:110: in function 'fn'
	...r/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:194: in function 'for_each_tree'
	/home/ajitid/.local/share/nvim/plugged/dim.lua/lua/dim.lua:90: in function 'get_treesitter_hl'
	/home/ajitid/.local/share/nvim/plugged/dim.lua/lua/dim.lua:47: in function 'highlight_word'
	/home/ajitid/.local/share/nvim/plugged/dim.lua/lua/dim.lua:135: in function 'hig_unused'
	[string ":lua"]:1: in main chunk
	[C]: in function 'nvim_exec_autocmds'
	...im.a2Cganf/usr/share/nvim/runtime/lua/vim/diagnostic.lua:1414: in function 'reset'
	...ount_nvim.a2Cganf/usr/share/nvim/runtime/lua/vim/lsp.lua:955: in function <...ount_nvim.a2Cganf/usr/share/nvim/runtime/lua/vim/lsp.lua:947>โŽ                                        

I've seen this happening when I open a typescript file and close neovim afterwards.

PS: Is it possible for this plugin to only update dimming highlights after I exit insert or select mode?

Error `attempt to call method '_get_hl_from_capture' (a nil value)` in Nightly

The following error is displayed in the latest version of Neovim Nightly:

Error detected while processing DiagnosticChanged Autocommands for "*":
E5108: Error executing lua ...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:121: attempt to call method '_get_hl_from_capture' (a nil value)
stack traceback:
        ...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:121: in function 'fn'
        ...1/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:210: in function 'for_each_tree'
        ...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:95: in function 'get_treesitter_hl'
        ...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:47: in function 'highlight_word'
        ...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:140: in function 'hig_unused'
        [string ":lua"]:1: in main chunk
        [C]: in function 'nvim_exec_autocmds'
        ...HEAD-9a5ac06_1/share/nvim/runtime/lua/vim/diagnostic.lua:727: in function 'set'
        ...-9a5ac06_1/share/nvim/runtime/lua/vim/lsp/diagnostic.lua:206: in function 'handler'
        ...neovim/HEAD-9a5ac06_1/share/nvim/runtime/lua/vim/lsp.lua:1056: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

This could be related to the breaking change neovim/neovim#14090 (comment) as I can see in the code that that function is used:

https://github.com/NarutoXY/dim.lua/blob/1fef581aaa3afebe0cfa8cb93ff747b107cb86be/lua/dim.lua#L80-L86

The CPU usage is too high

As title. And it seems that even though I provide change_in_insert = false,, it is still dimming out text in insert mode.

Without this plugin the CPU usage is always < peak=50% (with LSP enable, browsing one of my lua config <300 lines). When this plugin is enabled the number goes to >75%(when typing long text). And the delay is sensible.

This problem must be taken seriously to really make it useful in real(i.e. large) projects.

Version support is clear

dim.lua sounds interesting. The README says near the top of "dim is a lua plugin for neovim 0.7.0 dev", but then says later "Neovim >= 0.6.0". This seems inconsistent :) Might be worth clarifying...

Thanks.

Stack trace printed when running plugin

E5108: Error executing lua ...im/0.8.1/share/nvim/runtime/lua/vim/treesitter/query.lua:499: bad argument #1 to 'handler' (string expected, got nil)
stack traceback:
	[C]: in function 'handler'
	...im/0.8.1/share/nvim/runtime/lua/vim/treesitter/query.lua:499: in function 'match_preds'
	...im/0.8.1/share/nvim/runtime/lua/vim/treesitter/query.lua:584: in function '(for generator)'
	...r/neovim/0.8.1/share/nvim/runtime/lua/vim/treesitter.lua:239: in function 'fn'
	...1/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:210: in function 'for_each_tree'
	...r/neovim/0.8.1/share/nvim/runtime/lua/vim/treesitter.lua:217: in function 'get_captures_at_pos'
	...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:82: in function 'get_treesitter_hl'
	...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:47: in function 'highlight_word'
	...al/share/nvim/site/pack/packer/start/dim.lua/lua/dim.lua:140: in function 'hig_unused'
	[string ":lua"]:1: in main chunk
	[C]: in function 'nvim_exec_autocmds'
	...r/neovim/0.8.1/share/nvim/runtime/lua/vim/diagnostic.lua:1426: in function 'reset'
	...w/Cellar/neovim/0.8.1/share/nvim/runtime/lua/vim/lsp.lua:1142: in function <...w/Cellar/neovim/0.8.1/share/nvim/runtime/lua/vim/lsp.lua:1134>

rust wrong imports coloring

used:
image
not used:
image

it's like it took the green, dimmed it and applied it to the whole thing
something similar happens with multi import statements such as
image
they work great but when everything inside the curl braces is unused the curly braces themselves turn dim green
image

Not working with tsserver

Hello,

Thank you for this plugin. I haven't been able to get it working with tsserver, but saw it mentioned on the readme. I notice there's no tests for tsserver, so I'm curious if it's supported? If so, does it require any particular diagnostic server, or setup?

I'm currently using tsserver with quick-lint-js server for diagnotics, but I tested out the eslint server (not via null-ls) to no avail.

Thanks!

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.