aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/quickfix.c
diff options
context:
space:
mode:
authorFamiu Haque <famiuhaque@proton.me>2024-11-23 14:22:06 +0600
committerGitHub <noreply@github.com>2024-11-23 08:22:06 +0000
commit8516c2dc1f301c439695629fff771227dbe00d30 (patch)
tree5e052ad234f99cdbfce89b03ba71796a8cd274ef /src/nvim/quickfix.c
parent9a681ad09e2add96d47bf3f39cca8029f3bf09df (diff)
downloadrneovim-8516c2dc1f301c439695629fff771227dbe00d30.tar.gz
rneovim-8516c2dc1f301c439695629fff771227dbe00d30.tar.bz2
rneovim-8516c2dc1f301c439695629fff771227dbe00d30.zip
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 <glephunter@gmail.com>
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r--src/nvim/quickfix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 6526b0d0bf..76c794b5a9 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -2697,7 +2697,7 @@ static void qf_goto_win_with_qfl_file(int qf_fnum)
// Didn't find it, go to the window before the quickfix
// window, unless 'switchbuf' contains 'uselast': in this case we
// try to jump to the previously used window first.
- if ((swb_flags & SWB_USELAST) && win_valid(prevwin)
+ if ((swb_flags & kOptSwbFlagUselast) && win_valid(prevwin)
&& !prevwin->w_p_wfb) {
win = prevwin;
} else if (altwin != NULL) {
@@ -2754,7 +2754,7 @@ static int qf_jump_to_usable_window(int qf_fnum, bool newwin, bool *opened_windo
// If no usable window is found and 'switchbuf' contains "usetab"
// then search in other tabs.
- if (!usable_win && (swb_flags & SWB_USETAB)) {
+ if (!usable_win && (swb_flags & kOptSwbFlagUsetab)) {
usable_win = qf_goto_tabwin_with_file(qf_fnum);
}
@@ -3032,7 +3032,7 @@ static int qf_jump_to_buffer(qf_info_T *qi, int qf_index, qfline_T *qf_ptr, int
qf_jump_goto_line(qf_ptr->qf_lnum, qf_ptr->qf_col, qf_ptr->qf_viscol, qf_ptr->qf_pattern);
- if ((fdo_flags & FDO_QUICKFIX) && openfold) {
+ if ((fdo_flags & kOptFdoFlagQuickfix) && openfold) {
foldOpenCursor();
}
if (print_message) {