Commit Graph

2447 Commits

Author SHA1 Message Date
Sean Dewar
02e7431445
docs(fuzzy-match): cherry-pick latest changes
53f7fccc94
1b884a0053
4c295027a4
3ec3217f04
2022-02-07 17:39:50 +00:00
Sean Dewar
ce797e08f5
vim-patch:8.2.2813: cannot grep using fuzzy matching
Problem:    Cannot grep using fuzzy matching.
Solution:   Add the "f" flag to :vimgrep. (Yegappan Lakshmanan, closes vim/vim#8152)
bb01a1ef3a
2022-02-07 17:20:51 +00:00
Sean Dewar
715fbcbb8c
vim-patch:8.2.2280: fuzzy matching doesn't give access to the scores
Problem:    Fuzzy matching doesn't give access to the scores.
Solution:   Return the scores with a third list. (Yegappan Lakshmanan,
            closes vim/vim#7596)
9d19e4f4ba

Remove seemingly useless NULL checks.
assert that removing the li one wasn't dumb.
2022-02-07 17:20:51 +00:00
Sean Dewar
30deb14f39
vim-patch:8.2.1893: fuzzy matching does not support multiple words
Problem:    Fuzzy matching does not support multiple words.
Solution:   Add support for matching white space separated words. (Yegappan
            Lakshmanan, closes vim/vim#7163)
8ded5b647a
2022-02-07 17:20:50 +00:00
Sean Dewar
960ea01972
vim-patch:8.2.1726: fuzzy matching only works on strings
Problem:    Fuzzy matching only works on strings.
Solution:   Support passing a dict.  Add matchfuzzypos() to also get the match
            positions. (Yegappan Lakshmanan, closes vim/vim#6947)
4f73b8e9cc

Also remove some N/A and seemingly useless NULL checks -- Nvim allocs can't
return NULL. I'm not sure why the retmatchpos stuff in match_fuzzy checks for
NULL too, given that Vim checks for NULL alloc in do_fuzzymatch; assert that the
li stuff is not NULL as that's the one check I'm ever-so-slightly unsure about.

Adjust tests. Note that the text_cb tests actually throw E6000 in Nvim, but we
also can't assert that error due to v8.2.1183 not being ported yet.
2022-02-07 17:20:49 +00:00
Sean Dewar
fba00b5e7e
vim-patch:8.2.1665: cannot do fuzzy string matching
Problem:    Cannot do fuzzy string matching.
Solution:   Add matchfuzzy(). (Yegappan Lakshmanan, closes vim/vim#6932)
635414dd2f

Adjust Test_matchfuzzy's 2nd assert to expect the last error thrown, as
v8.2.1183 hasn't been ported yet (to be honest, the error message is kinda weird
if the 2nd argument is not convertible to string). We can still port this fully
as porting v8.2.1183 would require removing this change to pass CI.
2022-02-07 17:19:59 +00:00
zeertzjq
d457168e3b vim-patch:8.2.0208: fnamemodify() does not apply ":~" when followed by ":."
Problem:    Fnamemodify() does not apply ":~" when followed by ":.".
Solution:   Don't let a failing ":." cause the ":~" to be skipped. (Yasuhiro
            Matsumoto, closes vim/vim#5577)
d816cd94d8
2022-02-07 06:48:10 +08:00
zeertzjq
d65ee12914 vim-patch:8.2.1741: pathshorten() only supports using one character
Problem:    pathshorten() only supports using one character.
Solution:   Add an argument to control the length. (closes vim/vim#7006)
6a33ef0deb

Cherry-pick a line in test from patch 8.2.0634.
Use Nvim's config paths in docs.

shorten_dir() returning a pointer looks a bit confusing here, as it is
actually the same pointer passed to it, and it doesn't really reduce
much code, so change it back to void.

Assigning rettv->vval.v_string = NULL is not needed if a pointer is
within 64 bits. While this is usually the case, I'm not sure if it can
be taken for granted.
2022-02-06 16:29:12 +08:00
Sean Dewar
28d5face21
Merge pull request #16862 from seandewar/vim-8.2.2658
vim-patch:8.2.{2658,2661,2736}: for loop over strings
2022-02-06 00:02:30 +00:00
zeertzjq
be9dbc925c vim-patch:partial:6aa57295cfbe
Update runtime files
6aa57295cf
2022-02-06 04:46:16 +08:00
zeertzjq
46d1b8ed1f vim-patch:partial:2346a6378483
Update runtime files
2346a63784
2022-02-06 04:46:16 +08:00
zeertzjq
6ab71683d1 vim-patch:8.2.2324: not easy to get mark en cursor posotion by character count
Problem:    Not easy to get mark en cursor posotion by character count.
Solution:   Add functions that use character index. (Yegappan Lakshmanan,
            closes vim/vim#7648)
6f02b00bb0
2022-02-06 04:46:16 +08:00
zeertzjq
8ba9f19961 vim-patch:8.2.1727: a popup created with "cursorline" will ignore "firstline"
Problem:    A popup created with "cursorline" will ignore "firstline".
Solution:   When both "cursorline" and "firstline" are present put the cursor
            on "firstline". (closes vim/vim#7000)  Add the "winid" argument to
            getcurpos().
99ca9c4868

Skip popup window related code.
Cherry-pick all of Test_getcurpos_setpos() from patch 8.2.0610.
2022-02-06 04:46:16 +08:00
Sean Dewar
7002a3433b
vim-patch:8.2.2658: :for cannot loop over a string
Problem:    :for cannot loop over a string.
Solution:   Accept a string argument and iterate over its characters.
74e54fcb44

v8.2.2659 is already ported.

N/A patches for version.c:

vim-patch:8.2.2736: Vim9: for loop over string is a bit slow

Problem:    Vim9: for loop over string is a bit slow.
Solution:   Avoid using strlen().
175a41c13f
2022-02-05 19:55:11 +00:00
Sean Dewar
4f7a8991a9
vim-patch:8.2.0233: crash when using garbagecollect() in between rand()
Problem:    Crash when using garbagecollect() in between rand().
Solution:   Redesign the rand() and srand() implementation. (Yasuhiro
            Matsumoto, closes vim/vim#5587, closes vim/vim#5588)
4f645c54ef

Omit test_srand_seed.
Unmacroify SHUFFLE_XOSHIRO128STARSTAR and SPLITMIX32 while we're at it (leave
ROTL alone as it's fairly innocent).
2022-02-05 14:01:00 +00:00
Sean Dewar
c97614d98f
vim-patch:8.1.2356: rand() does not use the best algorithm
Problem:    rand() does not use the best algorithm.
Solution:   use xoshiro128** instead of xorshift. (Kaito Udagawa,
            closes vim/vim#5279)
f8c1f9200c
2022-02-05 14:00:59 +00:00
Sean Dewar
061b06a8ae
docs(rand): cherry-pick changes from rt update 0c0734d
0c0734d527
2022-02-05 14:00:59 +00:00
Sean Dewar
22f0725aac
vim-patch:8.1.2342: random number generator in Vim script is slow
Problem:    Random number generator in Vim script is slow.
Solution:   Add rand() and srand(). (Yasuhiro Matsumoto, closes vim/vim#1277)
06b0b4bc27

Add missing method call usage to builtin.txt.
vim_time and test_settime is N/A.
Add a modeline to test_random.vim.
Use typval_T* over listitem_T* vars so we don't need to use TV_LIST_ITEM_TV all
over the place...
Remove NULL list checks (tv_list_len covers this).
2022-02-05 13:16:34 +00:00
zeertzjq
9b0363d365 vim-patch:8.2.1128: the write message mentions characters, but it's bytes
Problem:    The write message mentions characters, but it's actually bytes.
Solution:   Change "C" to "B" and "characters" to "bytes".
3f40ce78f5
2022-02-04 22:17:25 +08:00
zeertzjq
6775a7d98f vim-patch:8.2.3797: no good reason to limit the message history in tiny version
Problem:    No good reason to limit the message history in the tiny version.
Solution:   Always use 200.
1e78deb077
2022-02-04 09:23:54 +08:00
zeertzjq
4c4a80950e docs: update feature-list
Add "linux", "sun".
Remove "+shellslash" as it should be passed to exists().
Sort alphabetically and consistently use Tabs for indent.
2022-02-04 09:23:54 +08:00
zeertzjq
f25ab39faa vim-patch:8.1.0846: not easy to recognize the system Vim runs on
Problem:    Not easy to recognize the system Vim runs on.
Solution:   Add more items to the features list. (Ozaki Kiichi, closes vim/vim#3855)
39536dd557

Some doc changes have already been applied. Some others are N/A.
"moon" was removed in patch 8.2.0427 so I did not add it.
2022-02-04 09:23:54 +08:00
zeertzjq
21cdecc8e0
Merge pull request #17245 from zeertzjq/vim-8.2.3219
vim-patch:8.2.3219: :find searches non-existing directories
2022-02-02 22:31:14 +08:00
zeertzjq
f4300985d3
Merge pull request #17113 from zeertzjq/vim-8.2.2569
feat(statusline): support multibyte fillchar
2022-02-01 17:57:01 +08:00
zeertzjq
7d72076a6f vim-patch:8.2.3219: :find searches non-existing directories
Problem:    :find searches non-existing directories.
Solution:   Check the path is not "..".  Update help. (Christian Brabandt,
            closes vim/vim#8612, closes vim/vim#8533)
7a4ca32175

Change STRNCAT to STRLCAT as clint doesn't like the former.

Include a typo fix from 2f0936cb9a (diff-7e9292cae1f2ba70dd5b17d2d162693a91044ada6ac99e9c3e8917f32878c097)
2022-02-01 17:08:40 +08:00
Christian Clason
bddce4b0ff
vim-patch:c4573eb12dba (#17258)
Update runtime files
c4573eb12d
2022-01-31 18:09:51 +01:00
Christian Clason
79b92da0d2
vim-patch:partial:f10911e5db16 (#17248)
Update runtime files
f10911e5db
2022-01-31 15:27:01 +01:00
Sean Dewar
f8f0f14db2
vim-patch:8.2.3433: :delcommand does not take a -buffer option
Problem:    :delcommand does not take a -buffer option.
Solution:   Add the -buffer option.
bdcba24d85
2022-01-30 22:25:08 +00:00
dundargoc
4a96e7809f
chore: typo fixes (#16921)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-01-29 23:15:22 +00:00
Daniel Steinberg
7b3cfee982 vim-patch:partial:04fb916
Update runtime files
04fb916684
2022-01-29 15:19:30 -05:00
Daniel Steinberg
a94632d212 vim-patch:8.2.3917: the eval.txt help file is way too big
Problem:    The eval.txt help file is way too big.
Solution:   Move the builtin function details to a separate file.
1cae5a0a03

Note: Neovim-specific references to |functions| were changed to
|builtin-functions|. This included updates to:
  1. test/functional/vimscript/functions_spec.lua
  2. test/functional/vimscript/eval_spec.lua
  3. runtime/doc/lua.txt
2022-01-29 15:19:29 -05:00
Björn Linse
baec0d3152 feat(provider)!: remove support for python2 and python3.[3-5]
These versions of python has reached End-of-life. getting rid
of python2 support removes a lot of logic to support two
incompatible python versions in the same version.
2022-01-29 19:49:37 +01:00
Daniel Steinberg
6dcdec8042
vim-patch:8.2.4052: not easy to resize a window from a plugin (#17028) 2022-01-29 20:37:07 +08:00
dundargoc
39d6db3899
docs(helphelp): remove extra backtick interference (#17201)
An extra backtick was explicitly written to show what a backtick looked
like, but it interferes with the syntax highlighting which thinks that
it's a part of a concealed group and couples it with the wrong backtick.
2022-01-27 14:56:18 +01:00
bfredl
9c4e617064
Merge pull request #17166 from Shougo/vim-8.2.4160
vim-patch:8.2.4160: cannot change the register used for Select mode d…
2022-01-27 08:52:08 +01:00
bfredl
480fbbe296
Merge pull request #17145 from zeertzjq/vim-8.2.0128
vim-patch:8.2.0128: cannot list options one per line
2022-01-27 08:37:36 +01:00
bfredl
d50dd12725
Merge pull request #17095 from zeertzjq/vim-8.2.3227
vim-patch:8.2.{3227,3280,4094}: global-local 'virtualedit'
2022-01-27 08:34:57 +01:00
bfredl
7e2ce35e3b
Merge pull request #17156 from zeertzjq/vim-8.2.3584
vim-patch:8.2.{3584,3586,3587}: :command "-keepscript" argument
2022-01-23 19:42:30 +01:00
Christian Clason
4ba7fa1700
vim-patch:6f4754b9f725 (#17179)
Update runtime files
6f4754b9f7
2022-01-23 18:38:41 +01:00
Shougo Matsushita
d7ab4e819a vim-patch:8.2.4160: cannot change the register used for Select mode delete
Problem:    Cannot change the register used for Select mode delete.
Solution:   Make CTRL-R set the register to be used when deleting text for
            Select mode. (Shougo Matsushita, closes vim/vim#9531)
4ede01f188
2022-01-22 11:57:06 +09:00
zeertzjq
8e84d1b930 vim-patch:8.2.3584: "verbose set efm" reports location of the :compiler command
Problem:    "verbose set efm" reports the location of the :compiler command.
            (Gary Johnson)
Solution:   Add the "-keepscript" argument to :command and use it when
            defining CompilerSet.
58ef8a31d7
2022-01-21 18:18:18 +08:00
zeertzjq
8300d337c8 refactor: remove the <xCSI> key
CSI typed directly is now just <CSI>. The <xCSI> key is obsolete.
2022-01-21 18:08:56 +08:00
zeertzjq
aa4eadd2be vim-patch:8.2.0128: cannot list options one per line
Problem:    Cannot list options one per line.
Solution:   Use ":set!" to list one option per line.
6b915c0c0e
2022-01-20 14:34:24 +08:00
Gregory Anders
de6f9233ee
refactor: source ftplugin.vim separately from filetype.vim (#17129)
This is a follow-on to #17040. The real benefit of #17040 was ensuring
that the ftplugin FileType autocommand was defined first and thus always
fired first. A side effect of the implementation in #17040 was that
setting variables that modified the state of filetype detection (such as
g:did_load_filetypes or g:do_filetype_lua) could no longer be set in the
user's init file. Filetype detection can also no longer be prevented
from loading by using `:filetype off`.

This PR addresses both of those side effects by unconditionally sourcing
ftplugin.vim and indent.vim before the user's init file (which ensures
that these autocommands run first) and sourcing filetype.vim *after* the
user's init file (thus allowing it to be blocked or modified).
2022-01-18 12:46:41 -07:00
Gregory Anders
fcf5dd34fd
refactor: enable filetype detection before user startup scripts (#17040) 2022-01-17 14:11:59 -07:00
marvim
2c94b75eac docs: regenerate [skip ci] 2022-01-17 18:28:23 +00:00
Christian Clason
3906b2d4fc
vim-patch:fd31be29b822 (#17114)
Update runtime files
fd31be29b8
2022-01-17 11:58:36 +01:00
zeertzjq
be15ac06ba feat(statusline): support multibyte fillchar
This includes a partial port of Vim patch 8.2.2569 and some changes to
nvim_eval_statusline() to allow a multibyte fillchar. Literally every
line of C code touched by that patch has been refactored in Nvim, and
that patch contains some irrelevant foldcolumn tests I'm not sure how to
port (as Nvim's foldcolumn behavior has diverged from Vim's).
2022-01-16 19:54:27 +08:00
zeertzjq
87e54f123a vim-patch:8.2.3280: 'virtualedit' local to buffer is not the best solution
Problem:    'virtualedit' local to buffer is not the best solution.
Solution:   Make it window-local. (Gary Johnson, closes vim/vim#8685)
51ad850f5f
2022-01-15 19:21:17 +08:00
zeertzjq
d391940b9a vim-patch:8.2.3227: 'virtualedit' can only be set globally
Problem:    'virtualedit' can only be set globally.
Solution:   Make 'virtualedit' global-local. (Gary Johnson, closes vim/vim#8638)
53ba05b090

I changed some macros to unsigned integer literals to avoid compiler warnings.
2022-01-15 19:21:17 +08:00