Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gvim tabs not refreshing correctly?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1486

PostPosted: Mon Nov 04, 2019 4:06 pm    Post subject: gvim tabs not refreshing correctly? Reply with quote

I'm currently using app-editors/gvim-8.1.1486 with GTK 2. Recently (not sure if it was as of any specific version) I've had a really annoying issue where tabs don't always properly repaint when I switch between tabs. In other words, very often when I switch from one tab to another, I'll see lines of code from the previous tab, and end up having to do something like page-up and page-down to correct it. BEYOND annoying...and sometimes tricks me into thinking I've made a coding error.

Has anyone else seen this? Offhand I couldn't find any existing bugs to that effect.

Tom
Back to top
View user's profile Send private message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1486

PostPosted: Wed Dec 18, 2019 3:49 pm    Post subject: Reply with quote

So I guess nobody else has run into this? So far I've yet to find any existing bugs that sound anything like this. This is on 32 bit x86 using the Nouveau graphics. This just came close to causing me to make a massive mistake because I was seeing text from another tab...possibly the most annoying issue I can recall. I live in gvim.

If I open documents in several tabs and just start clicking between them it's actually not difficult to reproduce. While it's difficult to say, it appears that the issue may in part be that the text from the previous tab isn't getting fully cleared. I also noticed that more recent versions of vim seem to be a little slower at syntax highlighting. For example I have to use "set redrawtime=50000" to avoid timeouts on very large files. That might be related.

I'm hesitant to try upgrading from gvim-8.1.1486 to the unstable gvim-8.1.1846, but if anyone's using that I'd appreciate any feed back as to how stable it's been. Thanks!

Tom
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6354

PostPosted: Wed Dec 18, 2019 8:59 pm    Post subject: Reply with quote

Haven't had this problem myself (also using GTK+2), but then I'm not using Nvidia. Do you have a compositor running?
Back to top
View user's profile Send private message
proteusx
Apprentice
Apprentice


Joined: 21 Jan 2008
Posts: 275

PostPosted: Thu Dec 19, 2019 6:45 am    Post subject: Reply with quote

I am using gvim-8.1.1846[gtk2], on 64bit with amd graphics, since August without any problems.
Have you looked at your plugins?
Back to top
View user's profile Send private message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1486

PostPosted: Thu Dec 19, 2019 3:45 pm    Post subject: Reply with quote

Thanks for the replies! I'm definitely not using any compositor. The only plugin I'm using is the "matchit" plugin, but I can reproduce the issue even if I rename by ~/.vim directory...so it's not related to any of that.

I was just doing some testing and there's no question that this is triggered by the slow redraw time using syntax highlighting. I definitely can't reproduce it, for example, with non-highlighted text files. I may try that newer version.

Tom
Back to top
View user's profile Send private message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1486

PostPosted: Thu Dec 19, 2019 6:06 pm    Post subject: Reply with quote

Well...gvim-8.1.1846 seems to work OK as far as I can see but doesn't resolve this issue unfortunately. I do notice one interesting aspect of this: I have the following in by ~/.vimrc to make Ctrl-Tab jump to the previous tab that I was on before...found this suggestion somewhere and frankly have no idea exactly what it's doing:
Code:
let g:lasttab = 1
nmap <C-tab> :exe "tabn ".g:lasttab<CR>
au TabLeave * let g:lasttab = tabpagenr()
I've noticed that when I switch tabs using Ctrl-Tab it's quite a bit less likely to screw up the display then when I switch by actually clicking the tabs in the GUI. I have to think that this is some odd race condition that only occurs with slow redraw times.

Tom
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 14972

PostPosted: Fri Dec 20, 2019 2:50 am    Post subject: Reply with quote

Although it would require a rebuild to switch, and another to switch back, you might try the Athena GUI for GVim. It is very minimal. With the configuration I use, it is just an X11 window containing Vim's text areas and appropriate scrollbars. No toolbars, no menus, etc.
tld wrote:
frankly have no idea exactly what it's doing:
Code:
let g:lasttab = 1
nmap <C-tab> :exe "tabn ".g:lasttab<CR>
au TabLeave * let g:lasttab = tabpagenr()
  • Set the global Vim variable lasttab (g:lasttab) to 1, a default value for use later.
  • Add a Normal mode mapping for Control+Tab to run :exe "tabn ".g:lasttab<CR>. (When the user is in Normal mode, holds Control, and types a tab, this mapping triggers. If the user is not in Normal mode when pressing Control+Tab, or does not hold Control while pressing Tab in Normal mode, the mapping does not trigger.)
    • :exe execute the following text as an Ex command. (See :h :exe.)
    • "tabn ": literal text, the shorthand form of :tabnext with a trailing space.
    • .: concatenate without a space. (Therefore, it might be simpler to write :exe "tabn" g:lasttab.)
    • g:lasttab: substitute the value of the global Vim variable lasttab, which was set to 1 above.
    • <CR>: generate a synthetic Carriage Return, so the command executes without requiring the user to press Enter.
  • Add an autocommand that occurs when a TabLeave happens anywhere (*). The command to run when triggered is let g:lasttab = tabpagenr().
    • Call tabpagenr() to get the number of the current tab page (which in this case will stop being the current tab page right after this event finishes).
    • Update g:lasttab, so that the next use of Control+Tab goes to the tab that was current when the TabLeave happened, not to tab 1.
Back to top
View user's profile Send private message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1486

PostPosted: Fri Dec 20, 2019 5:24 pm    Post subject: Reply with quote

Thanks for the explanation of that one Hu!

I actually did compile with the Athena GUI at one point. I use the menus though very rarely (arguably I probably don't need them). In my case the Athena UI had menus but they were really unusable, as their dropdown behavior seemed to require keeping the mouse button down. That is, they disappeared on the mouse up event...really awful. I couldn't even figure out how you could even look into sub-menus given that behavior. I might revisit that.

Thanks again!
Tom
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum