diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-03-12 18:38:12 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-03-12 21:42:09 -0500 |
commit | b650d2d8d90a371d73a25be2d46dd3c8c0d935ab (patch) | |
tree | 8ef67fe37151b215cbc0b3674e1dc8320c47831a /src/nvim/option.c | |
parent | ea99cbc85ad937c79603461f8de046d744aa8dc3 (diff) | |
download | rneovim-b650d2d8d90a371d73a25be2d46dd3c8c0d935ab.tar.gz rneovim-b650d2d8d90a371d73a25be2d46dd3c8c0d935ab.tar.bz2 rneovim-b650d2d8d90a371d73a25be2d46dd3c8c0d935ab.zip |
vim-patch:8.2.2452: no completion for the 'filetype' option
Problem: No completion for the 'filetype' option.
Solution: Add filetype completion. (Martin Tournoij, closes vim/vim#7747)
https://github.com/vim/vim/commit/d5e8c92816f35ea1a9298084238a08f35958baa6
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index ac25c86b5f..dbd8ceb55c 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -2086,9 +2086,12 @@ int was_set_insecurely(win_T *const wp, char_u *opt, int opt_flags) /// Get a pointer to the flags used for the P_INSECURE flag of option /// "opt_idx". For some local options a local flags field is used. +/// NOTE: Caller must make sure that "wp" is set to the window from which +/// the option is used. static uint32_t *insecure_flag(win_T *const wp, int opt_idx, int opt_flags) { - if (opt_flags & OPT_LOCAL) + if (opt_flags & OPT_LOCAL) { + assert(wp != NULL); switch ((int)options[opt_idx].indir) { case PV_STL: return &wp->w_p_stl_flags; case PV_FDE: return &wp->w_p_fde_flags; @@ -2097,6 +2100,7 @@ static uint32_t *insecure_flag(win_T *const wp, int opt_idx, int opt_flags) case PV_FEX: return &wp->w_buffer->b_p_fex_flags; case PV_INEX: return &wp->w_buffer->b_p_inex_flags; } + } // Nothing special, return global flags field. return &options[opt_idx].flags; @@ -6178,6 +6182,8 @@ set_context_in_set_cmd( xp->xp_backslash = XP_BS_THREE; else xp->xp_backslash = XP_BS_ONE; + } else if (p == (char_u *)&p_ft) { + xp->xp_context = EXPAND_FILETYPE; } else { xp->xp_context = EXPAND_FILES; // for 'tags' need three backslashes for a space |