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

PATCH: when doing :diffpatch, diff options can get overwritten in result window

Expand Messages
  • Ingo Karkat
    Hello Bram, Today I used the :diffpatch command for the first time (after more than 7 happy years with VIM :-), and I noticed that although the patch result
    Message 1 of 2 , Feb 4, 2009
    • 0 Attachment
      Hello Bram,

      Today I used the :diffpatch command for the first time (after more than 7 happy
      years with VIM :-), and I noticed that although the patch result window was in
      'diff' mode, the folding was still done with markers, as specified by a modeline
      in my particular file. This is unexpected and inconsistent with the :diffsplit
      command, which always sets 'diff' and 'foldmethod=diff', even when the file's
      modeline (or a ftplugin) chooses another foldmethod.

      Attached patch moves the setting of 'diff', 'scrollbind' and 'wrap' to the end
      of the function, after the result buffer is named and autocommands have
      executed. I think this is how it was intended.

      Steps to reproduce:

      cat > test.txt <<EOF
      vim:fdm=marker
      a test {{{1
      }}}1
      EOF
      cp test.txt test.new
      echo "a change" >> test.new
      diff -c test.{txt,new} > test.txt.diff
      vim -N -u NONE test.txt
      :filetype on
      :diffpatch test.txt.diff
      :setlocal foldmethod?
      " Prints 'marker', should be 'diff'.

      -- regards, ingo

      --
      -- Ingo Karkat -- /^-- /^-- /^-- /^-- /^-- /^-- http://ingo-karkat.de/ --
      --
      Me? A skeptic? I trust you have proof.

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Bram Moolenaar
      ... Thanks, I ll add it to the todo list. -- hundred-and-one symptoms of being an internet addict: 39. You move into a new house and decide to Netscape before
      Message 2 of 2 , Feb 4, 2009
      • 0 Attachment
        Ingo Karkat wrote:

        > Today I used the :diffpatch command for the first time (after more
        > than 7 happy years with VIM :-), and I noticed that although the patch
        > result window was in 'diff' mode, the folding was still done with
        > markers, as specified by a modeline in my particular file. This is
        > unexpected and inconsistent with the :diffsplit command, which always
        > sets 'diff' and 'foldmethod=diff', even when the file's modeline (or a
        > ftplugin) chooses another foldmethod.
        >
        > Attached patch moves the setting of 'diff', 'scrollbind' and 'wrap' to
        > the end of the function, after the result buffer is named and
        > autocommands have executed. I think this is how it was intended.
        >
        > Steps to reproduce:
        >
        > cat > test.txt <<EOF
        > vim:fdm=marker
        > a test {{{1
        > }}}1
        > EOF
        > cp test.txt test.new
        > echo "a change" >> test.new
        > diff -c test.{txt,new} > test.txt.diff
        > vim -N -u NONE test.txt
        > :filetype on
        > :diffpatch test.txt.diff
        > :setlocal foldmethod?
        > " Prints 'marker', should be 'diff'.

        Thanks, I'll add it to the todo list.

        --
        hundred-and-one symptoms of being an internet addict:
        39. You move into a new house and decide to Netscape before you landscape.

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ download, build and distribute -- http://www.A-A-P.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      Your message has been successfully submitted and would be delivered to recipients shortly.