pwntester / octo.nvim

Edit and review GitHub issues and pull requests from the comfort of your favorite editor
MIT License
2.43k stars 139 forks source link

Error hiding comment reaction popup with neovim 0.8 #326

Closed madlep closed 2 years ago

madlep commented 2 years ago

Issue Description

Cursor moved out of popup showing reactions results in error on neovim nightly

Describe what happened (or what feature you want)

Describe what you expected to happen

How to reproduce it (as minimally and precisely as possible)

  1. Running neovim 0.8.0 nightly build after 2022-07-10
  2. open a PR with comments that have a reaction on them
  3. cursor over the reaction, reaction pop up opens OK
  4. cursor out of reaction, error occurs and pop up not removed

Tell us your environment

> nvim --version
NVIM v0.8.0-dev
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by juliandoherty@madlep.local

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

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

Run :checkhealth for more info
click to expand :checkhealth output ``` null-ls: require("null-ls.health").check() ======================================================================== - OK: shellcheck: the command "shellcheck" is executable. - OK: codespell: the command "codespell" is executable. - OK: credo: the command "mix" is executable. - ERROR: gitlint: the command "gitlint" is not executable. - OK: jsonlint: the command "jsonlint" is executable. - OK: proselint: the command "proselint" is executable. - OK: shellcheck: the command "shellcheck" is executable. - OK: yamllint: the command "yamllint" is executable. - OK: zsh: the command "zsh" is executable. - OK: jq: the command "jq" is executable. - OK: prettier: the command "prettier" is executable. nvim: health#nvim#check ======================================================================== ## Configuration - OK: no issues found ## 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: 0 - INFO: Checking stuff - OK: focus-events: on - INFO: $TERM: screen-256color nvim-lsp-installer: require("nvim-lsp-installer.health").check() ======================================================================== ## nvim-lsp-installer report - OK: neovim version >= 0.7.0 - WARNING: **Go**: not available - OK: **cargo**: `cargo 1.61.0 (a028ae42f 2022-04-29)` - OK: **luarocks**: `/opt/homebrew/bin/luarocks 3.9.1` - OK: **Ruby**: `ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [arm64-darwin21]` - OK: **RubyGem**: `3.2.22` - WARNING: **Composer**: not available - WARNING: **PHP**: not available - OK: **npm**: `7.19.1` - OK: **node**: `v16.5.0` - OK: **python3**: `Python 3.10.1` - OK: **pip3**: `pip 21.2.4 from /Users/juliandoherty/.asdf/installs/python/3.10.1/lib/python3.10/site-packages/pip (python 3.10)` - WARNING: **javac**: not available - WARNING: **java**: not available - 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 (arm64-apple-darwin21)` - OK: **sh**: `Ok` - OK: GitHub API rate limit. Used: 17. Remaining: 4983. Limit: 5000. Reset: Tue 13 Sep 11:09:48 2022. nvim-treesitter: require("nvim-treesitter.health").check() ======================================================================== ## Installation - OK: `tree-sitter` found 0.20.6 (parser generator, only needed for :TSInstallFromGrammar) - OK: `node` found v16.5.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 - query ✓ ✓ ✓ ✓ ✓ - dart ✓ ✓ . ✓ ✓ - rst ✓ ✓ . . ✓ - fennel ✓ ✓ . . ✓ - ql ✓ ✓ . ✓ ✓ - pascal ✓ ✓ ✓ ✓ ✓ - python ✓ ✓ ✓ ✓ ✓ - jsdoc ✓ . . . . - json ✓ ✓ ✓ ✓ . - vim ✓ ✓ ✓ . ✓ - sparql ✓ ✓ ✓ ✓ ✓ - sql ✓ . . . ✓ - gdscript ✓ ✓ . ✓ ✓ - godot_resource ✓ ✓ ✓ . . - fusion ✓ ✓ ✓ ✓ . - ledger ✓ . ✓ ✓ ✓ - turtle ✓ ✓ ✓ ✓ ✓ - devicetree ✓ ✓ ✓ ✓ ✓ - svelte ✓ . ✓ ✓ ✓ - gomod ✓ . . . ✓ - help ✓ . . . . - gowork ✓ . . . ✓ - markdown ✓ . ✓ . ✓ - graphql ✓ . . ✓ ✓ - ruby ✓ ✓ ✓ ✓ ✓ - bibtex ✓ . ✓ ✓ . - zig ✓ . ✓ ✓ ✓ - fish ✓ ✓ ✓ ✓ ✓ - fortran ✓ . ✓ ✓ . - php ✓ ✓ ✓ ✓ ✓ - cmake ✓ . ✓ . . - java ✓ ✓ . ✓ ✓ - json5 ✓ . . . ✓ - pioasm ✓ . . . ✓ - julia ✓ ✓ ✓ ✓ ✓ - hjson ✓ ✓ ✓ ✓ ✓ - hocon ✓ . . . ✓ - cpp ✓ ✓ ✓ ✓ ✓ - css ✓ . ✓ ✓ ✓ - llvm ✓ . . . . - http ✓ . . . ✓ - bash ✓ ✓ ✓ . ✓ - prisma ✓ . . . . - html ✓ ✓ ✓ ✓ ✓ - make ✓ . ✓ . ✓ - tsx ✓ ✓ ✓ ✓ ✓ - rasi ✓ ✓ ✓ ✓ . - hcl ✓ . ✓ ✓ ✓ - gleam ✓ ✓ ✓ ✓ ✓ - glimmer ✓ . . . . - surface ✓ . ✓ ✓ ✓ - verilog ✓ ✓ ✓ . ✓ - eex ✓ . . . ✓ - heex ✓ ✓ ✓ ✓ ✓ - foam ✓ ✓ ✓ ✓ ✓ - ocaml ✓ ✓ ✓ . ✓ - c_sharp ✓ ✓ ✓ . ✓ - ocaml_interface✓ ✓ ✓ . ✓ - v ✓ ✓ ✓ ✓ ✓ - lalrpop ✓ ✓ . . . - menhir ✓ . . . ✓ - agda ✓ . ✓ . . - solidity ✓ . . . . - org . . . . . - swift ✓ ✓ . . . - r ✓ ✓ . ✓ ✓ - elvish ✓ . . . ✓ - todotxt ✓ . . . . - qmljs ✓ . ✓ . . - astro ✓ ✓ ✓ ✓ ✓ - typescript ✓ ✓ ✓ ✓ ✓ - wgsl ✓ . ✓ . . - scala ✓ . ✓ . ✓ - m68k ✓ ✓ ✓ . ✓ - supercollider ✓ ✓ ✓ ✓ ✓ - slint ✓ . . ✓ . - d ✓ . ✓ ✓ ✓ - haskell ✓ . ✓ . ✓ - embedded_template✓ . . . ✓ - tiger ✓ ✓ ✓ ✓ ✓ - clojure ✓ ✓ ✓ . ✓ - sxhkdrc ✓ . ✓ . ✓ - commonlisp ✓ ✓ ✓ . . - gitignore ✓ . . . . - markdown_inline✓ . . . ✓ - gitattributes ✓ . . . ✓ - cuda ✓ ✓ ✓ ✓ ✓ - tlaplus ✓ ✓ ✓ . ✓ - blueprint ✓ . . . . - glsl ✓ ✓ ✓ ✓ ✓ - toml ✓ ✓ ✓ ✓ ✓ - hlsl ✓ ✓ ✓ ✓ ✓ - dockerfile ✓ . . . ✓ - dot ✓ . . . ✓ - comment ✓ . . . . - vue ✓ . ✓ ✓ ✓ - jsonc ✓ ✓ ✓ ✓ ✓ - elm ✓ . . . ✓ - go ✓ ✓ ✓ ✓ ✓ - yaml ✓ ✓ ✓ ✓ ✓ - yang ✓ . ✓ ✓ . - ninja ✓ . ✓ ✓ . - nix ✓ ✓ ✓ . ✓ - regex ✓ . . . . - elixir ✓ ✓ ✓ ✓ ✓ - erlang ✓ . ✓ . . - c ✓ ✓ ✓ ✓ ✓ - scss ✓ . . ✓ . - javascript ✓ ✓ ✓ ✓ ✓ - jsonnet ✓ . . . . - lua ✓ ✓ ✓ ✓ ✓ - pug ✓ . . . ✓ - kotlin ✓ ✓ ✓ . ✓ - teal ✓ ✓ ✓ ✓ ✓ - perl ✓ . ✓ . . - beancount ✓ . ✓ . . - rnoweb ✓ . ✓ . ✓ - latex ✓ . ✓ . ✓ - rust ✓ ✓ ✓ ✓ ✓ - rego ✓ . . . ✓ - hack ✓ . . . . - scheme ✓ . ✓ . ✓ - norg . . . . . - racket ✓ . ✓ . ✓ - vala ✓ . ✓ . . - meson ✓ . ✓ . ✓ - cooklang ✓ . . . . - ocamllex ✓ . . . ✓ - proto ✓ . ✓ . . 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) - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics. - WARNING: Could not load Python 3: /Users/juliandoherty/.asdf/shims/python3 does not have the "neovim" module. /Users/juliandoherty/.asdf/shims/python3.10 does not have the "neovim" module. /opt/homebrew/bin/python3.9 does not have the "neovim" module. python3.8 not found in search path or not executable. python3.7 not found in search path or not executable. /Users/juliandoherty/.asdf/shims/python does not have the "neovim" module. - ADVICE: - See :help |provider-python| for more information. - You may disable this provider (and warning) by adding `let g:loaded_python3_provider = 0` to your init.vim - INFO: Executable: Not found ## Python virtualenv - OK: no $VIRTUAL_ENV ## Ruby provider (optional) - INFO: Ruby: ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [arm64-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: v16.5.0 - WARNING: Missing "neovim" npm (or yarn, pnpm) package. - ADVICE: - Run in shell: npm install -g neovim - Run in shell (if you use yarn): yarn global add neovim - Run in shell (if you use pnpm): pnpm install -g neovim - You may disable this provider (and warning) by adding `let g:loaded_node_provider = 0` to your init.vim ## 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: `fzf` - INFO: No healthcheck provided vim.lsp: require("vim.lsp.health").check() ======================================================================== - INFO: LSP log level : WARN - INFO: Log path: /Users/juliandoherty/.local/state/nvim/lsp.log - INFO: Log size: 99 KB vim.treesitter: require("vim.treesitter.health").check() ======================================================================== - INFO: Runtime ABI version : 14 - OK: Loaded parser for agda: ABI version 13 - OK: Loaded parser for astro: ABI version 13 - OK: Loaded parser for bash: ABI version 13 - OK: Loaded parser for beancount: ABI version 13 - OK: Loaded parser for bibtex: ABI version 13 - OK: Loaded parser for blueprint: ABI version 14 - OK: Loaded parser for c: ABI version 13 - OK: Loaded parser for clojure: ABI version 13 - OK: Loaded parser for cmake: ABI version 13 - OK: Loaded parser for comment: ABI version 13 - OK: Loaded parser for commonlisp: ABI version 13 - OK: Loaded parser for cooklang: ABI version 13 - OK: Loaded parser for cpp: ABI version 13 - OK: Loaded parser for css: ABI version 13 - OK: Loaded parser for cuda: ABI version 14 - 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 devicetree: ABI version 14 - OK: Loaded parser for dockerfile: ABI version 13 - OK: Loaded parser for dot: ABI version 13 - OK: Loaded parser for eex: ABI version 13 - OK: Loaded parser for elixir: ABI version 13 - OK: Loaded parser for elm: ABI version 13 - OK: Loaded parser for elvish: ABI version 13 - OK: Loaded parser for embedded_template: 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 foam: ABI version 13 - OK: Loaded parser for fortran: ABI version 13 - OK: Loaded parser for fusion: ABI version 13 - OK: Loaded parser for gdscript: ABI version 13 - OK: Loaded parser for gitattributes: ABI version 14 - OK: Loaded parser for gitignore: ABI version 14 - OK: Loaded parser for gleam: ABI version 13 - OK: Loaded parser for glimmer: ABI version 13 - OK: Loaded parser for glsl: ABI version 14 - OK: Loaded parser for go: ABI version 13 - OK: Loaded parser for godot_resource: ABI version 14 - OK: Loaded parser for gomod: ABI version 13 - OK: Loaded parser for gowork: ABI version 13 - OK: Loaded parser for graphql: ABI version 13 - OK: Loaded parser for hack: ABI version 13 - OK: Loaded parser for haskell: ABI version 13 - OK: Loaded parser for hcl: ABI version 13 - OK: Loaded parser for heex: ABI version 13 - OK: Loaded parser for help: ABI version 13 - OK: Loaded parser for hjson: ABI version 13 - OK: Loaded parser for hlsl: ABI version 14 - OK: Loaded parser for hocon: ABI version 13 - OK: Loaded parser for html: ABI version 13 - OK: Loaded parser for http: 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 json5: ABI version 13 - OK: Loaded parser for jsonc: ABI version 13 - OK: Loaded parser for jsonnet: ABI version 13 - OK: Loaded parser for julia: ABI version 13 - OK: Loaded parser for kotlin: ABI version 13 - OK: Loaded parser for lalrpop: ABI version 13 - OK: Loaded parser for latex: ABI version 13 - OK: Loaded parser for ledger: ABI version 13 - OK: Loaded parser for llvm: ABI version 13 - OK: Loaded parser for lua: ABI version 13 - OK: Loaded parser for m68k: ABI version 13 - OK: Loaded parser for make: ABI version 13 - OK: Loaded parser for markdown: ABI version 13 - OK: Loaded parser for markdown_inline: ABI version 13 - OK: Loaded parser for menhir: ABI version 13 - OK: Loaded parser for meson: ABI version 13 - OK: Loaded parser for ninja: ABI version 13 - OK: Loaded parser for nix: ABI version 13 - OK: Loaded parser for norg: ABI version 13 - OK: Loaded parser for ocaml: ABI version 13 - OK: Loaded parser for ocamllex: ABI version 14 - OK: Loaded parser for ocaml_interface: ABI version 13 - OK: Loaded parser for org: ABI version 13 - OK: Loaded parser for pascal: ABI version 13 - OK: Loaded parser for perl: ABI version 13 - OK: Loaded parser for php: ABI version 13 - OK: Loaded parser for pioasm: ABI version 13 - OK: Loaded parser for prisma: ABI version 13 - OK: Loaded parser for proto: ABI version 13 - OK: Loaded parser for pug: ABI version 13 - OK: Loaded parser for python: ABI version 13 - OK: Loaded parser for ql: ABI version 13 - OK: Loaded parser for qmljs: ABI version 13 - OK: Loaded parser for query: ABI version 13 - OK: Loaded parser for r: ABI version 13 - OK: Loaded parser for racket: ABI version 13 - OK: Loaded parser for rasi: ABI version 13 - OK: Loaded parser for regex: ABI version 13 - OK: Loaded parser for rego: ABI version 13 - OK: Loaded parser for rnoweb: ABI version 13 - OK: Loaded parser for rst: 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 scheme: ABI version 13 - OK: Loaded parser for scss: ABI version 13 - OK: Loaded parser for slint: ABI version 13 - OK: Loaded parser for solidity: ABI version 13 - OK: Loaded parser for sparql: ABI version 13 - OK: Loaded parser for sql: ABI version 13 - OK: Loaded parser for supercollider: ABI version 13 - OK: Loaded parser for surface: ABI version 13 - OK: Loaded parser for svelte: ABI version 13 - OK: Loaded parser for swift: ABI version 14 - OK: Loaded parser for sxhkdrc: ABI version 13 - OK: Loaded parser for teal: ABI version 14 - OK: Loaded parser for tiger: ABI version 13 - OK: Loaded parser for tlaplus: ABI version 13 - OK: Loaded parser for todotxt: ABI version 13 - OK: Loaded parser for toml: ABI version 13 - OK: Loaded parser for tsx: ABI version 13 - OK: Loaded parser for turtle: ABI version 13 - OK: Loaded parser for typescript: ABI version 13 - OK: Loaded parser for v: ABI version 13 - OK: Loaded parser for vala: ABI version 13 - OK: Loaded parser for verilog: ABI version 13 - OK: Loaded parser for vim: ABI version 14 - OK: Loaded parser for vue: ABI version 13 - OK: Loaded parser for wgsl: ABI version 13 - OK: Loaded parser for yaml: ABI version 13 - OK: Loaded parser for yang: ABI version 13 - OK: Loaded parser for zig: ABI version 13 - OK: Loaded parser for c: ABI version 13 - OK: Loaded parser for lua: ABI version 13 - OK: Loaded parser for vim: ABI version 14 which_key: health#which_key#check ======================================================================== ## WhichKey: checking conflicting keymaps - WARNING: buffer-local keymap overriding global for mode **"n"**, buf: 0, lhs: **""** - INFO: old rhs: `` - INFO: new rhs: `lua require("which-key").show(" ", {mode = "n", auto = true})` - WARNING: buffer-local keymap overriding global for mode **"x"**, buf: 0, lhs: **""** - INFO: old rhs: `` - INFO: new rhs: `lua require("which-key").show(" ", {mode = "v", auto = true})` ```

Anything else we need to know?

Looks like the source of this error when running Octo in neovim 0.8 is from this fix https://github.com/pwntester/octo.nvim/commit/012fa055317df36e6389dfd159a26ad3d6d0a7c7 , which copy+pasted code from neovim runtime/lua/vim/lsp/util.lua, including use of private function _close_preview_window (which all works fine in neovim 0.7)

However that code has been refactored in neovim 0.8, and _close_preview_window has been removed in https://github.com/neovim/neovim/pull/19283 - so nightly builds after it was merged on 2022-07-10 will have this issue (and neovim 0.8 final, when it is released)

pwntester commented 2 years ago

Thanks for the detailed report. I have fixed it in #327, can you please test and verify it works for you?

madlep commented 2 years ago

Thanks for the detailed report. I have fixed it in #327, can you please test and verify it works for you?

@pwntester works great in current nightly. Thanks for quick fix 🙂

https://user-images.githubusercontent.com/27223/190031812-bce5d3af-e6e3-414e-9234-0b56f6bb3c5c.mov