weird bug with relativenumber

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

weird bug with relativenumber

Matteo Cavalleri
I'm using vim with two vertical splits and relativenumber active. I've noticed that when I switch from a split to the other, the line numbers in the inactive split sometimes changes. I've seen this happening on closed folds, i.e. the numbers of the folded lines are hidden as well. it's a bit strange to see the line numbers displayed differently when the fold is active or inactive, but it might make sense... however I see this behaviour happen sometimes also on unfolded lines, and that's obviously a bug*:

http://it.tinypic.com/view.php?pic=2hex34p&s=5
http://it.tinypic.com/view.php?pic=2cxjg3b&s=5

I've tried to replicate the problem with "vim -u NONE -U NONE", setting just nocompatible, number and relativenumber and the problem didn't show. I then tried with "vim --noplugin" and the problem still didn't show, so i suppose the bug is caused by some plugin, but i've no idea which...

what's even weirder is that if i quit vim with the error showing up, and then start it again with "vim --noplugin", I see the wrong line numbers as they were shown earlier. As soon as i move the cursor to another line, the error is gone and doesn't reappear...

I've tried once with all my plugins except vim-signify, once with all but vim-fugitive and once with all but vim-coffee-script, but the bug still appeared.

Is there some way to guess what the cause may be? trying all the possible permutations in my plugin list may be just a bit too long and boring...

*(yes that code is ugly, it's just a quick unit test for a nodejs orm :P )



VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Dec 10 2013 08:51:36)
Included patches: 1-113
Compiled by matteo.cavalleri@TDBD-cavalleri
Big version without GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +syntax
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
-balloon_eval    +float           +mouse_urxvt     -tag_any_white
-browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         +gettext         -mzscheme        +textobjects
+clientserver    -hangul_input    -netbeans_intg   +title
+clipboard       +iconv           +path_extra      -toolbar
+cmdline_compl   +insert_expand   -perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         -profile         +visualextra
+cryptv          +linebreak       +python          +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      -lua             +rightleft       +windows
+diff            +menu            -ruby            +writebackup
+digraphs        +mksession       +scrollbind      +X11
-dnd             +modify_fname    +signs           +xfontset
-ebcdic          +mouse           +smartindent     -xim
+emacs_tags      -mouseshape      -sniff           +xsmp_interact
+eval            +mouse_dec       +startuptime     +xterm_clipboard
+ex_extra        -mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    -xpm
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -fno-strength-reduce -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: gcc   -L/usr/local/lib -Wl,--as-needed -o vim    -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo   -ldl    -L/usr/lib/python2.7/config-x86_64-linux-gnu -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions      

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: weird bug with relativenumber

Marcin Szamotulski
On 07:22 Wed 11 Dec     , Matteo Cavalleri wrote:

> I'm using vim with two vertical splits and relativenumber active. I've noticed that when I switch from a split to the other, the line numbers in the inactive split sometimes changes. I've seen this happening on closed folds, i.e. the numbers of the folded lines are hidden as well. it's a bit strange to see the line numbers displayed differently when the fold is active or inactive, but it might make sense... however I see this behaviour happen sometimes also on unfolded lines, and that's obviously a bug*:
>
> http://it.tinypic.com/view.php?pic=2hex34p&s=5
> http://it.tinypic.com/view.php?pic=2cxjg3b&s=5
>
> I've tried to replicate the problem with "vim -u NONE -U NONE", setting just nocompatible, number and relativenumber and the problem didn't show. I then tried with "vim --noplugin" and the problem still didn't show, so i suppose the bug is caused by some plugin, but i've no idea which...
>
> what's even weirder is that if i quit vim with the error showing up, and then start it again with "vim --noplugin", I see the wrong line numbers as they were shown earlier. As soon as i move the cursor to another line, the error is gone and doesn't reappear...
>
> I've tried once with all my plugins except vim-signify, once with all but vim-fugitive and once with all but vim-coffee-script, but the bug still appeared.
>
> Is there some way to guess what the cause may be? trying all the possible permutations in my plugin list may be just a bit too long and boring...
>
> *(yes that code is ugly, it's just a quick unit test for a nodejs orm :P )

In this case I don't know any other solution as to try your plugins.
You can switch half of them and check if you can reproduce this bug and
then by half again - this method converges in a good pace, so it
shouldn't take too long to find the trouble some plugin.

Best regards,
Marcin

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: weird bug with relativenumber

Christian Brabandt
In reply to this post by Matteo Cavalleri
Hi Matteo!

On Mi, 11 Dez 2013, Matteo Cavalleri wrote:

> I'm using vim with two vertical splits and relativenumber active. I've noticed that when I switch from a split to the other, the line numbers in the inactive split sometimes changes. I've seen this happening on closed folds, i.e. the numbers of the folded lines are hidden as well. it's a bit strange to see the line numbers displayed differently when the fold is active or inactive, but it might make sense... however I see this behaviour happen sometimes also on unfolded lines, and that's obviously a bug*:
>
> http://it.tinypic.com/view.php?pic=2hex34p&s=5
> http://it.tinypic.com/view.php?pic=2cxjg3b&s=5
>
> I've tried to replicate the problem with "vim -u NONE -U NONE", setting just nocompatible, number and relativenumber and the problem didn't show. I then tried with "vim --noplugin" and the problem still didn't show, so i suppose the bug is caused by some plugin, but i've no idea which...
>
> what's even weirder is that if i quit vim with the error showing up, and then start it again with "vim --noplugin", I see the wrong line numbers as they were shown earlier. As soon as i move the cursor to another line, the error is gone and doesn't reappear...
>
> I've tried once with all my plugins except vim-signify, once with all but vim-fugitive and once with all but vim-coffee-script, but the bug still appeared.
>
> Is there some way to guess what the cause may be? trying all the possible permutations in my plugin list may be just a bit too long and boring...
>
> *(yes that code is ugly, it's just a quick unit test for a nodejs orm :P )

Any reliable way to reproduce it? Perhaps with a session file?
Does :redraw! fix it?

Best,
Christian
--
Die Ehe ist eine mehr oder weniger erfolgreich durchführbare
Absurdität.
                -- Ephraim Kishon (alias Ferenc Hoffmann)

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: weird bug with relativenumber

Matteo Cavalleri
In reply to this post by Matteo Cavalleri
hi, thanks for the answers!

given the fact that, however annoying, this bug is basically cosmetical, i haven't devoted too much time trying to investigate it. that's why after some tentatives to debug it i posted here, usually you guys know the right command to find what happens ;)

i'll try the redraw and I'll try to find some snippet of code where the bug happens always. btw I've just discovered that the piece of code i showed you was able to make the bug always happen on my linux machine at work, but it doesn't happen on my macbook... i wonder if screen size or maybe terminal emulator makes the difference somehow.

i'll update you when i have some news, thanks!

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: weird bug with relativenumber

Lech Lorens
On Wednesday, December 11, 2013 9:49:53 PM UTC+1, Matteo Cavalleri wrote:
> hi, thanks for the answers!
>
> given the fact that, however annoying, this bug is basically cosmetical, i haven't devoted too much time trying to investigate it. that's why after some tentatives to debug it i posted here, usually you guys know the right command to find what happens ;)
>
> i'll try the redraw and I'll try to find some snippet of code where the bug happens always. btw I've just discovered that the piece of code i showed you was able to make the bug always happen on my linux machine at work, but it doesn't happen on my macbook... i wonder if screen size or maybe terminal emulator makes the difference somehow.
>
> i'll update you when i have some news, thanks!

Try the attached patch. Works for me when I compare 2 files with 'rnu' set in each buffer.

Cheers,
LL

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.

nu-rnu-wrong-numbers.patch (699 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: weird bug with relativenumber

Matteo Cavalleri
>
> Try the attached patch. Works for me when I compare 2 files with 'rnu' set in each buffer.

Hi! Thank you very much :) unfortunately it didn't solve my problem...

http://it.tinypic.com/view.php?pic=wbrzn4&s=5

the left half of the picture shows the split when it's active, while the right half shows the same split when i move the cursor on another split.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: weird bug with relativenumber

Matteo Cavalleri
I applied the patch on my linux box and it works! so looks like i did something wrong on my mac, or maybe there's some difference in configure options... I'll try to do some other tests when I'll be back home.

Thanks for the patch!

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.