From 13841a56b4b4916a2f18e66f97cb6f5e55d40e53 Mon Sep 17 00:00:00 2001 From: KillTheMule Date: Fri, 12 Aug 2016 12:00:36 +0200 Subject: Incsubsitution feature Originally implemented by * Clement0 * DesbyP * aym7 * Adrey06 * Robinhola in #4811. Major reworkings and bug fixes by * bfredl Most tests suggested by ZyX-l, suggestions for improvements by oni-link. --- src/nvim/syntax.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/syntax.c') diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index b49ae9da21..a1c6718b06 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -5902,6 +5902,7 @@ static char *highlight_init_both[] = "WildMenu ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black", "default link EndOfBuffer NonText", "default link QuickFixLine Search", + "default link IncSubstitute Search", NULL }; -- cgit From c04ffe866d276d6a6bd9e9c6a8b0dbb71504db7c Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 31 Oct 2016 03:50:19 +0100 Subject: 'inccommand': rework MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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) --- src/nvim/syntax.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/nvim/syntax.c') diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index a1c6718b06..68d0e3da0f 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -7160,16 +7160,13 @@ int syn_namen2id(char_u *linep, int len) */ int syn_check_group(char_u *pp, int len) { - int id; - char_u *name; - - name = vim_strnsave(pp, len); - - id = syn_name2id(name); - if (id == 0) /* doesn't exist yet */ + char_u *name = vim_strnsave(pp, len); + int id = syn_name2id(name); + if (id == 0) { // doesn't exist yet id = syn_add_group(name); - else + } else { xfree(name); + } return id; } -- cgit From 6a3f8d48d0c96330511565aef5e10ad965e986b4 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 7 Nov 2016 00:59:32 +0100 Subject: 'inccommand': rename 'incsubstitute' 'inccommand' allows us to expand the feature to other commands, such as: :cdo :cfdo :global Also rename "IncSubstitute" highlight group to "Substitute". --- src/nvim/syntax.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/syntax.c') diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index 68d0e3da0f..e57965ac2c 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -5902,7 +5902,7 @@ static char *highlight_init_both[] = "WildMenu ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black", "default link EndOfBuffer NonText", "default link QuickFixLine Search", - "default link IncSubstitute Search", + "default link Substitute Search", NULL }; -- cgit