mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 10:45:16 -07:00
refactor(IWYU): fix includes for cmdhist.h (#26324)
This commit is contained in:
parent
884a83049b
commit
a6f26c86cb
8
Makefile
8
Makefile
@ -152,11 +152,8 @@ iwyu: build/.ran-cmake
|
||||
|src/nvim/channel.h\
|
||||
|src/nvim/charset.h\
|
||||
|src/nvim/cmdexpand.h\
|
||||
|src/nvim/cmdhist.h\
|
||||
|src/nvim/decoration.h\
|
||||
|src/nvim/diff.h\
|
||||
|src/nvim/drawline.h\
|
||||
|src/nvim/drawscreen.h\
|
||||
|src/nvim/eval.h\
|
||||
|src/nvim/eval/encode.h\
|
||||
|src/nvim/eval/typval.h\
|
||||
@ -174,7 +171,6 @@ iwyu: build/.ran-cmake
|
||||
|src/nvim/event/time.h\
|
||||
|src/nvim/event/wstream.h\
|
||||
|src/nvim/extmark.h\
|
||||
|src/nvim/fold.h\
|
||||
|src/nvim/garray.h\
|
||||
|src/nvim/getchar.h\
|
||||
|src/nvim/globals.h\
|
||||
@ -183,7 +179,6 @@ iwyu: build/.ran-cmake
|
||||
|src/nvim/highlight_group.h\
|
||||
|src/nvim/input.h\
|
||||
|src/nvim/keycodes.h\
|
||||
|src/nvim/log.h\
|
||||
|src/nvim/lua/executor.h\
|
||||
|src/nvim/main.h\
|
||||
|src/nvim/mark.h\
|
||||
@ -197,14 +192,11 @@ iwyu: build/.ran-cmake
|
||||
|src/nvim/os/pty_conpty_win.h\
|
||||
|src/nvim/os/pty_process_unix.h\
|
||||
|src/nvim/os/pty_process_win.h\
|
||||
|src/nvim/path.h\
|
||||
|src/nvim/plines.h\
|
||||
|src/nvim/popupmenu.h\
|
||||
|src/nvim/tui/input.h\
|
||||
|src/nvim/ui.h\
|
||||
|src/nvim/viml/parser/expressions.h\
|
||||
|src/nvim/viml/parser/parser.h\
|
||||
|src/nvim/window.h\
|
||||
)" --nosafe_headers < build/iwyu.log
|
||||
cmake -B build -U ENABLE_IWYU
|
||||
cmake --build build
|
||||
|
@ -910,11 +910,8 @@ def CheckIncludes(filename, lines, error):
|
||||
"src/nvim/channel.h",
|
||||
"src/nvim/charset.h",
|
||||
"src/nvim/cmdexpand.h",
|
||||
"src/nvim/cmdhist.h",
|
||||
"src/nvim/decoration.h",
|
||||
"src/nvim/diff.h",
|
||||
"src/nvim/drawline.h",
|
||||
"src/nvim/drawscreen.h",
|
||||
"src/nvim/eval.h",
|
||||
"src/nvim/eval/encode.h",
|
||||
"src/nvim/eval/typval.h",
|
||||
@ -932,7 +929,6 @@ def CheckIncludes(filename, lines, error):
|
||||
"src/nvim/event/time.h",
|
||||
"src/nvim/event/wstream.h",
|
||||
"src/nvim/extmark.h",
|
||||
"src/nvim/fold.h",
|
||||
"src/nvim/garray.h",
|
||||
"src/nvim/getchar.h",
|
||||
"src/nvim/globals.h",
|
||||
@ -941,7 +937,6 @@ def CheckIncludes(filename, lines, error):
|
||||
"src/nvim/highlight_group.h",
|
||||
"src/nvim/input.h",
|
||||
"src/nvim/keycodes.h",
|
||||
"src/nvim/log.h",
|
||||
"src/nvim/lua/executor.h",
|
||||
"src/nvim/main.h",
|
||||
"src/nvim/mark.h",
|
||||
@ -955,14 +950,11 @@ def CheckIncludes(filename, lines, error):
|
||||
"src/nvim/os/pty_conpty_win.h",
|
||||
"src/nvim/os/pty_process_unix.h",
|
||||
"src/nvim/os/pty_process_win.h",
|
||||
"src/nvim/path.h",
|
||||
"src/nvim/plines.h",
|
||||
"src/nvim/popupmenu.h",
|
||||
"src/nvim/tui/input.h",
|
||||
"src/nvim/ui.h",
|
||||
"src/nvim/viml/parser/expressions.h",
|
||||
"src/nvim/viml/parser/parser.h",
|
||||
"src/nvim/window.h",
|
||||
]
|
||||
|
||||
skip_headers = [
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "nvim/memory.h"
|
||||
#include "nvim/message.h"
|
||||
#include "nvim/option_vars.h"
|
||||
#include "nvim/os/time.h"
|
||||
#include "nvim/regexp.h"
|
||||
#include "nvim/strings.h"
|
||||
#include "nvim/types_defs.h"
|
||||
|
@ -1,10 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "nvim/cmdexpand_defs.h" // IWYU pragma: export
|
||||
#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/eval/typval_defs.h"
|
||||
#include "nvim/ex_cmds_defs.h" // IWYU pragma: export
|
||||
#include "nvim/os/time.h"
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/os/time_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
/// Present history tables
|
||||
typedef enum {
|
||||
@ -17,8 +17,7 @@ typedef enum {
|
||||
HIST_DEBUG, ///< Debug commands.
|
||||
} HistoryType;
|
||||
|
||||
/// Number of history tables
|
||||
#define HIST_COUNT (HIST_DEBUG + 1)
|
||||
enum { HIST_COUNT = HIST_DEBUG + 1, }; ///< Number of history tables
|
||||
|
||||
/// History entry definition
|
||||
typedef struct hist_entry {
|
||||
|
@ -2,16 +2,17 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "nvim/ex_cmds_defs.h"
|
||||
#include "nvim/buffer_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/macros_defs.h"
|
||||
#include "nvim/pos_defs.h"
|
||||
#include "nvim/pos_defs.h" // IWYU pragma: keep
|
||||
|
||||
// Value set from 'diffopt'.
|
||||
EXTERN int diff_context INIT( = 6); // context for folds
|
||||
EXTERN int diff_foldcolumn INIT( = 2); // 'foldcolumn' for diff mode
|
||||
EXTERN int diff_context INIT( = 6); ///< context for folds
|
||||
EXTERN int diff_foldcolumn INIT( = 2); ///< 'foldcolumn' for diff mode
|
||||
EXTERN bool diff_need_scrollbind INIT( = false);
|
||||
|
||||
EXTERN bool need_diff_redraw INIT( = false); // need to call diff_redraw()
|
||||
EXTERN bool need_diff_redraw INIT( = false); ///< need to call diff_redraw()
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "diff.h.generated.h"
|
||||
|
@ -3,7 +3,6 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "nvim/buffer_defs.h"
|
||||
#include "nvim/drawline.h"
|
||||
#include "nvim/macros_defs.h"
|
||||
|
||||
/// flags for update_screen()
|
||||
@ -22,7 +21,7 @@ enum {
|
||||
/// ('lines' and 'rows') must not be changed.
|
||||
EXTERN bool updating_screen INIT( = 0);
|
||||
|
||||
EXTERN match_T screen_search_hl INIT( = { 0 }); // used for 'hlsearch' highlight matching
|
||||
EXTERN match_T screen_search_hl INIT( = { 0 }); ///< used for 'hlsearch' highlight matching
|
||||
|
||||
#define W_ENDCOL(wp) ((wp)->w_wincol + (wp)->w_width)
|
||||
#define W_ENDROW(wp) ((wp)->w_winrow + (wp)->w_height)
|
||||
|
@ -4548,7 +4548,7 @@ bool garbage_collect(bool testing)
|
||||
|
||||
// history items (ShaDa additional elements)
|
||||
if (p_hi) {
|
||||
for (HistoryType i = 0; i < HIST_COUNT; i++) {
|
||||
for (int i = 0; i < HIST_COUNT; i++) {
|
||||
const void *iter = NULL;
|
||||
do {
|
||||
histentry_T hist;
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "nvim/change.h"
|
||||
#include "nvim/channel.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cmdexpand_defs.h"
|
||||
#include "nvim/cmdhist.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/decoration.h"
|
||||
|
@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdio.h> // IWYU pragma: keep
|
||||
|
||||
#include "nvim/buffer_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/fold_defs.h" // IWYU pragma: export
|
||||
#include "nvim/garray_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/macros_defs.h"
|
||||
#include "nvim/pos_defs.h"
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/pos_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
EXTERN int disable_fold_update INIT( = 0);
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "klib/kvec.h"
|
||||
#include "nvim/ascii_defs.h"
|
||||
#include "nvim/autocmd.h"
|
||||
#include "nvim/buffer.h"
|
||||
|
@ -45,9 +45,11 @@
|
||||
# define LOG_CALLSTACK_TO_FILE(fp) log_callstack_to_file(fp, __func__, __LINE__)
|
||||
#endif
|
||||
|
||||
#if NVIM_HAS_INCLUDE("sanitizer/asan_interface.h")
|
||||
# include "sanitizer/asan_interface.h"
|
||||
// uncrustify:off
|
||||
#if NVIM_HAS_INCLUDE(<sanitizer/asan_interface.h>)
|
||||
# include <sanitizer/asan_interface.h> // IWYU pragma: keep
|
||||
#endif
|
||||
// uncrustify:on
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "log.h.generated.h"
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "nvim/decoration.h"
|
||||
#include "nvim/decoration_provider.h"
|
||||
#include "nvim/diff.h"
|
||||
#include "nvim/drawline.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/eval/typval.h"
|
||||
|
@ -15,9 +15,7 @@
|
||||
#include "nvim/ex_docmd.h"
|
||||
#include "nvim/file_search.h"
|
||||
#include "nvim/fileio.h"
|
||||
#include "nvim/func_attr.h"
|
||||
#include "nvim/garray.h"
|
||||
#include "nvim/garray_defs.h"
|
||||
#include "nvim/gettext.h"
|
||||
#include "nvim/globals.h"
|
||||
#include "nvim/macros_defs.h"
|
||||
|
@ -2,32 +2,33 @@
|
||||
|
||||
#include <stddef.h> // IWYU pragma: keep
|
||||
|
||||
#include "nvim/func_attr.h"
|
||||
#include "nvim/garray_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
// Flags for expand_wildcards()
|
||||
#define EW_DIR 0x01 // include directory names
|
||||
#define EW_FILE 0x02 // include file names
|
||||
#define EW_NOTFOUND 0x04 // include not found names
|
||||
#define EW_ADDSLASH 0x08 // append slash to directory name
|
||||
#define EW_KEEPALL 0x10 // keep all matches
|
||||
#define EW_SILENT 0x20 // don't print "1 returned" from shell
|
||||
#define EW_EXEC 0x40 // executable files
|
||||
#define EW_PATH 0x80 // search in 'path' too
|
||||
#define EW_ICASE 0x100 // ignore case
|
||||
#define EW_NOERROR 0x200 // no error for bad regexp
|
||||
#define EW_NOTWILD 0x400 // add match with literal name if exists
|
||||
#define EW_KEEPDOLLAR 0x800 // do not escape $, $var is expanded
|
||||
/// Flags for expand_wildcards()
|
||||
enum {
|
||||
EW_DIR = 0x01, ///< include directory names
|
||||
EW_FILE = 0x02, ///< include file names
|
||||
EW_NOTFOUND = 0x04, ///< include not found names
|
||||
EW_ADDSLASH = 0x08, ///< append slash to directory name
|
||||
EW_KEEPALL = 0x10, ///< keep all matches
|
||||
EW_SILENT = 0x20, ///< don't print "1 returned" from shell
|
||||
EW_EXEC = 0x40, ///< executable files
|
||||
EW_PATH = 0x80, ///< search in 'path' too
|
||||
EW_ICASE = 0x100, ///< ignore case
|
||||
EW_NOERROR = 0x200, ///< no error for bad regexp
|
||||
EW_NOTWILD = 0x400, ///< add match with literal name if exists
|
||||
EW_KEEPDOLLAR = 0x800, ///< do not escape $, $var is expanded
|
||||
EW_ALLLINKS = 0x1000, ///< also links not pointing to existing file
|
||||
EW_SHELLCMD = 0x2000, ///< called from expand_shellcmd(), don't check
|
||||
///< if executable is in $PATH
|
||||
EW_DODOT = 0x4000, ///< also files starting with a dot
|
||||
EW_EMPTYOK = 0x8000, ///< no matches is not an error
|
||||
EW_NOTENV = 0x10000, ///< do not expand environment variables
|
||||
EW_NOBREAK = 0x20000, ///< do not invoke breakcheck
|
||||
};
|
||||
// Note: mostly EW_NOTFOUND and EW_SILENT are mutually exclusive: EW_NOTFOUND
|
||||
// is used when executing commands and EW_SILENT for interactive expanding.
|
||||
#define EW_ALLLINKS 0x1000 // also links not pointing to existing file
|
||||
#define EW_SHELLCMD 0x2000 // called from expand_shellcmd(), don't check
|
||||
// if executable is in $PATH
|
||||
#define EW_DODOT 0x4000 // also files starting with a dot
|
||||
#define EW_EMPTYOK 0x8000 // no matches is not an error
|
||||
#define EW_NOTENV 0x10000 // do not expand environment variables
|
||||
#define EW_NOBREAK 0x20000 // do not invoke breakcheck
|
||||
|
||||
/// Return value for the comparison of two files. Also @see path_full_compare.
|
||||
typedef enum file_comparison {
|
||||
|
@ -1117,7 +1117,7 @@ static void shada_read(ShaDaReadDef *const sd_reader, const int flags)
|
||||
}
|
||||
HistoryMergerState hms[HIST_COUNT];
|
||||
if (srni_flags & kSDReadHistory) {
|
||||
for (HistoryType i = 0; i < HIST_COUNT; i++) {
|
||||
for (int i = 0; i < HIST_COUNT; i++) {
|
||||
hms_init(&hms[i], (uint8_t)i, (size_t)p_hi, true, true);
|
||||
}
|
||||
}
|
||||
@ -1381,7 +1381,7 @@ shada_read_main_cycle_end:
|
||||
// memory for the history string itself and separator character which
|
||||
// may be assigned right away.
|
||||
if (srni_flags & kSDReadHistory) {
|
||||
for (HistoryType i = 0; i < HIST_COUNT; i++) {
|
||||
for (int i = 0; i < HIST_COUNT; i++) {
|
||||
hms_insert_whole_neovim_history(&hms[i]);
|
||||
clr_history(i);
|
||||
int *new_hisidx;
|
||||
@ -2499,7 +2499,7 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer, ShaDaReadDef
|
||||
bool dump_history = false;
|
||||
|
||||
// Initialize history merger
|
||||
for (HistoryType i = 0; i < HIST_COUNT; i++) {
|
||||
for (int i = 0; i < HIST_COUNT; i++) {
|
||||
int num_saved = get_shada_parameter(hist_type2char(i));
|
||||
if (num_saved == -1) {
|
||||
num_saved = (int)p_hi;
|
||||
@ -2893,7 +2893,7 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer, ShaDaReadDef
|
||||
#undef PACK_WMS_ARRAY
|
||||
|
||||
if (dump_history) {
|
||||
for (size_t i = 0; i < HIST_COUNT; i++) {
|
||||
for (int i = 0; i < HIST_COUNT; i++) {
|
||||
if (dump_one_history[i]) {
|
||||
hms_insert_whole_neovim_history(&wms->hms[i]);
|
||||
HMS_ITER(&wms->hms[i], cur_entry, {
|
||||
@ -2913,7 +2913,7 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer, ShaDaReadDef
|
||||
}
|
||||
|
||||
shada_write_exit:
|
||||
for (size_t i = 0; i < HIST_COUNT; i++) {
|
||||
for (int i = 0; i < HIST_COUNT; i++) {
|
||||
if (dump_one_history[i]) {
|
||||
hms_dealloc(&wms->hms[i]);
|
||||
}
|
||||
|
@ -705,6 +705,7 @@ static void handle_raw_buffer(TermInput *input, bool force)
|
||||
const size_t bufsize = termkey_get_buffer_size(input->tk);
|
||||
const bool success = termkey_set_buffer_size(input->tk, MAX(bufsize + delta, bufsize * 2));
|
||||
assert(success);
|
||||
(void)success;
|
||||
}
|
||||
|
||||
size_t consumed = termkey_push_bytes(input->tk, ptr, size);
|
||||
@ -731,6 +732,7 @@ static void handle_raw_buffer(TermInput *input, bool force)
|
||||
// shrink it back down to its original size.
|
||||
const bool success = termkey_set_buffer_size(input->tk, INPUT_BUFFER_SIZE);
|
||||
assert(success);
|
||||
(void)success;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user