-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Buggy screen refresh in gVim with a Netrw window #8820
Comments
This bug also affects gVim 8.2.3386 GTK3 on Kubuntu 21.04. |
Just a guess, but does |
It does not. With |
I ran in the same problem, did a git bisect to find the culprit The way I found out is described below, if this is not related, please let me know to open a new issue. When I use I also use this script
I use this to open/close the Explorer, with the bug above the script won't work correctly. Also using gvim in Windows 10, compiled using MSVC. |
Removing these two lines solved the problem for me: diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim
index 5ea8319cf..252d664d6 100644
--- a/runtime/autoload/netrw.vim
+++ b/runtime/autoload/netrw.vim
@@ -1680,7 +1680,6 @@ fun! s:NetrwOptionsSave(vt)
endif
let {a:vt}netrw_fokeep = &l:fo " formatoptions
let {a:vt}netrw_gdkeep = &l:gd " gdefault
- let {a:vt}netrw_gokeep = &l:go " guioptions
let {a:vt}netrw_hidkeep = &l:hidden
let {a:vt}netrw_imkeep = &l:im
let {a:vt}netrw_iskkeep = &l:isk
@@ -1832,7 +1831,6 @@ fun! s:NetrwOptionsRestore(vt)
" call Decho("(s:NetrwOptionsRestore) #4 lines=".&lines)
call s:NetrwRestoreSetting(a:vt."netrw_fokeep" ,"&l:fo")
call s:NetrwRestoreSetting(a:vt."netrw_gdkeep" ,"&l:gd")
- call s:NetrwRestoreSetting(a:vt."netrw_gokeep" ,"&l:go")
call s:NetrwRestoreSetting(a:vt."netrw_hidkeep" ,"&l:hidden")
" call Decho("(s:NetrwOptionsRestore) #5 lines=".&lines)
call s:NetrwRestoreSetting(a:vt."netrw_imkeep" ,"&l:im") These two lines were added recently, it 89a9c15. I don't know if this is the right solution though. |
Cc @cecamp |
Probably has something to do with vim/runtime/autoload/netrw.vim Line 1754 in 04626c2
and this Lines 3919 to 3920 in 04626c2
These lines were also added in 89a9c15. |
Can you throw in a |
Removing the vim/runtime/autoload/netrw.vim Line 1754 in 04626c2
Does solve the issue on my side. |
Removing these two lines solved the problem for me:
```diff
diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim
index 5ea8319cf..252d664d6 100644
--- a/runtime/autoload/netrw.vim
+++ b/runtime/autoload/netrw.vim
@@ -1680,7 +1680,6 @@ fun! s:NetrwOptionsSave(vt)
endif
let {a:vt}netrw_fokeep = &l:fo " formatoptions
let {a:vt}netrw_gdkeep = &l:gd " gdefault
- let {a:vt}netrw_gokeep = &l:go " guioptions
let {a:vt}netrw_hidkeep = &l:hidden
let {a:vt}netrw_imkeep = &l:im
let {a:vt}netrw_iskkeep = &l:isk
@@ -1832,7 +1831,6 @@ fun! s:NetrwOptionsRestore(vt)
" call Decho("(s:NetrwOptionsRestore) #4 lines=".&lines)
call s:NetrwRestoreSetting(a:vt."netrw_fokeep" ,"&l:fo")
call s:NetrwRestoreSetting(a:vt."netrw_gdkeep" ,"&l:gd")
- call s:NetrwRestoreSetting(a:vt."netrw_gokeep" ,"&l:go")
call s:NetrwRestoreSetting(a:vt."netrw_hidkeep" ,"&l:hidden")
" call Decho("(s:NetrwOptionsRestore) #5 lines=".&lines)
call s:NetrwRestoreSetting(a:vt."netrw_imkeep" ,"&l:im")
```
These two lines were added recently, it 89a9c15. I don't know if this
is the right solution though.
'guioptions' is not a local option. It's also set globally in line
1754:
call s:NetrwSetSafeSetting("&go","begmr")
Perhaps you need to delete that line too?
I wonder why it has the "b" flag for bottom scrollbar, doesn't seem
related to netrw at all.
Perhaps some 'guioption' flag is causing trouble, then that flag should
be removed, not the whole option set to a possibly completely different
value.
…--
If your company is not involved in something called "ISO 9000" you probably
have no idea what it is. If your company _is_ involved in ISO 9000 then you
definitely have no idea what it is.
(Scott Adams - The Dilbert principle)
/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
I would guess it's the clipboard handling (e.g. the |
Let me know if v172a helps. |
I've tried v172a but it does not fix this bug. I've never installed a new version of Netrw before so I'm not entirely sure I did this correctly. I downloaded the netrw.vba.gz file, opened the file in Vim and did |
How about this patch, on top of v172a? diff --git a/autoload/netrw.vim b/autoload/netrw.vim
index 81f89fc..7ce66d9 100644
--- a/autoload/netrw.vim
+++ b/autoload/netrw.vim
@@ -1751,7 +1751,7 @@ fun! s:NetrwOptionsSafe(islocal)
if &cpo =~ 'a' | call s:NetrwSetSafeSetting("&cpo",substitute(&cpo,'a','','g')) | endif
if &cpo =~ 'A' | call s:NetrwSetSafeSetting("&cpo",substitute(&cpo,'A','','g')) | endif
setl fo=nroql2
- call s:NetrwSetSafeSetting("&go","egmr")
+ if &go =~ '\ca' | call s:NetrwSetSafeSetting("&go",substitute(&go,'\ca','','g')) | endif
call s:NetrwSetSafeSetting("&l:hid",0)
call s:NetrwSetSafeSetting("&l:im",0)
setl isk+=@ isk+=* isk+=/ |
@gdupras Hello, thank you so much for your reply, the change above does solve my issue on my side. |
The fix above also removes flashing of the menu bar in gVim on GNOME too. |
I'll tentatively include this, I don't know when @cecamp will send a new version. |
I believe that netrw v172c already has this issue fixed. You may get it from my website: http://www.drchip.org/astronaut/vim/index.html |
I tried v172c in the latest vim 8.2 on Windows 10 - it has other bugs - Managed to revert to netrw v171e from https://github.com/eiginn/netrw - much thanks to @eiginn for this lifesaver! It not only eliminates the new bug but also does not exhibit the original issue of |
Yes, I also had this issue with v172c. The current version of Vim (8.2.3565) has netrw v171 with the patch I suggested above. It has none of these issues (no flickering, no narrowing, no duplicated explorer window). |
Thanks for listing the vim version with your patch - I had looked at https://github.com/vim/vim-win32-installer/releases and did not see netrw mentioned in any recent build - then found eignn's repo |
Describe the bug
In gVim, when a Netrw window is visible and the screen is refreshed, either
automatically or by doing
CTRL-L
, gVim twitches and can even change size.To Reproduce
gvim --clean
:source $VIMRUNTIME/plugin/netrwPlugin.vim
:Sexplore
CTRL-L
and note how gVim twitches. Elements of the GUI quicklydisappear and reappear.
:set guioptions=egL
CTRL-L
several times and note how the gVim window becomes narrower.Expected behavior
No twitching when the screen is refreshed. gVim window should not change size.
Screenshots
https://user-images.githubusercontent.com/57042631/131352404-440db7f7-4269-4a74-8637-7629371f0e47.mp4
Environment (please complete the following information):
Additional context
This bug does not affect Vim 8.2.3384. It also does not affect Vim run in a
terminal.
The text was updated successfully, but these errors were encountered: