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

[PATCH] Add 'waitforglobalmap' option

Expand Messages
  • ZyX
    This patch negates effect of patch 7.3.1179 if waitforglobalmap option is set. # HG changeset patch # User ZyX # Date 1371906075 -14400 #
    Message 1 of 2 , Jun 22, 2013
    • 0 Attachment
      This patch negates effect of patch 7.3.1179 if 'waitforglobalmap' option is set.

      # HG changeset patch
      # User ZyX <kp-pav@...>
      # Date 1371906075 -14400
      # Sat Jun 22 17:01:15 2013 +0400
      # Branch enable-waiting
      # Node ID 32d2ee310c5c05b9f0da6a147c18946714b77937
      # Parent 020c48b4fb47ebc06ce0658dc65b2705c7f7e27f
      Add 'waitforglobalmap' option.

      diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
      --- a/runtime/doc/map.txt
      +++ b/runtime/doc/map.txt
      @@ -655,17 +655,18 @@
      you type slowly, or your system is slow, reset the 'timeout' option. Then you
      might want to set the 'ttimeout' option.

      - *map-precedence*
      -Buffer-local mappings (defined using |:map-<buffer>|) take precedence over
      -global mappings. When a buffer-local mapping is the same as a global mapping,
      -Vim will use the buffer-local mapping. In addition, Vim will use a complete
      -buffer-local mapping immediately, even if a longer global mapping has the
      -buffer-local mapping as a prefix. For example, given the following two
      -mappings: >
      + *map-precedence*
      +By default buffer-local mappings (defined using |:map-<buffer>|) take
      +precedence over global mappings. When a buffer-local mapping is the same as
      +a global mapping, Vim will use the buffer-local mapping. In addition, Vim
      +will use a complete buffer-local mapping immediately, even if a longer global
      +mapping has the buffer-local mapping as a prefix. For example, given the
      +following two mappings: >
      :map <buffer> \a :echo "Local \a"<CR>
      :map \abc :echo "Global \abc"<CR>
      The buffer-local mapping \a will be used immediately. Vim will not wait for
      -more characters to see if the user might be typing \abc.
      +more characters to see if the user might be typing \abc. This behavior is
      +overridden by 'waitforglobalmap' option which will make vim wait for \abc.

      *map-keys-fails*
      There are situations where key codes might not be recognized:
      diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
      --- a/runtime/doc/options.txt
      +++ b/runtime/doc/options.txt
      @@ -1808,9 +1808,8 @@
      Keep in mind that the cursor position is not always where it's
      displayed. E.g., when moving vertically it may change column.

      -
      -'conceallevel' 'cole' *'conceallevel'* *'cole'*
      - number (default 0)
      + *'conceallevel'* *'cole'*
      +'conceallevel' 'cole' number (default 0)
      local to window
      {not in Vi}
      {not available when compiled without the |+conceal|
      @@ -2186,7 +2185,7 @@


      *'cryptmethod'* *'cm'*
      -'cryptmethod' string (default "zip")
      +'cryptmethod' 'cm' string (default "zip")
      global or local to buffer |global-local|
      {not in Vi}
      Method used for encryption when the buffer is written to a file:
      @@ -2235,7 +2234,7 @@
      security reasons.

      *'cscopequickfix'* *'csqf'*
      -'cscopequickfix' 'csqf' string (default "")
      +'cscopequickfix' 'csqf' string (default "")
      global
      {not available when compiled without the |+cscope|
      or |+quickfix| features}
      @@ -2244,7 +2243,7 @@
      See |cscopequickfix|.

      *'cscoperelative'* *'csre'* *'nocscoperelative'* *'nocsre'*
      -'cscoperelative' 'csre' boolean (default off)
      +'cscoperelative' 'csre' boolean (default off)
      global
      {not available when compiled without the |+cscope|
      feature}
      @@ -8247,4 +8246,13 @@
      screen. When non-zero, characters are sent to the terminal one by
      one. For MS-DOS pcterm this does not work. For debugging purposes.

      + *'waitforglobalmap'* *'wgm'*
      + *'nowaitforglobalmap'* *'nowgm'*
      +'waitforglobalmap' 'wgm' boolean (default off)
      + global
      + {not in Vi}
      + If set wait for global mapping even if full buffer-local mapping was
      + already typed. Has effect if there is global mapping with lhs starting
      + with lhs of |:map-<buffer>| mapping. See also |map-precedence|.
      +
      vim:tw=78:ts=8:ft=help:norl:
      diff --git a/src/getchar.c b/src/getchar.c
      --- a/src/getchar.c
      +++ b/src/getchar.c
      @@ -2131,7 +2131,8 @@
      (mp = mp->m_next))
      {
      #ifdef FEAT_LOCALMAP
      - if (expecting_global_mappings && mp2 == NULL)
      + if (!p_wgm
      + && expecting_global_mappings && mp2 == NULL)
      {
      /* This is the first global mapping. If we've
      * got a complete buffer-local match, use it. */
      diff --git a/src/option.c b/src/option.c
      --- a/src/option.c
      +++ b/src/option.c
      @@ -2871,6 +2871,13 @@
      {"writedelay", "wd", P_NUM|P_VI_DEF,
      (char_u *)&p_wd, PV_NONE,
      {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
      + {"waitforglobalmap", "wgm", P_BOOL,
      +#ifdef FEAT_LOCALMAP
      + (char_u *)&p_wgm, PV_NONE,
      +#else
      + (char_u *)NULL, PV_NONE,
      +#endif
      + {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},

      /* terminal output codes */
      #define p_term(sss, vvv) {sss, NULL, P_STRING|P_VI_DEF|P_RALL|P_SECURE, \
      diff --git a/src/option.h b/src/option.h
      --- a/src/option.h
      +++ b/src/option.h
      @@ -904,6 +904,9 @@
      EXTERN int p_wa; /* 'writeany' */
      EXTERN int p_wb; /* 'writebackup' */
      EXTERN long p_wd; /* 'writedelay' */
      +#ifdef FEAT_LOCALMAP
      +EXTERN int p_wgm; /* 'waitforglobalmap' */
      +#endif

      /*
      * "indir" values for buffer-local opions.

      --
      --
      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.
    • Andy Wokula
      ... If a new option is desired at all, it should become local to buffer . Default could be on to make it backwards compatible. Plugins (like Tagbar,
      Message 2 of 2 , Jun 28, 2013
      • 0 Attachment
        Am 22.06.2013 15:04, schrieb ZyX:
        > This patch negates effect of patch 7.3.1179 if 'waitforglobalmap' option is set.

        > + *'waitforglobalmap'* *'wgm'*
        > + *'nowaitforglobalmap'* *'nowgm'*
        > +'waitforglobalmap' 'wgm' boolean (default off)
        > + global
        > + {not in Vi}
        > + If set wait for global mapping even if full buffer-local mapping was
        > + already typed. Has effect if there is global mapping with lhs starting
        > + with lhs of |:map-<buffer>| mapping. See also |map-precedence|.
        > +

        If a new option is desired at all, it should become "local to buffer".
        Default could be "on" to make it backwards compatible.
        Plugins (like Tagbar, Bufexplorer, etc.) could locally set it to "off".

        --
        Andy

        --
        --
        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.