'inccommand': rework

- Eliminate/isolate static/global variables
- Remove special-case parameter from buflist_new()
- Remove special-case ECMD_RESERVED_BUFNR
- To determine when u_undo_and_forget() should be done, check
  b_changedtick instead of a heuristic.
- use mb_string2cells() instead of strlen() to measure the :sub patterns
- call ml_close() before buf_clear_file(). Avoids leaks caught by ASan.

Original patch by:
  Robin Elrharbi-Fleury (Robinhola)
  Audrey Rayé (Adrey06)
  Philémon Hullot (DesbyP)
  Aymeric Collange (aym7)
  Clément Guyomard (Clement0)
This commit is contained in:
Justin M. Keyes
2016-10-31 03:50:19 +01:00
parent e8c0f90962
commit c04ffe866d
24 changed files with 386 additions and 472 deletions

View File

@@ -450,7 +450,7 @@ notation meaning equivalent decimal value(s) ~
<k0> - <k9> keypad 0 to 9 *keypad-0* *keypad-9*
<S-...> shift-key *shift* *<S-*
<C-...> control-key *control* *ctrl* *<C-*
<M-...> alt-key or meta-key *meta* *alt* *<M-*
<M-...> alt-key or meta-key *META* *meta* *alt* *<M-*
<A-...> same as <M-...> *<A-*
<D-...> command-key or "super" key *<D-*
<t_xx> key with "xx" entry in termcap

View File

@@ -3526,6 +3526,14 @@ A jump table for the options with a short description can be found at |Q_op|.
CTRL-R CTRL-W can be used to add the word at the end of the current
match, excluding the characters that were already typed.
*'incsubstitute'* *'ics'*
'incsubstitute' 'ics' string (default "")
global
If "split" or "nosplit" then |:substitute| updates the buffer
as-you-type. If "split", also show partial off-screen results in
a window. Replacement text is hightlighted with |hl-IncSubstitute|.
*'indentexpr'* *'inde'*
'indentexpr' 'inde' string (default "")
local to buffer
@@ -3992,16 +4000,6 @@ A jump table for the options with a short description can be found at |Q_op|.
"precedes". "SpecialKey" for "nbsp", "space", "tab" and "trail".
|hl-NonText| |hl-SpecialKey|
*'incsubstitute'* *'ics'*
'incsubstitute' 'ics' string (default "")
global
If set to "split" or "nosplit", substitutions (|:s|) are updated live
while the user types the command. If set to "split", a split window
is open which displays the lines where the search matches. The
replacement text in the split is hightlighted using
|hl-IncSubstitute|. Note: Only '/' is supported as a delimiter.
*'lpl'* *'nolpl'* *'loadplugins'* *'noloadplugins'*
'loadplugins' 'lpl' boolean (default on)
global

View File

@@ -4852,11 +4852,11 @@ SignColumn column where |signs| are displayed
*hl-IncSearch*
IncSearch 'incsearch' highlighting; also used for the text replaced with
":s///c"
*hl-IncSubstitute*
IncSubstitute 'incsubstitute' replacement text
*hl-LineNr*
LineNr Line number for ":number" and ":#" commands, and when 'number'
or 'relativenumber' option is set.
*hl-IncSubstitute*
IncSubstitute The replacement text when using the |incsubstitute| functionality
*hl-CursorLineNr*
CursorLineNr Like LineNr when 'cursorline' or 'relativenumber' is set for
the cursor line.

View File

@@ -64,7 +64,7 @@ these differences.
3. New Features *nvim-features*
MAJOR FEATURES ~
MAJOR COMPONENTS ~
Embedded terminal emulator |terminal-emulator|
RPC API |RPC|
@@ -85,25 +85,29 @@ avoids features that cannot be provided on all platforms--instead that is
delegated to external plugins/extensions.
OTHER FEATURES ~
ARCHITECTURE ~
External plugins run in separate processes. |remote-plugin| This improves
stability and allows those plugins to perform tasks without blocking the
editor. Even "legacy" Python and Ruby plugins which use the old Vim interfaces
(|if_py| and |if_ruby|) run out-of-process.
FEATURES ~
|bracketed-paste-mode| is built-in and enabled by default.
Meta (alt) chords are recognized (even in the terminal).
<M-1>, <M-2>, ...
<M-BS>, <M-Del>, <M-Ins>, ...
<M-/>, <M-\>, ...
<M-Space>, <M-Enter>, <M-=>, <M-->, <M-?>, <M-$>, ...
Note: Meta chords are case-sensitive (<M-a> is distinguished from <M-A>).
|META| (ALT) chords are recognized, even in the terminal. Any |<M-| mapping
will work. Some examples: <M-1>, <M-2>, <M-BS>, <M-Del>, <M-Ins>, <M-/>,
<M-\>, <M-Space>, <M-Enter>, <M-=>, <M-->, <M-?>, <M-$>, ...
META chords are case-sensitive: <M-a> and <M-A> are two different keycodes.
Some `CTRL-SHIFT-...` key chords are distinguished from `CTRL-...` variants
(even in the terminal). Specifically, the following are known to work:
<C-Tab>, <C-S-Tab>
<C-BS>, <C-S-BS>
<C-Enter>, <C-S-Enter>
<C-Tab>, <C-S-Tab>, <C-BS>, <C-S-BS>, <C-Enter>, <C-S-Enter>
Options:
'incsubstitute' shows results while typing a |:substitute| command
'statusline' supports unlimited alignment sections
'tabline' %@Func@foo%X can call any function on mouse-click
@@ -125,14 +129,14 @@ Functions:
Events:
|TabNew|
|TabNewEntered|
|TabClosed|
|TermOpen|
|TermClose|
|TermOpen|
|TextYankPost|
Highlight groups:
|hl-EndOfBuffer|
|hl-Substitute|
|hl-QuickFixLine|
|hl-Substitute|
|hl-TermCursor|
|hl-TermCursorNC|
@@ -298,6 +302,7 @@ Other commands:
:mode (no longer accepts an argument)
:open
:shell
:smile
:tearoff
Other compile-time features: