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

@@ -16,11 +16,12 @@
#include "nvim/ascii.h"
#include "nvim/buffer.h"
#include "nvim/buffer_defs.h"
#include "nvim/cmdhist.h"
#include "nvim/eval/decode.h"
#include "nvim/eval/encode.h"
#include "nvim/eval/typval.h"
#include "nvim/ex_cmds.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_getln.h"
#include "nvim/fileio.h"
#include "nvim/garray.h"
#include "nvim/globals.h"
@@ -2451,6 +2452,27 @@ static inline void find_removable_bufs(khash_t(bufset) *removable_bufs)
}
}
/// Translate a history type number to the associated character
static int hist_type2char(const int type)
FUNC_ATTR_CONST
{
switch (type) {
case HIST_CMD:
return ':';
case HIST_SEARCH:
return '/';
case HIST_EXPR:
return '=';
case HIST_INPUT:
return '@';
case HIST_DEBUG:
return '>';
default:
abort();
}
return NUL;
}
/// Write ShaDa file
///
/// @param[in] sd_writer Structure containing file writer definition.