Patch 8.2.2452
Problem: No completion for the 'filetype' option.
Solution: Add filetype completion. (Martin Tournoij, closes #7747)
Files: src/option.c, src/optiondefs.h, src/testdir/test_options.vim
*** ../vim-8.2.2451/src/option.c 2021-01-04 12:41:49.507891351 +0100
--- src/option.c 2021-02-02 20:55:27.373613749 +0100
***************
*** 2419,2424 ****
--- 2419,2426 ----
/*
* 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 "curwin" is set to the window from which
+ * the option is used.
*/
static long_u *
insecure_flag(int opt_idx, int opt_flags)
***************
*** 6209,6214 ****
--- 6211,6220 ----
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;
*** ../vim-8.2.2451/src/optiondefs.h 2021-01-14 17:35:17.283416578 +0100
--- src/optiondefs.h 2021-02-02 20:53:56.457876465 +0100
***************
*** 946,952 ****
(char_u *)FALSE,
#endif
(char_u *)0L} SCTX_INIT},
! {"filetype", "ft", P_STRING|P_ALLOCED|P_VI_DEF|P_NOGLOB|P_NFNAME,
(char_u *)&p_ft, PV_FT,
{(char_u *)"", (char_u *)0L}
SCTX_INIT},
--- 946,952 ----
(char_u *)FALSE,
#endif
(char_u *)0L} SCTX_INIT},
! {"filetype", "ft",
P_STRING|P_EXPAND|P_ALLOCED|P_VI_DEF|P_NOGLOB|P_NFNAME,
(char_u *)&p_ft, PV_FT,
{(char_u *)"", (char_u *)0L}
SCTX_INIT},
*** ../vim-8.2.2451/src/testdir/test_options.vim 2021-02-01
18:39:43.327401074 +0100
--- src/testdir/test_options.vim 2021-02-02 20:53:56.457876465 +0100
***************
*** 332,337 ****
--- 332,343 ----
call feedkeys(":set key=\<Tab>\<C-B>\"\<CR>", 'xt')
call assert_equal('"set key=*****', @:)
set key=
+
+ " Expand values for 'filetype'
+ call feedkeys(":set filetype=sshdconfi\<Tab>\<C-B>\"\<CR>", 'xt')
+ call assert_equal('"set filetype=sshdconfig', @:)
+ call feedkeys(":set filetype=a\<C-A>\<C-B>\"\<CR>", 'xt')
+ call assert_equal('"set filetype=' .. getcompletion('a*',
'filetype')->join(), @:)
endfunc
func Test_set_errors()
*** ../vim-8.2.2451/src/version.c 2021-02-01 20:50:33.810374133 +0100
--- src/version.c 2021-02-02 20:55:07.761670750 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2452,
/**/
--
GALAHAD hurries to the door and pushes through it. As he leaves the room
we CUT TO the reverse to show that he is now in a room full of bathing
and romping GIRLIES, all innocent, wide-eyed and beautiful. They smile
enchantingly at him as he tries to keep walking without being diverted by
the lovely sights assaulting his eyeballs.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202102022010.112KAg4j1584848%40masaka.moolenaar.net.