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

33
src/nvim/cmdhist.h Normal file
View File

@@ -0,0 +1,33 @@
#ifndef NVIM_CMDHIST_H
#define NVIM_CMDHIST_H
#include "nvim/eval/typval.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/os/time.h"
/// Present history tables
typedef enum {
HIST_DEFAULT = -2, ///< Default (current) history.
HIST_INVALID = -1, ///< Unknown history.
HIST_CMD = 0, ///< Colon commands.
HIST_SEARCH, ///< Search commands.
HIST_EXPR, ///< Expressions (e.g. from entering = register).
HIST_INPUT, ///< input() lines.
HIST_DEBUG, ///< Debug commands.
} HistoryType;
/// Number of history tables
#define HIST_COUNT (HIST_DEBUG + 1)
/// History entry definition
typedef struct hist_entry {
int hisnum; ///< Entry identifier number.
char_u *hisstr; ///< Actual entry, separator char after the NUL.
Timestamp timestamp; ///< Time when entry was added.
list_T *additional_elements; ///< Additional entries from ShaDa file.
} histentry_T;
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "cmdhist.h.generated.h"
#endif
#endif // NVIM_CMDHIST_H