Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use mouse scroll with neovim nightly #691

Closed
zhmars opened this issue May 11, 2020 · 17 comments
Closed

Unable to use mouse scroll with neovim nightly #691

zhmars opened this issue May 11, 2020 · 17 comments

Comments

@zhmars
Copy link

zhmars commented May 11, 2020

When running with neovim nightly, mouse scroll not works.

Reproduce

  • Run nvim-qt --nvim path/to/nvim.appimage path/to/neovim-qt/README.md

Environment

  • neovim-qt version: master(v0.2.16.9999)
  • nvim --version
NVIM v0.5.0-499-g1407899c3
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-5 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -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/home/travis/build/neovim/bot-ci/build/neovim/build/config -I/home/travis/build/neovim/bot-ci/build/neovim/src -I/home/travis/build/neovim/bot-ci/build/neovim/.deps/usr/include -I/usr/include -I/home/travis/build/neovim/bot-ci/build/neovim/build/src/nvim/auto -I/home/travis/build/neovim/bot-ci/build/neovim/build/include
Compiled by travis@travis-job-972e54f4-eecf-497b-a5fe-df9ad4e11565

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

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "
/home/travis/build/neovim/bot-ci/build/neovim/build/nvim.AppDir/usr/share/nvim
"

Run :checkhealth for more info
@jgehrig
Copy link
Collaborator

jgehrig commented May 11, 2020

I cannot reproduce the issue..

Could you elaborate on your configuration/installation?

Does the issue reproduce with nvim-qt -- -u NONE?

What is the output of nvim-qt --version?

@zhmars
Copy link
Author

zhmars commented May 11, 2020

Hi, thanks for reply.

Could you elaborate on your configuration/installation?

As I mentioned above, I using the master version, built by neovim-qt-git from aur. I also tried the latest stable release from arch communtiy repo. Both of them have same issue, no configuration is needed.

NOTE. This issue only occured with neovim nightly version.

Does the issue reproduce with nvim-qt -- -u NONE?

No. But reproduce with nvim-qt --nvim path/to/nvim.appimage -- -u NONE

What is the output of nvim-qt --version?

qt5ct: using qt5ct plugin
NVIM-QT v0.2.16.9999
Build type: Release
Compilation:-D_FORTIFY_SOURCE=2 -march=haswell -mtune=haswell -O3 -fno-plt -falign-functions=32 -fno-semantic-interposition -fgraphite-identity -floop-nest-optimize -ftree-loop-distribution -ftree-vectorize -pipe -Wall -Wextra -Wno-unused-parameter -std=c++11 -Wfatal-errors
Qt Version: 5.14.2
Environment:
  nvim: nvim
  args: --cmd set termguicolors
  runtime:

NVIM v0.4.3
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/lib/ccache/bin/cc -march=haswell -mtune=haswell -O3 -fno-plt -falign-functions=32 -fno-semantic-interposition -fgraphite-identity -floop-nest-optimize -ftree-loop-distribution -ftree-vectorize -pipe -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/home/mars/work/pkg/optimize/vim/neovim/src/build/config -I/home/mars/work/pkg/optimize/vim/neovim/src/neovim-0.4.3/src -I/usr/include -I/home/mars/work/pkg/optimize/vim/neovim/src/build/src/nvim/auto -I/home/mars/work/pkg/optimize/vim/neovim/src/build/include
Compiled by mars@DESKTOP-LINUX

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

@jgehrig
Copy link
Collaborator

jgehrig commented May 11, 2020

No problem, thanks for the bug report! :)

If you reproduced with the latest stable release of neovim-qt 0.2.15, then we've probably got a neovim bug.

NOTE. This issue only occured with neovim nightly version.

I'm not running Arch, so I can't test your exact scenario. However, I did build master versions of neovim and neovim-qt this morning. The issue didn't reproduce for me.

I think this is a small (already fixed?) bug in the neovim nightly.

Can you try again tomorrow once AUR pulls in the next Neovim nightly package?

@zhmars
Copy link
Author

zhmars commented May 11, 2020

It seems weird. This issue occured for months before I reported it here.

Can you try again tomorrow once AUR pulls in the next Neovim nightly package?

I will try it. Thanks.

@jgehrig
Copy link
Collaborator

jgehrig commented May 11, 2020

It seems weird. This issue occured for months before I reported it here.

Sorry, I'm not sure I have all of the details then... The more you can explain, the better I can debug the issue.

For how long have you seen this issue? When did it start?

Is this intermittent, or has it occurred constantly for months?

Can you try again tomorrow once AUR pulls in the next Neovim nightly package?

I will try it. Thanks.

Still worth trying...

If this is still an issue tomorrow, or occurs when you build from master now, we may have an issue with something specific to your configuration.

@zhmars
Copy link
Author

zhmars commented May 11, 2020

First, sorry for my bad english.

For how long have you seen this issue? When did it start?

I dont know the exact time. It occured at least three months.

Is this intermittent, or has it occurred constantly for months?

I am not sure. It never worked every time when I ran neovim-qt with neovim nightly.

If this is still an issue tomorrow, or occurs when you build from master now, we may have an issue with something specific to your configuration.

I just built from master a few minutes ago and also removed all files in ~/.config/nvim and ~/.config/nvim-qt/. The issue still occured.

Thank you for your time. @jgehrig

@jgehrig
Copy link
Collaborator

jgehrig commented May 12, 2020

First, sorry for my bad english.

No need to apologize, your English is great! :)

Do you have set mouse=a set?

Based on what you've described, I doubt the next nightly will solve anything...

If set mouse doesn't work, the next step is to start debugging the issue on your machine.

@zhmars
Copy link
Author

zhmars commented May 12, 2020

I bisected and found ddfde10 is the first bad commit. Could you check it?

Do you have set mouse=a set?

No.

EDITED: It works without any problem after set mouse=a. Thank you!

@jgehrig
Copy link
Collaborator

jgehrig commented May 12, 2020

Do you have set mouse=a set?

No.

This is the problem :)

The commit you reference adds support for the set mouse option.

See :h mouse for more details. You probably want set mouse=a.

@zhmars
Copy link
Author

zhmars commented May 12, 2020

Do you have set mouse=a set?

No.

This is the problem :)

The commit you reference adds support for the set mouse option.

See :h mouse for more details. You probably want set mouse=a.

Thanks. I just updated the comment. No issue occured after set mouse=a.

Thanks, again.

@zhmars
Copy link
Author

zhmars commented May 12, 2020

Another question, should we consider set mouse=a as default like gVim does?

@jgehrig
Copy link
Collaborator

jgehrig commented May 12, 2020

I think this was a "by design" decision upstream in neovim.

For neovim-qt, we don't have a good mechanism to set the value. The best option is src/gui/runtime/plugin/nvim_gui_shim.vim, but this would also change the setting for users who modified the value in init.vim.

Here are the mouse settings I use in ginit.vim:

" Show right-click context menu
nnoremap <silent><RightMouse> :call GuiShowContextMenu()<CR>
inoremap <silent><RightMouse> <Esc>:call GuiShowContextMenu()<CR>
vnoremap <silent><RightMouse> :call GuiShowContextMenu()<CR>gv

" Enable mouse for all modes
set mouse=a

@zhmars
Copy link
Author

zhmars commented May 12, 2020

Thanks for explanation and the settings.

I mean enable this in neovim-qt, not neovim. Similar termguicolors option, which is default off in neovim, but has been enabled by default for local spawned processes from this pull request. For changing user setting, I have no idea why set termguicolors is allowed.

It is ok for me as I have enabled this in my configuration. But I also suggest to add this in the README for newbie users like me at least. There maybe more mouse related issue comming here after neovim 0.5.0 release.

" Use mouse to select in Visual Mode
set mouse=a

By the way, is there a typo in your ginit.vim? This setting should enable the use of mouse for all modes as I know.

@jgehrig
Copy link
Collaborator

jgehrig commented May 12, 2020

Good point, I updated set mouse=a comment above.

We don't have enough control to properly enable this setting from neovim-qt. The option termguicolors is a different classification of options, see :h ui-option.

Consider the following:

  1. I am a user that does not want any mouse support in neovim-qt.
  2. I explicitly set set mouse= in my init.vim to disable this feature. This works today.
  3. We make mouse=a the default option in neovim-qt via nvim_gui_shim.vim
  4. The startup sequence is: init.vim -> nvim_gui_shim.vim -> ginit.vim
  5. We just broke a user's existing configuration, mouse= was ignored.

There was some discussion of making mouse=a the default for neovim, where they have the ability to detect the explicitly set vs un-set case.

@jgehrig
Copy link
Collaborator

jgehrig commented May 12, 2020

I'm not opposed to making set mouse=a the default... I just don't know of a safe way to do it.

It is ok for me as I have enabled this in my configuration. But I also suggest to add this in the README for newbie users like me at least. There maybe more mouse related issue comming here after neovim 0.5.0 release.

Sure, that's a good idea. We can add an entry to the README and Wiki.

@zhmars
Copy link
Author

zhmars commented May 13, 2020

Thank you very much for your detailed explanation!

@equalsraf
Copy link
Owner

Closing. This is now covered in the FAQ (https://github.com/equalsraf/neovim-qt/wiki#why-doesnt-the-mouse-work). thanks @jgehrig.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants