Loading ...
Sorry, an error occurred while loading the content.

noscrollbind ignored (kind of)

Expand Messages
  • AndyHancock
    When I diff two files with scroll binding, then set nodiff and noscrollbind on each window, the files still seem to track each other. However, they are not
    Message 1 of 7 , Feb 17 4:09 PM
    • 0 Attachment
      When I diff two files with scroll binding, then set nodiff and noscrollbind on each window, the files still seem to track each other. However, they are not completely in sync. One seems to be a screen or two behind the other. The only way to get rid of this quasi-scroll-binding is to close both windows, then re-open them. This can be very disruptive when juggling lots of files.

      Has anyone else found this? My version information is as follows:

      VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 27 2010 17:59:02)
      MS-Windows 32-bit GUI version with OLE support
      Included patches: 1-46
      Compiled by Bram@KIBAALE
      Big version with GUI. Features included (+) or not (-):
      +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +conceal +cryptv +cscope
      +cursorbind +cursorshape +dialog_con_gui +diff +digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +float +folding -footer +gettext/dyn
      -hangul_input +iconv/dyn +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap -lua +menu +mksession +modify_fname +mouse +mouseshape
      +multi_byte_ime/dyn +multi_lang -mzscheme +netbeans_intg +ole -osfiletype +path_extra +perl/dyn +persistent_undo -postscript +printer -profile +python/dyn +python3/dyn +quickfix +reltime
      +rightleft +ruby/dyn +scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white +tcl/dyn -tgetent -termresponse
      +textobjects +title +toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup -xfontset -xim -xterm_save +xpm_w32
      system vimrc file: "$VIM\vimrc"
      user vimrc file: "$HOME\_vimrc"
      2nd user vimrc file: "$VIM\_vimrc"
      user exrc file: "$HOME\_exrc"
      2nd user exrc file: "$VIM\_exrc"
      system gvimrc file: "$VIM\gvimrc"
      user gvimrc file: "$HOME\_gvimrc"
      2nd user gvimrc file: "$VIM\_gvimrc"
      system menu file: "$VIMRUNTIME\menu.vim"
      Compilation: cl -c /W3 /nologo -I. -Iproto -DHAVE_PATHDEF -DWIN32 -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG -DFEAT_XPM_W32 -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 /Fo.\ObjGOLYHTR/ /Ox /GL -DNDEBUG /Zl /MT -DFEAT_OLE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DFEAT_GUI_W32 -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl83.dll\" -DDYNAMIC_TCL_VER=\"8.3\" -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python31.dll\" -DFEAT_PERL -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl512.dll\" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=191 -DDYNAMIC_RUBY_DLL=\"msvcrt-ruby191.dll\" -DFEAT_BIG /Fd.\ObjGOLYHTR/ /Zi
      Linking: link /RELEASE /nologo /subsystem:windows /LTCG:STATUS oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib /machine:i386 /nodefaultlib gdi32.lib version.lib winspool.lib comctl32.lib advapi32.lib shell32.lib /machine:i386 /nodefaultlib libcmt.lib oleaut32.lib user32.lib /nodefaultlib:python27.lib /nodefaultlib:python31.lib e:\tcl\lib\tclstub83.lib WSock32.lib e:\xpm\lib\libXpm.lib /PDB:gvim.pdb -debug

      --
      --
      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 vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Ben Fritz
      ... Maybe cursorbind is still set. Instead of manually setting nodiff and noscrollbind , try the :diffoff command, or :diffoff! for all windows in the tab
      Message 2 of 7 , Feb 18 6:43 AM
      • 0 Attachment
        On Sunday, February 17, 2013 6:09:54 PM UTC-6, AndyHancock wrote:
        > When I diff two files with scroll binding, then set nodiff and noscrollbind on each window, the files still seem to track each other. However, they are not completely in sync. One seems to be a screen or two behind the other. The only way to get rid of this quasi-scroll-binding is to close both windows, then re-open them. This can be very disruptive when juggling lots of files.
        >

        Maybe 'cursorbind' is still set.

        Instead of manually setting 'nodiff' and 'noscrollbind', try the :diffoff command, or :diffoff! for all windows in the tab page.

        --
        --
        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 vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • AndyHancock
        ... Wow. This is awesome. I ve never heard of diffoff and cursorbind before, but cursorbind does seem to cause similar behaviour and diffoff gets rid of it.
        Message 3 of 7 , Feb 18 11:22 PM
        • 0 Attachment
          On Monday, February 18, 2013 9:43:43 AM UTC-5, Ben Fritz wrote:
          > On Sunday, February 17, 2013 6:09:54 PM UTC-6, AndyHancock wrote:
          > > When I diff two files with scroll binding, then set nodiff and noscrollbind on each window, the files still seem to track each other. However, they are not completely in sync. One seems to be a screen or two behind the other. The only way to get rid of this quasi-scroll-binding is to close both windows, then re-open them. This can be very disruptive when juggling lots of files.
          > >
          >
          > Maybe 'cursorbind' is still set.
          >
          > Instead of manually setting 'nodiff' and 'noscrollbind', try the :diffoff command, or :diffoff! for all windows in the tab page.

          Wow. This is awesome. I've never heard of diffoff and cursorbind before, but cursorbind does seem to cause similar behaviour and diffoff gets rid of it. 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 vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Christian Brabandt
          Hi AndyHancock! ... Can you give us a reproducible example starting with vim -u NONE -N Mit freundlichen Grüßen Christian -- Die Tugend, sogar eines gemeinen
          Message 4 of 7 , Feb 19 1:37 AM
          • 0 Attachment
            Hi AndyHancock!

            On So, 17 Feb 2013, AndyHancock wrote:

            > When I diff two files with scroll binding, then set nodiff and noscrollbind on each window, the files still seem to track each other. However, they are not completely in sync. One seems to be a screen or two behind the other. The only way to get rid of this quasi-scroll-binding is to close both windows, then re-open them. This can be very disruptive when juggling lots of files.
            >
            > Has anyone else found this? My version information is as follows:

            Can you give us a reproducible example starting with vim -u NONE -N


            Mit freundlichen Grüßen
            Christian
            --
            Die Tugend, sogar eines gemeinen Mädchens, ist verschieden, ob man
            sich für verheiratet oder unverheiratet ausgibt.
            -- Jean Paul

            --
            --
            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 vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • AndyHancock
            Hi, Christian, The diffoff command seems to solve the problem. As for reproducing the problem, I ran C: Program Files (x86) Vim vim73 gvim.exe -u NONE -N
            Message 5 of 7 , Feb 26 10:49 PM
            • 0 Attachment
              Hi, Christian,

              The diffoff command seems to solve the problem. As for reproducing the problem, I ran

              "C:\Program Files (x86)\Vim\vim73\gvim.exe" -u NONE -N

              Then I split the window vertically. In the left half I loaded any text file that was long enough to occupy several screens. On the right window, I loaded a 2nd text file whose contents were identical to the first one. I then issued:

              :windo diffthis
              :windo set nofenable

              Then I issued:

              :windo set nodiff foldcolumn=0 noscrollbind

              When I pressed ctrl-F to page forward in any one window for 2-3 times, the other window followed. This is consistent with cursorbind, as suggested by Ben Fritz. So I think the problem is solved. 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 vim_use+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • Christian Brabandt
              ... I think, what you are seeing is the effect of cursorbind , which get s set by diff-mode and is still set in all windows. I am currently puzzled, what
              Message 6 of 7 , Feb 27 12:04 AM
              • 0 Attachment
                On Wed, February 27, 2013 07:49, AndyHancock wrote:
                > Hi, Christian,
                >
                > The diffoff command seems to solve the problem. As for reproducing the
                > problem, I ran
                >
                > "C:\Program Files (x86)\Vim\vim73\gvim.exe" -u NONE -N
                >
                > Then I split the window vertically. In the left half I loaded any text
                > file that was long enough to occupy several screens. On the right window,
                > I loaded a 2nd text file whose contents were identical to the first one.
                > I then issued:
                >
                > :windo diffthis
                > :windo set nofenable
                >
                > Then I issued:
                >
                > :windo set nodiff foldcolumn=0 noscrollbind
                >
                > When I pressed ctrl-F to page forward in any one window for 2-3 times, the
                > other window followed. This is consistent with cursorbind, as suggested
                > by Ben Fritz. So I think the problem is solved. Thanks.

                I think, what you are seeing is the effect of 'cursorbind', which
                get's set by diff-mode and is still set in all windows.

                I am currently puzzled, what cursorbind does, that scrollbind doesn't
                provide e.g. why we need both options and I don't understand it in
                the manual.

                So yes, using :diffoff! is easier to stop diff mode.

                regards,
                Christian

                --
                --
                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 vim_use+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              • Ben Fritz
                ... Yes, we re pretty sure this is the cause. ... Scrollbind affects window position. Cursorbind affects cursor position. With scrollbind set, you can scroll
                Message 7 of 7 , Feb 27 12:05 PM
                • 0 Attachment
                  On Wednesday, February 27, 2013 2:04:03 AM UTC-6, Christian Brabandt wrote:
                  >
                  > I think, what you are seeing is the effect of 'cursorbind', which
                  >
                  > get's set by diff-mode and is still set in all windows.
                  >
                  >

                  Yes, we're pretty sure this is the cause.

                  >
                  > I am currently puzzled, what cursorbind does, that scrollbind doesn't
                  >
                  > provide e.g. why we need both options and I don't understand it in
                  >
                  > the manual.
                  >
                  >

                  Scrollbind affects window position. Cursorbind affects cursor position. With scrollbind set, you can scroll both windows in a diff view together. With cursorbind, if you then switch windows, the cursor does not move vertically when it reaches the new window. In other words, either of these will do the same thing in a 2-window setup:

                  do
                  <C-W><C-W>dp

                  Without cursorbind, when you jump to the other window, the cursor remains wherever it was the last time the cursor was in that window. Or, if the window has scrolled far enough, the cursor will be at the top/bottom of the window, even if the cursor was in the middle of the other window when you left it.

                  >
                  > So yes, using :diffoff! is easier to stop diff mode.
                  >

                  Much easier. But it also messes with other settings like 'wrap' and 'foldmethod', so I like to do this to start diffmode instead:

                  :tab split
                  :diffsplit other_file

                  And this to end it:

                  :tabclose

                  --
                  --
                  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 vim_use+unsubscribe@....
                  For more options, visit https://groups.google.com/groups/opt_out.
                Your message has been successfully submitted and would be delivered to recipients shortly.