abzcoding / lvim

🧑‍🚀 Bloated LunarVim 🚀
MIT License
475 stars 65 forks source link

Bufferline crashes when opening Cargo.toml; `bufferline/groups.lua:489: attempt to index local 'sublist' (a nil value)` #79

Closed alechp closed 2 years ago

alechp commented 2 years ago

Summary

Reproduce

  1. Uninstall Lunarvim

    bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/master/utils/installer/uninstall.sh)

  2. Install Lunarvim rolling

    LV_BRANCH=rolling bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/rolling/utils/installer/install.sh)

    Problem 1: Opening Cargo.toml causes bufferline to crash

  3. Install abz lvim (did this because default version of Rust Tools not working with Lvim; your config for nvim-dap & nvim-dap-ui works flawlessly)

    install LunarVim

    mv ~/.config/lvim ~/.config/lvim_backup git clone https://github.com/abzcoding/lvim.git ~/.config/lvim lvim +LvimUpdate +LvimCacheReset +q lvim # run :PackerSync

E5108: Error executing lua ...ack/packer/opt/bufferline.nvim/lua/bufferline/groups.lua:489: attempt to index local 'sublist' (a nil value)                        
stack traceback:                                                                                                                                                  
        ...ack/packer/opt/bufferline.nvim/lua/bufferline/groups.lua:489: in function 'sort_by_groups'                                                             
        ...ack/packer/opt/bufferline.nvim/lua/bufferline/groups.lua:509: in function 'render'                                                                     
        .../site/pack/packer/opt/bufferline.nvim/lua/bufferline.lua:108: in function <.../site/pack/packer/opt/bufferline.nvim/lua/bufferline.lua:99> 

Problem 1 screenshots

Problem 2: white highlight on Rust files (not on JS files)

✅ With this JS example, the active buffer looks normal

Screen Shot 2022-08-29 at 2 01 13 PM

❌ With Rust example, active buffer has a strange white highlight

Screen Shot 2022-08-29 at 1 56 05 PM

:healthcheck log hop: require("hop.health").check() ======================================================================== ## Ensuring keys are unique - OK: Keys are unique ## Checking for deprecated features - OK: All good mason: require("mason.health").check() ======================================================================== ## mason.nvim report - OK: neovim version >= 0.7.0 - OK: **Go**: `go version go1.18.3 darwin/amd64` - OK: **cargo**: `cargo 1.63.0 (fd9c4297c 2022-07-01)` - WARNING: **luarocks**: not available - OK: **Ruby**: `ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.x86_64-darwin21]` - OK: **RubyGem**: `3.0.3.1` - WARNING: **Composer**: not available - OK: **PHP**: `PHP 8.1.7 (cli) (built: Jun 9 2022 14:21:07) (NTS)` - OK: **npm**: `8.12.1` - OK: **node**: `v18.4.0` - OK: **python3**: `Python 3.9.7` - OK: **pip3**: `pip 21.2.4 from /usr/local/Caskroom/miniconda/base/lib/python3.9/site-packages/pip (python 3.9)` - OK: **javac**: `javac 13.0.2` - OK: **java**: `openjdk version "13.0.2" 2020-01-14` - WARNING: **julia**: not available - OK: **wget**: `GNU Wget 1.21.3 built on darwin21.3.0.` - OK: **curl**: `curl 7.79.1 (x86_64-apple-darwin21.0) libcurl/7.79.1 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.11 nghttp2/1.45.1` - OK: **gzip**: `Apple gzip 353.100.22` - OK: **tar**: `bsdtar 3.5.1 - libarchive 3.5.1 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8 ` - OK: **bash**: `GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin21)` - OK: **sh**: `Ok` - OK: GitHub API rate limit. Used: 0. Remaining: 5000. Limit: 5000. Reset: Mon Aug 29 15:29:32 2022. null-ls: require("null-ls.health").check() ======================================================================== - OK: prettier: the command "prettier" is executable. - OK: stylua: the command "stylua" is executable. - OK: goimports: the command "goimports" is executable. - OK: cmake_format: the command "cmake-format" is executable. - OK: scalafmt: the command "scalafmt" is executable. - OK: sqlformat: the command "sqlformat" is executable. - OK: terraform_fmt: the command "terraform" is executable. - OK: alejandra: the command "alejandra" is executable. - OK: shfmt: the command "shfmt" is executable. - OK: black: the command "black" is executable. - OK: isort: the command "isort" is executable. - OK: hadolint: the command "hadolint" is executable. - OK: shellcheck: the command "shellcheck" is executable. - OK: luacheck: the command "luacheck" is executable. - OK: vint: the command "vint" is executable. - OK: chktex: the command "chktex" is executable. - OK: deadnix: the command "deadnix" is executable. - OK: statix: the command "statix" is executable. - OK: markdownlint: the command "markdownlint" is executable. - OK: vale: the command "vale" is executable. - OK: shellcheck: the command "shellcheck" is executable. - INFO: gomodifytags: cannot verify if the command is an executable. - INFO: gostructhelper: cannot verify if the command is an executable. - INFO: dictionary: cannot verify if the command is an executable. - OK: prettierd: the command "prettierd" is executable. nvim: health#nvim#check ======================================================================== ## Configuration - WARNING: Missing user config file: /Users/alechp/.config/nvim/init.vim - ADVICE: - :help |init.vim| ## Performance - OK: Build type: Release ## Remote Plugins - OK: Up to date ## terminal - INFO: key_backspace (kbs) terminfo entry: key_backspace=^H - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~ - INFO: $TERM_PROGRAM='tmux' - INFO: $COLORTERM='truecolor' ## tmux - OK: escape-time: 10 - INFO: Checking stuff - OK: focus-events: on - INFO: $TERM: xterm - INFO: default-terminal: screen-256color - ERROR: $TERM differs from the tmux `default-terminal` setting. Colors might look wrong. - ADVICE: - $TERM may have been set by some rc (.bashrc, .zshrc, ...). nvim-treesitter: require("nvim-treesitter.health").check() ======================================================================== ## Installation - OK: `tree-sitter` found 0.20.6 (ccd6bf554d922596ce905730d98a77af368bba5c) (parser generator, only needed for :TSInstallFromGrammar) - OK: `node` found v18.4.0 (only needed for :TSInstallFromGrammar) - OK: `git` executable found. - OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" } Version: Apple clang version 13.1.6 (clang-1316.0.21.2.5) - OK: Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI. ## Parser/Features H L F I J - swift ✓ ✓ . . . - d ✓ . ✓ ✓ ✓ - ocaml ✓ ✓ ✓ . ✓ - elm ✓ . . . ✓ - fennel ✓ ✓ . . ✓ - vue ✓ . ✓ ✓ ✓ - elixir ✓ ✓ ✓ ✓ ✓ - erlang ✓ . ✓ . . - scss ✓ . . ✓ . - toml ✓ ✓ ✓ ✓ ✓ - julia ✓ ✓ ✓ ✓ ✓ - solidity ✓ . . . . - html ✓ ✓ ✓ ✓ ✓ - kotlin ✓ ✓ ✓ . ✓ - java ✓ ✓ . ✓ ✓ - markdown ✓ . ✓ . ✓ - make ✓ . . . ✓ - hcl ✓ . ✓ ✓ ✓ - ruby ✓ ✓ ✓ ✓ ✓ - help ✓ . . . . - gomod ✓ . . . ✓ - bash ✓ ✓ ✓ . ✓ - cmake ✓ . ✓ . . - c ✓ ✓ ✓ ✓ ✓ - python ✓ ✓ ✓ ✓ ✓ - go ✓ ✓ ✓ ✓ ✓ - ledger ✓ . ✓ ✓ ✓ - latex ✓ . ✓ . ✓ - rust ✓ ✓ ✓ ✓ ✓ - r ✓ ✓ . ✓ ✓ - regex ✓ . . . . - dockerfile ✓ . . . ✓ - zig ✓ . ✓ ✓ ✓ - query ✓ ✓ ✓ ✓ ✓ - cpp ✓ ✓ ✓ ✓ ✓ - vim ✓ ✓ ✓ . ✓ - php ✓ ✓ ✓ ✓ ✓ - teal ✓ ✓ ✓ ✓ ✓ - rego ✓ . . . ✓ - dart ✓ ✓ . ✓ ✓ - nix ✓ ✓ ✓ . ✓ - javascript ✓ ✓ ✓ ✓ ✓ - lua ✓ ✓ ✓ ✓ ✓ - yaml ✓ ✓ ✓ ✓ ✓ - jsonc ✓ ✓ ✓ ✓ ✓ - fish ✓ ✓ ✓ ✓ ✓ - scala ✓ . ✓ . ✓ - graphql ✓ . . ✓ ✓ - tsx ✓ ✓ ✓ ✓ ✓ - perl ✓ . ✓ . . - json ✓ ✓ ✓ ✓ . - jsdoc ✓ . . . . - css ✓ . ✓ ✓ ✓ - c_sharp ✓ ✓ ✓ . ✓ - comment ✓ . . . . - typescript ✓ ✓ ✓ ✓ ✓ Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections +) multiple parsers found, only one will be used x) errors found in the query, try to run :TSUpdate {lang} provider: health#provider#check ======================================================================== ## Clipboard (optional) - OK: Clipboard tool found: pbcopy ## Python 3 provider (optional) - INFO: `g:python3_host_prog` is not set. Searching for python3 in the environment. - INFO: Multiple python3 executables found. Set `g:python3_host_prog` to avoid surprises. - INFO: Executable: /usr/local/Caskroom/miniconda/base/bin/python3 - INFO: Other python executable: /usr/bin/python3 - INFO: Other python executable: /usr/local/bin/python3 - INFO: Python version: 3.9.7 - INFO: pynvim version: 0.4.3 - OK: Latest pynvim is installed. ## Python virtualenv - OK: no $VIRTUAL_ENV ## Ruby provider (optional) - INFO: Ruby: ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.x86_64-darwin21] - WARNING: `neovim-ruby-host` not found. - ADVICE: - Run `gem install neovim` to ensure the neovim RubyGem is installed. - Run `gem environment` to ensure the gem bin directory is in $PATH. - If you are using rvm/rbenv/chruby, try "rehashing". - See :help |g:ruby_host_prog| for non-standard gem installations. - You may disable this provider (and warning) by adding `let g:loaded_ruby_provider = 0` to your init.vim ## Node.js provider (optional) - INFO: Node.js: v18.4.0 - INFO: Nvim node.js host: /Users/alechp/.config/yarn/global//node_modules/neovim/bin/cli.js - OK: Latest "neovim" npm/yarn package is installed: 4.10.1 ## Perl provider (optional) - WARNING: "Neovim::Ext" cpan module is not installed - ADVICE: - See :help |provider-perl| for more information. - You may disable this provider (and warning) by adding `let g:loaded_perl_provider = 0` to your init.vim telescope: require("telescope.health").check() ======================================================================== ## Checking for required plugins - OK: plenary installed. - OK: nvim-treesitter installed. ## Checking external dependencies - OK: rg: found ripgrep 13.0.0 - OK: fd: found fd 8.4.0 ## ===== Installed extensions ===== ## Telescope Extension: `file_create` - INFO: No healthcheck provided ## Telescope Extension: `fzf` - INFO: No healthcheck provided ## Telescope Extension: `notify` - INFO: No healthcheck provided ## Telescope Extension: `projects` - INFO: No healthcheck provided vim.lsp: require("vim.lsp.health").check() ======================================================================== - INFO: LSP log level : WARN - INFO: Log path: /Users/alechp/.cache/lvim/lsp.log - INFO: Log size: 12 KB vim.treesitter: require("vim.treesitter.health").check() ======================================================================== - INFO: Runtime ABI version : 14 - OK: Loaded parser for bash: ABI version 13 - OK: Loaded parser for c: ABI version 13 - OK: Loaded parser for cmake: ABI version 13 - OK: Loaded parser for comment: ABI version 13 - OK: Loaded parser for cpp: ABI version 13 - OK: Loaded parser for css: ABI version 13 - OK: Loaded parser for c_sharp: ABI version 13 - OK: Loaded parser for d: ABI version 14 - OK: Loaded parser for dart: ABI version 13 - OK: Loaded parser for dockerfile: ABI version 13 - OK: Loaded parser for elixir: ABI version 13 - OK: Loaded parser for elm: ABI version 13 - OK: Loaded parser for erlang: ABI version 13 - OK: Loaded parser for fennel: ABI version 13 - OK: Loaded parser for fish: ABI version 13 - OK: Loaded parser for go: ABI version 13 - OK: Loaded parser for gomod: ABI version 13 - OK: Loaded parser for graphql: ABI version 13 - OK: Loaded parser for hcl: ABI version 13 - OK: Loaded parser for help: ABI version 13 - OK: Loaded parser for html: ABI version 13 - OK: Loaded parser for java: ABI version 13 - OK: Loaded parser for javascript: ABI version 13 - OK: Loaded parser for jsdoc: ABI version 13 - OK: Loaded parser for json: ABI version 13 - OK: Loaded parser for jsonc: ABI version 13 - OK: Loaded parser for julia: ABI version 13 - OK: Loaded parser for kotlin: ABI version 13 - OK: Loaded parser for latex: ABI version 13 - OK: Loaded parser for ledger: ABI version 13 - OK: Loaded parser for lua: ABI version 13 - OK: Loaded parser for make: ABI version 13 - OK: Loaded parser for markdown: ABI version 13 - OK: Loaded parser for nix: ABI version 13 - OK: Loaded parser for ocaml: ABI version 13 - OK: Loaded parser for perl: ABI version 13 - OK: Loaded parser for php: ABI version 13 - OK: Loaded parser for python: ABI version 13 - OK: Loaded parser for query: ABI version 13 - OK: Loaded parser for r: ABI version 13 - OK: Loaded parser for regex: ABI version 13 - OK: Loaded parser for rego: ABI version 13 - OK: Loaded parser for ruby: ABI version 13 - OK: Loaded parser for rust: ABI version 13 - OK: Loaded parser for scala: ABI version 13 - OK: Loaded parser for scss: ABI version 13 - OK: Loaded parser for solidity: ABI version 13 - OK: Loaded parser for swift: ABI version 14 - OK: Loaded parser for teal: ABI version 14 - OK: Loaded parser for toml: ABI version 13 - OK: Loaded parser for tsx: ABI version 13 - OK: Loaded parser for typescript: ABI version 13 - OK: Loaded parser for vim: ABI version 13 - OK: Loaded parser for vue: ABI version 13 - OK: Loaded parser for yaml: ABI version 13 - OK: Loaded parser for zig: ABI version 13 which_key: health#which_key#check ======================================================================== ## WhichKey: checking conflicting keymaps - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"gb"** - INFO: rhs: `(comment_toggle_blockwise)` - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"gc"** - INFO: rhs: `(comment_toggle_linewise)` - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"t"** - INFO: rhs: `lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true, hint_offset = -1 })` - WARNING: buffer-local keymap overriding global for mode **"n"**, buf: 0, lhs: **"?"** - INFO: old rhs: `lua require("packer.load")({'nvim-cheat.sh'}, { keys = "leader>?", prefix = "" }, _G.packer_plugins)` - INFO: new rhs: `Cheat`
luxus commented 2 years ago
Screenshot 2022-08-30 at 00 17 47

i can confirm a issue when open a cargo.toml

abzcoding commented 2 years ago

can you guys do these?

  1. first make sure bufferline is up to date
cd ~/.local/share/lunarvim/site/pack/packer/opt/bufferline.nvim
git checkout main
git pull
  1. then run
    :TSUpdate

    inside lvim

luxus commented 2 years ago

yes it fixed it.. bufferline was stuck on a specific commit

abzcoding commented 2 years ago

yes it fixed it.. bufferline was stuck on a specific commit

yeah I'm not sure if it's a packer issue or a lunarvim issue, but I'm using this command to keep the plugins up to date

# run the following only once to fix the issue
find ~/.local/share/lunarvim/site/pack/packer -maxdepth 2 -mindepth 2 -type d -exec git -C {} checkout main \;
find ~/.local/share/lunarvim/site/pack/packer -maxdepth 2 -mindepth 2 -type d -exec git -C {} checkout master \;

# this will keep lunarvim up to date
git -C ~/.local/share/lunarvim/lvim pull

# use this command to keep the plugins up to date
find ~/.local/share/lunarvim/site/pack/packer -maxdepth 2 -mindepth 2 -type d -exec git -C {} pull \;
crisidev commented 2 years ago

So you don't really use LvimUpdate right? Because that is going to revert stuff to a specific commit..

abzcoding commented 2 years ago

So you don't really use LvimUpdate right? Because that is going to revert stuff to a specific commit..

yep I don't use it atm, I should probably create an issue for it, or even fix it, but sadly I'm busy rn

luxus commented 2 years ago

can someone patch the ~/.local/bin/lvim script and add a lvim --update? i'm a litte busy too :D

alechp commented 2 years ago
find ~/.local/share/lunarvim/site/pack/packer -maxdepth 2 -mindepth 2 -type d -exec git -C {} pull \;

This fixed it

Screen Shot 2022-08-30 at 6 16 07 AM

The weird white highlight is still there on active buffer, but it's negligible. Just glad it works now

Adding the other update commands to aliases. Thanks Abz!

abzcoding commented 2 years ago

@alechp, the highlight issue can be fixed as well check https://github.com/abzcoding/lvim/blob/a98f8e37b0f228e43108dd3771a3187a4f1ba30a/lua/user/bufferline.lua#L6-L8

and also https://github.com/abzcoding/lvim/blob/a98f8e37b0f228e43108dd3771a3187a4f1ba30a/lua/user/bufferline.lua#L162-L163

abzcoding commented 2 years ago

Adding the other update commands to aliases. Thanks Abz!

you're welcome <3

abzcoding commented 2 years ago

Also, everybody, please be advised that using that command means breaking stuff

Since the normal lvim keeps a working commit of those plugins in this file https://github.com/LunarVim/LunarVim/blob/rolling/snapshots/default.json

So, please use with caution

alechp commented 2 years ago

@alechp, the highlight issue can be fixed as well check

https://github.com/abzcoding/lvim/blob/a98f8e37b0f228e43108dd3771a3187a4f1ba30a/lua/user/bufferline.lua#L6-L8

and also

https://github.com/abzcoding/lvim/blob/a98f8e37b0f228e43108dd3771a3187a4f1ba30a/lua/user/bufferline.lua#L162-L163

Thanks Abz. Fixed!

TLDR

Ended up being resolved by adding this to tmux config:

set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
Screen Shot 2022-08-30 at 5 20 20 PM

Extra context

alechp commented 2 years ago

Update

The bufferline bug seems to return randomly (assuming head gets updated after each packer sync or re-compile, but didn't verify that's the trigger)

Quick fix:

cd ~/.local/share/lunarvim/site/pack/packer/opt/bufferline.nvim
git checkout main && git pull
Screen Shot 2022-09-07 at 10 03 27 AM
abzcoding commented 2 years ago

Update

The bufferline bug seems to return randomly (assuming head gets updated after each packer sync or re-compile, but didn't verify that's the trigger)

yeah it seems like running a packer sync or install forces back the versions inside default.json

lunarvim itself has been updated to use the latest bufferline ( 0b4b86)

so hopefully this will not happen anymore

alechp commented 2 years ago

Looks good! Updated lunarvim on rolling and re-synced. Checked commit hashes and it seems like HEAD matching main afterall (checking out main updated head to 0b4b86 is what fixed it in previous screenshot; confirmed that both detached head and main branch set to matching commit hashes 🥳 )

Screen Shot 2022-09-07 at 12 20 36 PM

MIght be too soon to celebrate, but looks good so far. Thanks for all your help @abzcoding 🤝