Commit Graph

167 Commits

Author SHA1 Message Date
Justin M. Keyes
17c59e417f fix(docs): vimdoc syntax errors
Prepare for https://github.com/neovim/tree-sitter-vimdoc/pull/108 which improves
`{arg}` highlighting in many common cases:

    vim.foo({bar})
    vim.foo( {bar})
    nvim_foo({bar})
    nvim_foo({bar},{baz})
    nvim_foo({bar}, {baz})
    foo[{buf}]

The tradeoff is that things like `"[{"` are flagged as parse errors.
We could avoid if we drop support for `foo[{buf}]`, but that is rather common
(see `builtin.txt`).
2023-06-26 11:29:12 +02:00
Justin M. Keyes
49a7585981 docs: autocmds, misc 2023-06-25 17:25:47 +02:00
Justin M. Keyes
036da0d079 fix(docs): vimdoc syntax errors
gen_help_html: truncate parse-error sample text
2023-06-25 17:14:28 +02:00
Justin M. Keyes
4e6356559c
test: spellcheck :help (vimdoc) files #24109
Enforce consistent terminology (defined in
`gen_help_html.lua:spell_dict`) for common misspellings.

This does not spellcheck English in general (perhaps a future TODO,
though it may be noisy).
2023-06-22 03:44:51 -07:00
Justin M. Keyes
72a6643b13
docs #24061
- nvim requires rpc responses in reverse order. https://github.com/neovim/neovim/issues/19932
- NVIM_APPNAME: UIs normally should NOT set this.

ref #23520
fix #24050
fix #23660
fix #23353
fix #23337
fix #22213
fix #19161
fix #18088
fix #20693
2023-06-19 08:40:33 -07:00
Justin M. Keyes
cee981bf09
docs #22363
Co-authored by: zeertzjq <zeertzjq@outlook.com>
Co-authored by: Steven Todd McIntyre II <114119064+stmii@users.noreply.github.com>
Co-authored by: nobe4 <nobe4@users.noreply.github.com>

- docs: mention --luadev-mod to run with lua runtime files
  When changing a lua file in the ./runtime folder, a new contributor
  might expect changes to be applied to the built Neovim binary.
2023-06-19 02:24:44 -07:00
zeertzjq
bbb934e775
vim-patch:9.0.1629: having utf16idx() rounding up is inconvenient (#24019)
Problem:    Having utf16idx() rounding up is inconvenient.
Solution:   Make utf16idx() round down. (Yegappan Lakshmanan, closes vim/vim#12523)

95707037af

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-06-14 20:54:11 +08:00
zeertzjq
72de8fdeeb
vim-patch:f1dcd14fc5d4 (#23986)
Update runtime files

f1dcd14fc5

:autocmd-block is N/A (Vim9 script)

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-11 20:04:59 +08:00
Sean Dewar
473a216a21
vim-patch:10e8ff9b2607 (#23977)
Update runtime files

10e8ff9b26

Also:
- fix a missing `<` in builtin.txt.
- edit `:function` `{name}` wording to match the change made for the docs above
  by Justin in #10619.
- link to `*vimrc*` rather than `*init.vim*` in repeat.txt change (as `init.lua`
  may also be used).

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-11 12:40:22 +01:00
zeertzjq
106922898a
vim-patch:9.0.1617: charidx() result is not consistent with byteidx() (#23963)
Problem:    charidx() and utf16idx() result is not consistent with byteidx().
Solution:   When the index is equal to the length of the text return the
            lenght of the text instead of -1. (Yegappan Lakshmanan,
            closes vim/vim#12503)

577922b917

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-06-09 17:43:46 +08:00
Lewis Russell
2db719f6c2
feat(lua): rename vim.loop -> vim.uv (#22846) 2023-06-03 12:06:00 +02:00
Christian Clason
c11986ed1a
vim-patch:b7398fe41c9e (#23627)
Update runtime files

b7398fe41c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-15 09:38:32 +02:00
dundargoc
08991b0782
docs: small fixes
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: HiPhish <hiphish@posteo.de>
Co-authored-by: Julio B <julio.bacel@gmail.com>
Co-authored-by: T727 <74924917+T-727@users.noreply.github.com>
Co-authored-by: camoz <camoz@users.noreply.github.com>
Co-authored-by: champignoom <66909116+champignoom@users.noreply.github.com>
2023-05-13 21:33:22 +02:00
zeertzjq
3724e65c30 vim-patch:8.2.2607: strcharpart() cannot include composing characters
Problem:    strcharpart() cannot include composing characters.
Solution:   Add the {skipcc} argument.

02b4d9b18a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 17:49:56 +08: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
8af97ecefa
vim-patch:8.2.3314: behavior of exists() in a :def function is unpredictable (#23317)
Problem:    Behavior of exists() in a :def function is unpredictable.
Solution:   Add exists_compiled().

267359902c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-26 08:37:22 +08:00
zeertzjq
bfa92d3861
vim-patch:8.2.5019: cannot get the first screen column of a character (#23312)
Problem:    Cannot get the first screen column of a character.
Solution:   Let virtcol() optionally return a list. (closes vim/vim#10482,
            closes vim/vim#7964)

0f7a3e1de6

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-04-25 22:22:26 +08:00
zeertzjq
43c49746d9
vim-patch:9.0.0335: checks for Dictionary argument often give a vague error (#23309)
Problem:    Checks for Dictionary argument often give a vague error message.
Solution:   Give a useful error message. (Yegappan Lakshmanan, closes vim/vim#11009)

04c4c5746e

Cherry-pick removal of E922 from docs from patch 9.0.1403.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-25 21:32:12 +08:00
Christian Clason
e3f36377c1
vim-patch:71badf9547e8 (#23285)
Update runtime files

71badf9547

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-23 15:22:55 +02: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
zeertzjq
f39b33ee49 vim-patch:9.0.0411: only created files can be cleaned up with one call
Problem:    Only created files can be cleaned up with one call.
Solution:   Add flags to mkdir() to delete with a deferred function.
            Expand the writefile() name to a full path to handle changing
            directory.

6f14da15ac

vim-patch:8.2.3742: dec mouse test fails without gnome terminfo entry

Problem:    Dec mouse test fails without gnome terminfo entry.
Solution:   Check if there is a gnome entry. Also fix 'acd' test on
            MS-Windows. (Dominique Pellé, closes vim/vim#9282)

f589fd3e10

Cherry-pick test_autochdir.vim changes from patch 9.0.0313.
Cherry-pick test_autocmd.vim changes from patch 9.0.0323.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 15:04:41 +08:00
zeertzjq
0167649ce4 vim-patch:9.0.0379: cleaning up after writefile() is a hassle
Problem:    Cleaning up after writefile() is a hassle.
Solution:   Add the 'D' flag to defer deleting the written file.  Very useful
            in tests.

806a273f3c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 15:04:41 +08:00
zeertzjq
e9b4f51051 vim-patch:9.0.0303: it is not easy to get information about a script
Problem:    It is not easy to get information about a script.
Solution:   Make getscriptinf() return the version.  When selecting a specific
            script return functions and variables. (Yegappan Lakshmanan,
            closes vim/vim#10991)

2f892d8663

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-15 21:06:17 +08:00
zeertzjq
bcc971de15 vim-patch:9.0.0269: getscriptinfo() does not include the version
Problem:    getscriptinfo() does not include the version.  Cannot select
            entries by script name.
Solution:   Add the "version" item and the "name" argument. (Yegappan
            Lakshmanan, closes vim/vim#10962)

520f6ef60a

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-15 21:06:16 +08:00
bfredl
e4a136f713 feat(ex_cmds)!: remove :behave
just use the individual options instead.

   set selection=exclusive
   set selectmode=mouse,key
   set mousemodel=popup
   set keymodel=startsel,stopsel
2023-04-13 12:15:30 +02: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
Justin M. Keyes
ce0fddf5ae
feat: try to recover from missing tempdir #22573
Problem:
If vim_tempdir mysteriously goes missing (typically by "antivirus" on
Windows), any plugins using tempname() will be broken for the rest of
the session. #1432 #9833 https://groups.google.com/g/vim_use/c/ef55jNm5czI
Steps:
    mkdir foo
    TMPDIR=./foo nvim
    :echo tempname()
    !rm -r foo
    :echo tempname()
    tempname() still uses the foo path even though it was deleted.

Solution:
- Don't assume that vim_tempdir exists.
- If it goes missing once, retry vim_mktempdir and log (silently) an error.
- If it goes missing again, retry vim_mktempdir and show an error.

Rejected in Vim for performance reasons:
  https://groups.google.com/g/vim_use/c/qgRob9SWDv8/m/FAOFVVcDTv0J
  https://groups.google.com/g/vim_dev/c/cogp-Vye4oo/m/d_SVFXBbnnoJ
But, logging shows that `vim_gettempdir` is not called frequently.

Fixes #1432
Fixes #9833
Fixes #11250
Related: stdpath("run") f50135a32e
2023-03-09 05:07:36 -08:00
zeertzjq
08d0f99ae1 vim-patch:partial:944697ae196
Update runtime files

944697ae19

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-07 11:41:35 +08:00
zeertzjq
2882b1543a vim-patch:8.2.3969: value of MAXCOL not available in Vim script
Problem:    Value of MAXCOL not available in Vim script.
Solution:   Add v:maxcol. (Naohiro Ono, closes vim/vim#9451)

56200eed62

The variable is always 2147483647, but introducing it makes functions
easier to document.

Co-authored-by: naohiro ono <obcat@icloud.com>
2023-03-07 11:33:23 +08:00
zeertzjq
278aeee3ae vim-patch:9.0.0430: cannot use repeat() with a blob
Problem:    Cannot use repeat() with a blob.
Solution:   Implement blob repeat. (closes vim/vim#11090)

375141e1f8

Co-authored-by: Bakudankun <bakudankun@gmail.com>
2023-02-28 21:27:43 +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
7aad75e293 vim-patch:9.0.0810: readblob() returns empty when trying to read too much
Problem:    readblob() returns empty when trying to read too much.
Solution:   Return what is available.

5b2a3d77d3

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-28 19:52:45 +08:00
zeertzjq
4bd0611d7b vim-patch:9.0.0803: readblob() cannot read from character device
Problem:    readblob() cannot read from character device.
Solution:   Use S_ISCHR() to not check the size. (Ken Takata, closes vim/vim#11407)

43625762a9

S_ISCHR is always defined in Nvim.

Co-authored-by: K.Takata <kentkt@csc.jp>
2023-02-28 19:52:45 +08:00
zeertzjq
bfa0bc7df0 vim-patch:9.0.0795: readblob() always reads the whole file
Problem:    readblob() always reads the whole file.
Solution:   Add arguments to read part of the file. (Ken Takata,
            closes vim/vim#11402)

11df3aeee5

Remove trailing whitespace in test as done in patch 9.0.1257.
Move the help for rand() before range().

Co-authored-by: K.Takata <kentkt@csc.jp>
2023-02-28 19:52:45 +08:00
Justin M. Keyes
3b92776226
Merge #22382 has('gui_running') 2023-02-28 06:24:23 -05:00
Christian Clason
66c384d4e8
vim-patch:partial:dd60c365cd26 (#22437)
vim-patch:partial:dd60c365cd26

Update runtime files

dd60c365cd

Co-authored-by: Bram Moolenaar <Bram@vim.org>

Skip: eval.txt, repeat.txt (needs `getscriptinfo()`)
2023-02-28 09:34:27 +01:00
Justin M. Keyes
7f424e2b65 feat(api): more fields in nvim_list_uis
Problem:
nvim_list_uis does not report all ":help ui-option" fields.

Solution:
Store ":help ui-option" fields on the `UI` object and update ui_array.
2023-02-27 19:50:59 +01: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
13da3d469a vim-patch:partial:9.0.0202: code and help for indexof() is not ideal
Problem:    Code and help for indexof() is not ideal.
Solution:   Refactor the code, improve the help. (Yegappan Lakshmanan,
            closes vim/vim#10908)

3fbf6cd355

Skip CHECK_LIST_MATERIALIZE and set_vim_var_type().
Use tv_list_uidx() instead of lv_idx.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-02-27 07:53:17 +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
344a1ee8e6
docs: fix typos (#22353) 2023-02-22 00:07:26 +08:00
zeertzjq
ee26b227e1
vim-patch:partial:938ae280c79b (#22356)
Update runtime files.

938ae280c7

Partially skip autocmd.txt: needs patch 8.2.5011.
Partially skip builtin.txt: needs patch 9.0.0411.
Partially skip eval.txt: needs patch 8.2.3783.
Cherry-pick :map-meta-keys from patch 9.0.1276.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-21 23:50:29 +08:00
Thayne McCombs
cb97d5425a docs: clarify "pipe" mode for sockconnect
Make it more clear that on unix the "pipe" mode of sockconnect uses unix
local domain sockets, not named pipes (FIFOs) which are not currently
supported.

See discussion in #22080.

Signed-off-by: Thayne McCombs
2023-02-02 01:00:17 -07:00
zeertzjq
f03f6263bb vim-patch:9.0.1238: :runtime completion can be further improved
Problem:    :runtime completion can be further improved.
Solution:   Also complete the {where} argument values and adjust the
            completion for that. (closes vim/vim#11874)

5c8771bc5a
2023-01-26 11:55:34 +08:00
zeertzjq
6320c91c50 vim-patch:9.0.1231: completion of :runtime does not handle {where} argument
Problem:    Completion of :runtime does not handle {where} argument.
Solution:   Parse the {where} argument. (closes vim/vim#11863)

3770f4c9cd
2023-01-26 11:55:34 +08:00
Paul "LeoNerd" Evans
f3039ce531 feat(highlight): define the concept of altfont as a (c)term rendering attribute 2023-01-24 11:27:50 +00:00
zeertzjq
efe5ce6fa8
vim-patch:9.0.1223: cannot use setcellwidths() below 0x100 (#21929)
Problem:    Cannot use setcellwidths() below 0x100.
Solution:   Also accept characters between 0x80 and 0x100. (Ken Takata,
            closes vim/vim#11834)

7193323b77

Co-authored-by: K.Takata <kentkt@csc.jp>
2023-01-21 08:44:14 +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