Commit Graph

127 Commits

Author SHA1 Message Date
zeertzjq
46a7c1b319
vim-patch:partial:9.1.0027: Vim is missing a foreach() func (#27037)
Problem:  Vim is missing a foreach() func
Solution: Implement foreach({expr1}, {expr2}) function,
          which applies {expr2} for each item in {expr1}
          without changing it (Ernie Rael)

closes: vim/vim#12166

e79e207760

Partial port as this doesn't handle non-materialized range() lists.

vim-patch:c92b8bed1fa6

runtime(help): delete duplicate help tag E741 (vim/vim#13861)

c92b8bed1f

Co-authored-by: Ernie Rael <errael@raelity.com>
2024-01-16 11:30:35 +08:00
zeertzjq
73e1942abe
vim-patch:9.1.0009: Cannot easily get the list of matches (#27028)
Problem:  Cannot easily get the list of matches
Solution: Add the matchstrlist() and matchbufline() Vim script
          functions (Yegappan Lakshmanan)

closes: vim/vim#13766

Omit CHECK_LIST_MATERIALIZE(): it populates a List with numbers only,
and there is a check for strings below.

f93b1c881a

vim-patch:eb3475df0d92

runtime(doc): Replace non-breaking space with normal space (vim/vim#13868)

eb3475df0d

Co-authored-by: Yegappan Lakshmanan <4298407+yegappan@users.noreply.github.com>
2024-01-16 08:00:08 +08:00
zeertzjq
d4dbfb092b vim-patch:8.2.4825: can only get a list of mappings
Problem:    Can only get a list of mappings.
Solution:   Add the optional {abbr} argument. (Ernie Rael, closes vim/vim#10277)
            Rename to maplist().  Rename test file.

09661203ec

Co-authored-by: Ernie Rael <errael@raelity.com>
2023-11-09 21:34:04 +08:00
zeertzjq
2dfcd5a22b vim-patch:8.2.4820: not simple programmatic way to find a specific mapping
Problem:    Not simple programmatic way to find a specific mapping.
Solution:   Add getmappings(). (Ernie Rael, closes vim/vim#10273)

659c240cf7

Co-authored-by: Ernie Rael <errael@raelity.com>
2023-11-09 21:34:04 +08:00
zeertzjq
4c7df98e4e vim-patch:9.0.1515: reverse() does not work for a String
Problem:    reverse() does not work for a String.
Solution:   Implement reverse() for a String. (Yegappan Lakshmanan,
            closes vim/vim#12179)

03ff1c2dde

vim-patch:9.0.1738: Duplicate code to reverse a string

Problem:  Duplicate code to reverse a string
Solution: Move reverse_text() to strings.c and remove string_reverse().

closes: vim/vim#12847

4dd266cb66

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-19 18:05:46 +08:00
zeertzjq
8cbb2477cf vim-patch:8.2.1969: Vim9: map() may change the list or dict item type
Problem:    Vim9: map() may change the list or dict item type.
Solution:   Add mapnew().

ea696852e7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 11:21:10 +08:00
zeertzjq
6e0c36ba0e
vim-patch:9.0.1686: undotree() only works for the current buffer (#24665)
Problem:    undotree() only works for the current buffer
Solution:   Add an optional "buffer number" parameter to undotree().  If
            omitted, use the current buffer for backwards compatibility.

closes: vim/vim#4001
closes: vim/vim#12292

5fee111149

Co-authored-by: Devin J. Pohly <djpohly@gmail.com>
2023-08-12 05:51:49 +08:00
Lewis Russell
42333ea98d
feat(docs): generate builtin.txt (#24493)
- eval.lua is now the source of truth.

- Formatting is much more consistent.

- Fixed Lua type generation for polymorphic functions (get(), etc).

- Removed "Overview" section from builtin.txt
  - Can generate this if we really want it.

- Moved functions from sign.txt and testing.txt into builtin.txt.

- Removed the *timer* *timers* tags since libuv timers via vim.uv should be preferred.

- Removed the temp-file-name tag from tempname()

- Moved lueval() from lua.txt to builtin.txt.

* Fix indent

* fixup!

* fixup! fixup!

* fixup! better tag formatting

* fixup: revert changes no longer needed

* fixup! CI

---------

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-07-28 14:48:41 +01:00
ii14
aaa151d506
docs: remove trailing spaces #24455 2023-07-25 05:07:13 -07:00
Justin M. Keyes
ab65a98adb
fix(docs): ignore_invalid #24174
Regex bug in scripts/gen_help_html.lua:ignore_invalid()
2023-06-27 10:21:27 -07:00
zeertzjq
b441dafdf5 vim-patch:8.2.2344: using inclusive index for slice is not always desired
Problem:    Using inclusive index for slice is not always desired.
Solution:   Add the slice() method, which has an exclusive index. (closes
            vim/vim#7408)

6601b62943

Cherry-pick a line in docs added later.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 17:40:29 +08:00
zeertzjq
191e8b4062
vim-patch:9.0.1485: no functions for converting from/to UTF-16 index (#23318)
Problem:    no functions for converting from/to UTF-16 index.
Solution:   Add UTF-16 flag to existing funtions and add strutf16len() and
            utf16idx(). (Yegappan Lakshmanan, closes vim/vim#12216)

67672ef097

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-26 09:50:37 +08:00
zeertzjq
85c61d6716 vim-patch:9.0.1007: there is no way to get a list of swap file names
Problem:    There is no way to get a list of swap file names.
Solution:   Add the swapfilelist() function.  Use it in the test script to
            clean up.  Remove deleting individual swap files.

c216a7a21a

vim-patch:9.0.1005: a failed test may leave a swap file behind

Problem:    A failed test may leave a swap file behind.
Solution:   Delete the swap file to avoid another test to fail.  Use another
            file name.

d0f8d39d20

Cherry-pick test_window_cmd.vim changes from patch 8.2.1593.
Remove FUNC_ATTR_UNUSED from eval functions as fptr is always unused.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-19 11:29:35 +08:00
Michal Liszcz
674e23f19c
vim-patch:9.0.0244: cannot easily get the list of sourced scripts (#22596)
Problem:    Cannot easily get the list of sourced scripts.
Solution:   Add the getscriptinfo() function. (Yegappan Lakshmanan,
            closes vim/vim#10957)

f768c3d19c

Cherry-pick usr_41.txt change from a later runtime update.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-03-11 11:22:22 +08:00
zeertzjq
f6b9791212 vim-patch:8.2.3438: cannot manipulate blobs
Problem:    Cannot manipulate blobs.
Solution:   Add blob2list() and list2blob(). (Yegappan Lakshmanan,
            closes vim/vim#8868)

5dfe467432

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-02-28 20:46:06 +08:00
zeertzjq
2c9fbe34b2
vim-patch:8.2.2336: Vim9: not possible to extend dictionary with different type (#22425)
Problem:    Vim9: it is not possible to extend a dictionary with different
            item types.
Solution:   Add extendnew(). (closes vim/vim#7666)

b0e6b51364

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-27 10:10:42 +08:00
zeertzjq
0972d7a124 vim-patch:9.0.0196: finding value in list may require a for loop
Problem:    Finding value in list may require a for loop.
Solution:   Add indexof(). (Yegappan Lakshmanan, closes vim/vim#10903)

b218655d5a

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-02-27 07:34:59 +08:00
zeertzjq
904d099583 vim-patch:8.2.2449: Vim9: flatten() always changes the list type
Problem:    Vim9: flatten() always changes the list type.
Solution:   Disallow using flatten() and add flattennew().

3b69006973

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-24 15:36:08 +08:00
zeertzjq
f4e03cbdbc
vim-patch:9.0.1212: cannot read back what setcellwidths() has done (#21867)
Problem:    Cannot read back what setcellwidths() has done.
Solution:   Add getcellwidths(). (Kota Kato, closes vim/vim#11837)

66bb9ae70f

Co-authored-by: Kota Kato <github@kat0h.com>
2023-01-18 06:50:22 +08:00
zeertzjq
9b76875235 vim-patch:9.0.0916: getbufline() is inefficient for getting a single line
Problem:    getbufline() is inefficient for getting a single line.
Solution:   Add getbufoneline().

ce30ccc06a

Cherry-pick part of usr_41.txt from patch 8.1.1628.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-22 07:21:26 +08:00
zeertzjq
781616bee5 vim-patch:8.2.2606: strchars() defaults to counting composing characters
Problem:    strchars() defaults to counting composing characters.
Solution:   Add strcharlen() which ignores composing characters.

70ce8a1561

Use docs from latest Vim instead.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05 18:06:00 +08:00
zeertzjq
c46d46e9f1
vim-patch:8.2.2343: Vim9: return type of readfile() is any (#20896)
Problem:    Vim9: return type of readfile() is any.
Solution:   Add readblob() so that readfile() can be expected to always
            return a list of strings. (closes vim/vim#7671)

c423ad77ed

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-01 20:21:48 +08:00
zeertzjq
5568267ccb vim-patch:8.2.1544: cannot translate messages in a Vim script
Problem:    Cannot translate messages in a Vim script.
Solution:   Add gettext().  Try it out for a few messages in the options
            window.

0b39c3fd4c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-28 08:03:31 +08:00
Justin M. Keyes
e5cb3104d0
docs: fix/remove invalid URLs #20647 2022-10-14 08:01:13 -07:00
Lewis Russell
288208257c feat(cscope)!: remove 2022-10-13 16:37:23 +01:00
Justin M. Keyes
f7b175e049
fix(docs-html): keycodes, taglinks, column_heading #20498
Problem:
- Docs HTML: "foo ~" headings (column_heading) are not aligned with
  their table columns/contents because the leading whitespace is not
  emitted.
- taglinks starting with hyphen like |-x| were not recognized.
- keycodes like `<foo>` and `CTRL-x` were not recognized.
- ToC is not scrollable.

Solution:
- Add ws() to the column_heading case.
- Update help parser to latest version
  - supports `keycode`
  - fixes for taglink, argument
- Update .toc CSS. https://github.com/neovim/neovim.github.io/issues/297

fix https://github.com/neovim/neovim.github.io/issues/297
2022-10-06 06:16:00 -07:00
Justin M. Keyes
9a5ac06509
fix(docs): invalid :help links #20353
ref #20159
2022-09-26 06:56:07 -07:00
dundargoc
c815aadfcc
docs: fix typos (#20150)
Co-authored-by: Miguel Carneiro <mcarneiromorenas@gmail.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Raphael <glephunter@gmail.com>
Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-09-26 17:43:23 +08:00
Justin M. Keyes
63be765182
fix(docs): invalid :help links #20345
Fix those naughty single quotes.

closes #20159
2022-09-25 16:58:27 -07:00
zeertzjq
907fc8ac37
vim-patch:9.0.0449: there is no easy way to translate a key code into a string (#20168)
Problem:    There is no easy way to translate a string with a key code into a
            readable string.
Solution:   Add the keytrans() function. (closes vim/vim#11114)
cdc839353f

vim-patch:7b2d87220c6c

Add missing part of patch
7b2d87220c
2022-09-13 06:23:33 +08:00
zeertzjq
245ac6f263 vim-patch:8.2.5034: there is no way to get the byte index from a virtual column
Problem:    There is no way to get the byte index from a virtual column.
Solution:   Add virtcol2col(). (Yegappan Lakshmanan, closes vim/vim#10477,
            closes vim/vim#10098)
5a6ec10cc8

Cherry-pick tv_check_for_number_arg() from Vim.
Cherry-pick pathshorten() doc change.
2022-09-12 17:28:07 +08:00
Shougo
253f0ffd8d
vim-patch:9.0.0285: it is not easy to change the command line from a plugin (#19979)
vim-patch:9.0.0285: it is not easy to change the command line from a plugin

Problem:    It is not easy to change the command line from a plugin.
Solution:   Add setcmdline(). (Shougo Matsushita, closes vim/vim#10869)
07ea5f1509
2022-08-29 13:11:52 +08:00
zeertzjq
754892e59d
vim-patch:8.2.{1536,1540}: charclass() (#19748)
vim-patch:8.2.1536: cannot get the class of a character; emoji widths are wrong

Problem:    Cannot get the class of a character; emoji widths are wrong in
            some environments.
Solution:   Add charclass(). Update some emoji widths.  Add script to check
            emoji widths.
4e4473c927

Use latest charclass() docs from Vim.
Rewrite DoIt() in emoji_list.vim in Lua.
Omit emoji table updates:
- emoji_width update looks wrong as these added ranges are only double-width when followed by 0xFE0F.
- Other updates are too old.

vim-patch:8.2.1540: the user cannot try out emoji character widths

Problem:    The user cannot try out emoji character widths.
Solution:   Move the emoji script to the runtime/tools directory.
98945560c1
2022-08-13 11:29:38 +08:00
zeertzjq
512e0441f1
docs: fix some mistakes and missing docs (#19699) 2022-08-10 12:47:38 +08:00
Christian Clason
a5e846b996
vim-patch:partial: 48c3f4e0bff7 (#19684)
vim-patch:partial:48c3f4e0bff7

Update runtime files
48c3f4e0bf

partially skip `options.txt` (needs 9.0.0138)
2022-08-09 10:43:28 +02:00
zeertzjq
53c9500c1d vim-patch:8.2.1535: it is not possible to specify cell widths of characters
Problem:    It is not possible to specify cell widths of characters.
Solution:   Add setcellwidths().
08aac3c619

Co-Authored-By: delphinus <me@delphinus.dev>
2022-08-08 20:03:40 +08:00
zeertzjq
77926b6493 vim-patch:8.2.0385: menu functionality insufficiently tested
Problem:    Menu functionality insufficiently tested.
Solution:   Add tests.  Add menu_info(). (Yegappan Lakshmanan, closes vim/vim#5760)
0eabd4dc8f

Omit feedkeys() change: even if "L" flag is implemented it will likely
use input_enqueue(), which already checks for interrupts.

Omit Test_mouse_popup_menu(): already tested in Lua.
2022-08-05 06:47:24 +08:00
zeertzjq
27ce21ac85
vim-patch:partial:8.2.0897: list of functions in patched version is outdated (#19637)
Problem:    List of functions in patched version is outdated.
Solution:   Update the function lists only.
ebacddbc16
2022-08-04 11:05:49 +08:00
Christian Clason
c00a3f45d4
vim-patch:8cc5b559f700 (#19066)
Update runtime files
8cc5b559f7
2022-06-23 15:57:51 +02:00
Christian Clason
6eaf10502c
vim-patch:partial:63f32603789d (#18916)
Update runtime files
63f3260378

skip translations
skip user manual rewrite
2022-06-10 08:40:32 +02:00
Christian Clason
1324e7f79e
vim-patch:partial:016188fd8a30 (#18890)
Update runtime files.
016188fd8a

omit changes from doc/builtin.txt (needs 8.2.1536, 8.2.4981)
skip user manual rewrite for Vim9script
2022-06-07 14:41:53 +02:00
Shougo
dbdd58e548
feat: cmdline funcs (#18284)
vim-patch:8.2.4903: cannot get the current cmdline completion type and position

Problem:    Cannot get the current cmdline completion type and position.
Solution:   Add getcmdcompltype() and getcmdscreenpos(). (Shougo Matsushita,
            closes vim/vim#10344)
79d599b877

vim-patch:8.2.4910: imperfect coding

Problem:    Imperfect coding.
Solution:   Make code nicer.
9ff7d717aa
2022-05-09 12:52:31 +08:00
zeertzjq
3b0bcb8ad0 vim-patch:8.2.3226: new digraph functions use old naming scheme
Problem:    New digraph functions use old naming scheme.
Solution:   Use the digraph_ prefix. (Hirohito Higashi, closes vim/vim#8580)
29b857150c
2022-04-12 21:26:46 +08:00
zeertzjq
cbc54cf484 vim-patch:8.2.3184: cannot add a digraph with a leading space
Problem:    Cannot add a digraph with a leading space.  It is not easy to list
            existing digraphs.
Solution:   Add setdigraph(), setdigraphlist(), getdigraph() and
            getdigraphlist(). (closes vim/vim#8580)
6106504e9e

Use GA_APPEND_VIA_PTR in registerdigraph().
Use tv_list_append_*() in getdigraphlist_appendpair().
Put the error messages in digraph.c.
E196 is N/A.
Remove mentions about 'encoding' being non-Unicode.
Nvim doesn't support setting encoding=japan, so skip a test.
2022-04-12 21:26:30 +08: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
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
Daniel Steinberg
7b3cfee982 vim-patch:partial:04fb916
Update runtime files
04fb916684
2022-01-29 15:19:30 -05: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
zeertzjq
8eff0ca6d5 vim-patch:8.2.2468: not easy to get the full command name from a shortened one
Problem:    Not easy to get the full command name from a shortened one.
Solution:   Add fullcommand(). (Martin Tournoij, closes vim/vim#7777)
038e09ee76
2021-12-25 07:42:06 +08:00