From 1b6442034f6a821d357fe59cd75fdae47a7f7cff Mon Sep 17 00:00:00 2001 From: luukvbaal Date: Wed, 20 Nov 2024 21:11:20 +0100 Subject: fix(messages): more ext_messages kinds #31279 Add kinds for various commands that output a list, the 'wildmode' list, and for number prompts. --- src/nvim/cmdexpand.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/cmdexpand.c') diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c index 700d554821..9b1193b4e0 100644 --- a/src/nvim/cmdexpand.c +++ b/src/nvim/cmdexpand.c @@ -1084,6 +1084,7 @@ int showmatches(expand_T *xp, bool wildmenu) ui_flush(); cmdline_row = msg_row; msg_didany = false; // lines_left will be set again + msg_ext_set_kind("wildlist"); msg_start(); // prepare for paging } -- cgit From 8516c2dc1f301c439695629fff771227dbe00d30 Mon Sep 17 00:00:00 2001 From: Famiu Haque Date: Sat, 23 Nov 2024 14:22:06 +0600 Subject: refactor(options): autogenerate valid values and flag enums for options (#31089) Problem: Option metadata like list of valid values for an option and option flags are not listed in the `options.lua` file and are instead manually defined in C, which means option metadata is split between several places. Solution: Put metadata such as list of valid values for an option and option flags in `options.lua`, and autogenerate the corresponding C variables and enums. Supersedes #28659 Co-authored-by: glepnir --- src/nvim/cmdexpand.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/nvim/cmdexpand.c') diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c index 9b1193b4e0..d977b20cc4 100644 --- a/src/nvim/cmdexpand.c +++ b/src/nvim/cmdexpand.c @@ -100,7 +100,7 @@ static int compl_selected; static bool cmdline_fuzzy_completion_supported(const expand_T *const xp) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE { - return (wop_flags & WOP_FUZZY) + return (wop_flags & kOptWopFlagFuzzy) && xp->xp_context != EXPAND_BOOL_SETTINGS && xp->xp_context != EXPAND_COLORS && xp->xp_context != EXPAND_COMPILER @@ -133,7 +133,7 @@ static bool cmdline_fuzzy_completion_supported(const expand_T *const xp) bool cmdline_fuzzy_complete(const char *const fuzzystr) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE { - return (wop_flags & WOP_FUZZY) && *fuzzystr != NUL; + return (wop_flags & kOptWopFlagFuzzy) && *fuzzystr != NUL; } /// Sort function for the completion matches. @@ -806,7 +806,7 @@ static char *find_longest_match(expand_T *xp, int options) } if (i < xp->xp_numfiles) { if (!(options & WILD_NO_BEEP)) { - vim_beep(BO_WILD); + vim_beep(kOptBoFlagWildmode); } break; } @@ -1069,7 +1069,7 @@ int showmatches(expand_T *xp, bool wildmenu) bool compl_use_pum = (ui_has(kUICmdline) ? ui_has(kUIPopupmenu) - : wildmenu && (wop_flags & WOP_PUM)) + : wildmenu && (wop_flags & kOptWopFlagPum)) || ui_has(kUIWildmenu); if (compl_use_pum) { @@ -1939,7 +1939,7 @@ static const char *set_context_by_cmdname(const char *cmd, cmdidx_T cmdidx, expa case CMD_tjump: case CMD_stjump: case CMD_ptjump: - if (wop_flags & WOP_TAGFILE) { + if (wop_flags & kOptWopFlagTagfile) { xp->xp_context = EXPAND_TAGS_LISTFILES; } else { xp->xp_context = EXPAND_TAGS; -- cgit From 889f9a0c5d1f3fe522af0d2b43a82317b0589b94 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 20 Dec 2024 08:04:46 +0800 Subject: vim-patch:9.1.0948: Missing cmdline completion for :pbuffer (#31645) Problem: Missing cmdline completion for :pbuffer. Solution: Add cmdline completion for :pbuffer like :buffer. (zeertzjq) fixes: vim/vim#16250 closes: vim/vim#16251 https://github.com/vim/vim/commit/3baf19a2b144b215c5b537c3c1b3b80a79b0fe99 --- src/nvim/cmdexpand.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/cmdexpand.c') diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c index d977b20cc4..80ff5e057d 100644 --- a/src/nvim/cmdexpand.c +++ b/src/nvim/cmdexpand.c @@ -2001,6 +2001,7 @@ static const char *set_context_by_cmdname(const char *cmd, cmdidx_T cmdidx, expa FALLTHROUGH; case CMD_buffer: case CMD_sbuffer: + case CMD_pbuffer: case CMD_checktime: xp->xp_context = EXPAND_BUFFERS; xp->xp_pattern = (char *)arg; -- cgit From 2a7d0ed6145bf3f8b139c2694563f460f829813a Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 23 Dec 2024 05:43:52 -0800 Subject: refactor: iwyu #31637 Result of `make iwyu` (after some "fixups"). --- src/nvim/cmdexpand.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/nvim/cmdexpand.c') diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c index 80ff5e057d..3a9eeb73c8 100644 --- a/src/nvim/cmdexpand.c +++ b/src/nvim/cmdexpand.c @@ -42,7 +42,6 @@ #include "nvim/highlight_defs.h" #include "nvim/highlight_group.h" #include "nvim/keycodes.h" -#include "nvim/log.h" #include "nvim/lua/executor.h" #include "nvim/macros_defs.h" #include "nvim/mapping.h" -- cgit