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

Patch 7.3.810

Expand Messages
  • Bram Moolenaar
    Patch 7.3.810 Problem: relativenumber is reset unexpectedly. (François Ingelrest) Solution: After an option was reset also reset the global value. Add a
    Message 1 of 3 , Feb 13, 2013
      Patch 7.3.810
      Problem: 'relativenumber is reset unexpectedly. (François Ingelrest)
      Solution: After an option was reset also reset the global value. Add a test.
      (Christian Brabandt)
      Files: src/option.c, src/testdir/Make_amiga.mak,
      src/testdir/Make_dos.mak, src/testdir/Make_ming.mak,
      src/testdir/Make_os2.mak, src/testdir/Make_vms.mms,
      src/testdir/Makefile, src/testdir/test89.in,
      src/testdir/test89.ok


      *** ../vim-7.3.809/src/option.c 2013-01-17 17:37:31.000000000 +0100
      --- src/option.c 2013-02-13 15:40:12.000000000 +0100
      ***************
      *** 7109,7115 ****
      return errmsg;
      }

      ! #ifdef FEAT_SYN_HL
      /*
      * Simple int comparison function for use with qsort()
      */
      --- 7109,7115 ----
      return errmsg;
      }

      ! #if defined(FEAT_SYN_HL) || defined(PROTO)
      /*
      * Simple int comparison function for use with qsort()
      */
      ***************
      *** 7630,7646 ****
      }
      #endif

      ! /* 'list', 'number' */
      ! else if ((int *)varp == &curwin->w_p_list
      ! || (int *)varp == &curwin->w_p_nu
      || (int *)varp == &curwin->w_p_rnu)
      {
      /* If 'number' is set, reset 'relativenumber'. */
      /* If 'relativenumber' is set, reset 'number'. */
      if ((int *)varp == &curwin->w_p_nu && curwin->w_p_nu)
      curwin->w_p_rnu = FALSE;
      if ((int *)varp == &curwin->w_p_rnu && curwin->w_p_rnu)
      curwin->w_p_nu = FALSE;
      }

      else if ((int *)varp == &curbuf->b_p_ro)
      --- 7630,7651 ----
      }
      #endif

      ! /* 'number', 'relativenumber' */
      ! else if ((int *)varp == &curwin->w_p_nu
      || (int *)varp == &curwin->w_p_rnu)
      {
      /* If 'number' is set, reset 'relativenumber'. */
      /* If 'relativenumber' is set, reset 'number'. */
      if ((int *)varp == &curwin->w_p_nu && curwin->w_p_nu)
      + {
      curwin->w_p_rnu = FALSE;
      + curwin->w_allbuf_opt.wo_rnu = FALSE;
      + }
      if ((int *)varp == &curwin->w_p_rnu && curwin->w_p_rnu)
      + {
      curwin->w_p_nu = FALSE;
      + curwin->w_allbuf_opt.wo_nu = FALSE;
      + }
      }

      else if ((int *)varp == &curbuf->b_p_ro)
      *** ../vim-7.3.809/src/testdir/Make_amiga.mak 2012-12-05 16:10:21.000000000 +0100
      --- src/testdir/Make_amiga.mak 2013-02-13 15:01:32.000000000 +0100
      ***************
      *** 31,37 ****
      test66.out test67.out test68.out test69.out test70.out \
      test71.out test72.out test73.out test74.out test75.out \
      test76.out test77.out test78.out test79.out test80.out \
      ! test81.out test82.out test83.out test84.out test88.out

      .SUFFIXES: .in .out

      --- 31,38 ----
      test66.out test67.out test68.out test69.out test70.out \
      test71.out test72.out test73.out test74.out test75.out \
      test76.out test77.out test78.out test79.out test80.out \
      ! test81.out test82.out test83.out test84.out test88.out \
      ! test89.out

      .SUFFIXES: .in .out

      ***************
      *** 136,138 ****
      --- 137,140 ----
      test83.out: test83.in
      test84.out: test84.in
      test88.out: test88.in
      + test89.out: test89.in
      *** ../vim-7.3.809/src/testdir/Make_dos.mak 2012-12-05 16:10:21.000000000 +0100
      --- src/testdir/Make_dos.mak 2013-02-13 15:00:59.000000000 +0100
      ***************
      *** 30,36 ****
      test68.out test69.out test71.out test72.out test73.out \
      test74.out test75.out test76.out test77.out test78.out \
      test79.out test80.out test81.out test82.out test83.out \
      ! test84.out test85.out test86.out test87.out test88.out

      SCRIPTS32 = test50.out test70.out

      --- 30,37 ----
      test68.out test69.out test71.out test72.out test73.out \
      test74.out test75.out test76.out test77.out test78.out \
      test79.out test80.out test81.out test82.out test83.out \
      ! test84.out test85.out test86.out test87.out test88.out \
      ! test89.out

      SCRIPTS32 = test50.out test70.out

      *** ../vim-7.3.809/src/testdir/Make_ming.mak 2012-12-05 16:10:21.000000000 +0100
      --- src/testdir/Make_ming.mak 2013-02-13 15:01:16.000000000 +0100
      ***************
      *** 50,56 ****
      test68.out test69.out test71.out test72.out test73.out \
      test74.out test75.out test76.out test77.out test78.out \
      test79.out test80.out test81.out test82.out test83.out \
      ! test84.out test85.out test86.out test87.out test88.out

      SCRIPTS32 = test50.out test70.out

      --- 50,57 ----
      test68.out test69.out test71.out test72.out test73.out \
      test74.out test75.out test76.out test77.out test78.out \
      test79.out test80.out test81.out test82.out test83.out \
      ! test84.out test85.out test86.out test87.out test88.out \
      ! test89.out

      SCRIPTS32 = test50.out test70.out

      *** ../vim-7.3.809/src/testdir/Make_os2.mak 2012-12-05 16:10:21.000000000 +0100
      --- src/testdir/Make_os2.mak 2013-02-13 15:00:59.000000000 +0100
      ***************
      *** 31,37 ****
      test66.out test67.out test68.out test69.out test70.out \
      test71.out test72.out test73.out test74.out test75.out \
      test76.out test77.out test78.out test79.out test80.out \
      ! test81.out test82.out test83.out test84.out test88.out

      .SUFFIXES: .in .out

      --- 31,38 ----
      test66.out test67.out test68.out test69.out test70.out \
      test71.out test72.out test73.out test74.out test75.out \
      test76.out test77.out test78.out test79.out test80.out \
      ! test81.out test82.out test83.out test84.out test88.out \
      ! test89.out

      .SUFFIXES: .in .out

      *** ../vim-7.3.809/src/testdir/Make_vms.mms 2012-12-05 16:10:21.000000000 +0100
      --- src/testdir/Make_vms.mms 2013-02-13 15:00:59.000000000 +0100
      ***************
      *** 76,82 ****
      test66.out test67.out test68.out test69.out \
      test71.out test72.out test74.out test75.out test76.out \
      test77.out test78.out test79.out test80.out test81.out \
      ! test82.out test83.out test84.out test88.out

      # Known problems:
      # Test 30: a problem around mac format - unknown reason
      --- 76,82 ----
      test66.out test67.out test68.out test69.out \
      test71.out test72.out test74.out test75.out test76.out \
      test77.out test78.out test79.out test80.out test81.out \
      ! test82.out test83.out test84.out test88.out test89.out

      # Known problems:
      # Test 30: a problem around mac format - unknown reason
      *** ../vim-7.3.809/src/testdir/Makefile 2012-12-05 18:21:28.000000000 +0100
      --- src/testdir/Makefile 2013-02-13 15:00:59.000000000 +0100
      ***************
      *** 27,33 ****
      test69.out test70.out test71.out test72.out test73.out \
      test74.out test75.out test76.out test77.out test78.out \
      test79.out test80.out test81.out test82.out test83.out \
      ! test84.out test85.out test86.out test87.out test88.out

      SCRIPTS_GUI = test16.out

      --- 27,34 ----
      test69.out test70.out test71.out test72.out test73.out \
      test74.out test75.out test76.out test77.out test78.out \
      test79.out test80.out test81.out test82.out test83.out \
      ! test84.out test85.out test86.out test87.out test88.out \
      ! test89.out

      SCRIPTS_GUI = test16.out

      *** ../vim-7.3.809/src/testdir/test89.in 2013-02-13 15:43:44.000000000 +0100
      --- src/testdir/test89.in 2013-02-13 15:07:28.000000000 +0100
      ***************
      *** 0 ****
      --- 1,15 ----
      + Some tests for setting 'number' and 'relativenumber'
      +
      + STARTTEST
      + :set hidden nocp nu rnu
      + :redir @a | set nu? rnu? | redir END
      + :e! xx
      + :redir @b | set nu? rnu? | redir END
      + :e! #
      + :$put ='results:'
      + :$put a
      + :$put b
      + :/^results/,$w! test.out
      + :q!
      + ENDTEST
      +
      *** ../vim-7.3.809/src/testdir/test89.ok 2013-02-13 15:43:44.000000000 +0100
      --- src/testdir/test89.ok 2013-02-13 15:08:05.000000000 +0100
      ***************
      *** 0 ****
      --- 1,7 ----
      + results:
      +
      + nonumber
      + relativenumber
      +
      + nonumber
      + relativenumber
      *** ../vim-7.3.809/src/version.c 2013-02-13 14:36:39.000000000 +0100
      --- src/version.c 2013-02-13 15:42:18.000000000 +0100
      ***************
      *** 727,728 ****
      --- 727,730 ----
      { /* Add new patch number below this line */
      + /**/
      + 810,
      /**/

      --
      A law to reduce crime states: "It is mandatory for a motorist with criminal
      intentions to stop at the city limits and telephone the chief of police as he
      is entering the town.
      [real standing law in Washington, United States of America]

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ an exciting new programming language -- http://www.Zimbu.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

      --
      --
      You received this message from the "vim_dev" 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_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Markus Heidelberg
      Hello, ... this bug I wanted to fix since a long time. See these problem reports for reference:
      Message 2 of 3 , Feb 16, 2013
        Hello,

        > Patch 7.3.810
        > Problem: 'relativenumber is reset unexpectedly. (François Ingelrest)
        > Solution: After an option was reset also reset the global value. Add a test.
        > (Christian Brabandt)

        this bug I wanted to fix since a long time.
        See these problem reports for reference:
        http://groups.google.com/group/vim_dev/tree/browse_frm/month/2011-06/a31555949a630937#doc_704d17d6ef33a9cb
        http://groups.google.com/group/vim_dev/tree/browse_frm/month/2012-03/a6662e58cccb720e#doc_e373c950580fd7f0

        However, this patch doesn't consider ":setlocal", which now clears the
        global value of the 'nu' or 'rnu' counterpart.

        Here is a patch for this and for doing it right for ":setglobal", both
        with a test. And an additional test for ":set" and its influence on the
        global value.


        diff -r 84cc49b2da4f src/option.c
        --- a/src/option.c Sat Feb 16 18:16:15 2013 +0100
        +++ b/src/option.c Sun Feb 17 00:07:08 2013 +0100
        @@ -7630,22 +7630,31 @@
        }
        #endif

        - /* 'number', 'relativenumber' */
        - else if ((int *)varp == &curwin->w_p_nu
        - || (int *)varp == &curwin->w_p_rnu)
        - {
        - /* If 'number' is set, reset 'relativenumber'. */
        - /* If 'relativenumber' is set, reset 'number'. */
        - if ((int *)varp == &curwin->w_p_nu && curwin->w_p_nu)
        - {
        - curwin->w_p_rnu = FALSE;
        + /* If 'number' is set, reset 'relativenumber'. */
        + /* If 'relativenumber' is set, reset 'number'. */
        + else if ((int *)varp == &curwin->w_p_nu && curwin->w_p_nu)
        + {
        + curwin->w_p_rnu = FALSE;
        +
        + /* Only reset the other global value if the own value is set globally. */
        + if (((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0))
        curwin->w_allbuf_opt.wo_rnu = FALSE;
        - }
        - if ((int *)varp == &curwin->w_p_rnu && curwin->w_p_rnu)
        - {
        - curwin->w_p_nu = FALSE;
        + }
        + else if ((int *)varp == &curwin->w_p_rnu && curwin->w_p_rnu)
        + {
        + curwin->w_p_nu = FALSE;
        +
        + /* Only reset the other global value if the own value is set globally. */
        + if (((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0))
        curwin->w_allbuf_opt.wo_nu = FALSE;
        - }
        + }
        + else if ((int *)varp == &curwin->w_allbuf_opt.wo_nu && curwin->w_allbuf_opt.wo_nu)
        + {
        + curwin->w_allbuf_opt.wo_rnu = FALSE;
        + }
        + else if ((int *)varp == &curwin->w_allbuf_opt.wo_rnu && curwin->w_allbuf_opt.wo_rnu)
        + {
        + curwin->w_allbuf_opt.wo_nu = FALSE;
        }

        else if ((int *)varp == &curbuf->b_p_ro)
        diff -r 84cc49b2da4f src/testdir/test89.in
        --- a/src/testdir/test89.in Sat Feb 16 18:16:15 2013 +0100
        +++ b/src/testdir/test89.in Sun Feb 17 00:07:08 2013 +0100
        @@ -10,6 +10,43 @@
        :$put ='results:'
        :$put a
        :$put b
        +:"
        +:set nonu nornu
        +:setglobal nu
        +:setlocal rnu
        +:redir @c | setglobal nu? | redir END
        +:set nonu nornu
        +:setglobal rnu
        +:setlocal nu
        +:redir @d | setglobal rnu? | redir END
        +:$put =':setlocal must NOT reset the other global value'
        +:$put c
        +:$put d
        +:"
        +:set nonu nornu
        +:setglobal nu
        +:setglobal rnu
        +:redir @e | setglobal nu? | redir END
        +:set nonu nornu
        +:setglobal rnu
        +:setglobal nu
        +:redir @f | setglobal rnu? | redir END
        +:$put =':setglobal MUST reset the other global value'
        +:$put e
        +:$put f
        +:"
        +:set nonu nornu
        +:set nu
        +:set rnu
        +:redir @g | setglobal nu? | redir END
        +:set nonu nornu
        +:set rnu
        +:set nu
        +:redir @h | setglobal rnu? | redir END
        +:$put =':set MUST reset the other global value'
        +:$put g
        +:$put h
        +:"
        :/^results/,$w! test.out
        :q!
        ENDTEST
        diff -r 84cc49b2da4f src/testdir/test89.ok
        --- a/src/testdir/test89.ok Sat Feb 16 18:16:15 2013 +0100
        +++ b/src/testdir/test89.ok Sun Feb 17 00:07:08 2013 +0100
        @@ -5,3 +5,18 @@

        nonumber
        relativenumber
        +:setlocal must NOT reset the other global value
        +
        + number
        +
        + relativenumber
        +:setglobal MUST reset the other global value
        +
        +nonumber
        +
        +norelativenumber
        +:set MUST reset the other global value
        +
        +nonumber
        +
        +norelativenumber

        --
        --
        You received this message from the "vim_dev" 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_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Bram Moolenaar
        ... Thanks! I ll add it to the todo list. -- SECOND SOLDIER: It could be carried by an African swallow! FIRST SOLDIER: Oh yes! An African swallow maybe ...
        Message 3 of 3 , Feb 17, 2013
          Markus Heidelberg wrote:

          > > Patch 7.3.810
          > > Problem: 'relativenumber is reset unexpectedly. (François Ingelrest)
          > > Solution: After an option was reset also reset the global value. Add a test.
          > > (Christian Brabandt)
          >
          > this bug I wanted to fix since a long time.
          > See these problem reports for reference:
          > http://groups.google.com/group/vim_dev/tree/browse_frm/month/2011-06/a31555949a630937#doc_704d17d6ef33a9cb
          > http://groups.google.com/group/vim_dev/tree/browse_frm/month/2012-03/a6662e58cccb720e#doc_e373c950580fd7f0
          >
          > However, this patch doesn't consider ":setlocal", which now clears the
          > global value of the 'nu' or 'rnu' counterpart.
          >
          > Here is a patch for this and for doing it right for ":setglobal", both
          > with a test. And an additional test for ":set" and its influence on the
          > global value.

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


          --
          SECOND SOLDIER: It could be carried by an African swallow!
          FIRST SOLDIER: Oh yes! An African swallow maybe ... but not a European
          swallow. that's my point.
          "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
          \\\ an exciting new programming language -- http://www.Zimbu.org ///
          \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

          --
          --
          You received this message from the "vim_dev" 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_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+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.