vim-patch:8.1.1823: command line history code is spread out (#19688)

Problem:    Command line history code is spread out.
Solution:   Put the code in a new file. (Yegappan Lakshmanan, closes vim/vim#4779)
            Also graduate the +cmdline_hist feature.
d7663c22c6
This commit is contained in:
zeertzjq
2022-08-09 17:13:44 +08:00
committed by GitHub
parent a5e846b996
commit cd14efd281
12 changed files with 835 additions and 792 deletions

View File

@@ -18,6 +18,7 @@
#include "nvim/buffer.h"
#include "nvim/change.h"
#include "nvim/charset.h"
#include "nvim/cmdhist.h"
#include "nvim/cursor.h"
#include "nvim/diff.h"
#include "nvim/digraph.h"
@@ -4379,9 +4380,11 @@ static void nv_ident(cmdarg_T *cap)
&& vim_iswordp(mb_prevptr(get_cursor_line_ptr(), ptr))) {
STRCAT(buf, "\\>");
}
// put pattern in search history
init_history();
add_to_history(HIST_SEARCH, (char_u *)buf, true, NUL);
(void)normal_search(cap, cmdchar == '*' ? '/' : '?', (char_u *)buf, 0,
NULL);
} else {