Compare commits

...

614 Commits

Author SHA1 Message Date
Ernie Rael
f8da324619 patch 9.0.2012: Vim9: error message can be more accurate
Problem:  Vim9: error message can be more accurate
Solution: Fix the error messages

Fix message for some single use error messages.

closes: #13312

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
2023-10-11 21:22:12 +02:00
Martin Tournoij
4a82bdfaa8 patch 9.0.2011: INI files not detected
Problem:  INI files not detected
Solution: detect uppercase .INI as dosini files

It previo~1 only worked for lower-case .ini files, but upperc~1 .INI is
also somewhat common on account of DOS' old 8.3 upperc~2 only filena~1.

closes: #13316

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Martin Tournoij <martin@arp242.net>
2023-10-11 21:20:06 +02:00
Christian Brabandt
41e6f7d6ba patch 9.0.2010: [security] use-after-free from buf_contents_changed()
Problem:  [security] use-after-free from buf_contents_changed()
Solution: block autocommands

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-11 21:09:53 +02:00
Yee Cheng Chin
54844857fd patch 9.0.2009: cmdline-completion for comma-separated options wrong
Problem:  cmdline-completion for comma-separated options wrong
Solution: Fix command-line expansions for options with filenames with
          commas

Fix command-line expansions for options with filenames with commas

Cmdline expansion for option values that take a comma-separated list
of file names is currently not handling file names with commas as the
commas are not escaped. For such options, the commas in file names need
to be escaped (to differentiate from a comma that delimit the list
items). The escaped comma is unescaped in `copy_option_part()` during
option parsing.

Fix as follows:
- Cmdline completion for option values with comma-separated file/folder
  names will not start a new match when seeing `\\,` and will instead
  consider it as one value.
- File/folder regex matching will strip the `\\` when seeing `\\,` to
  make sure it can match the correct files/folders.
- The expanded value will escape `,` with `\\,`, similar to how spaces
  are escaped to make sure the option value is correct on the cmdline.

This fix also takes into account the fact that Win32 Vim handles file
name escaping differently. Typing '\,' for a file name results in it
being handled literally but in other platforms '\,' is interpreted as a
simple ',' and commas need to be escaped using '\\,' instead.

Also, make sure this new logic only applies to comma-separated options
like 'path'. Non-list options like 'set makeprg=<Tab>' and regular ex
commands like `:edit <Tab>` do not require escaping and will continue to
work.

Also fix up documentation to be clearer. The original docs are slightly
misleading in how it discusses triple slashes for 'tags'.

closes: #13303
related: #13301

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-10-09 18:12:31 +02:00
Dominique Pellé
b07b9dc4da patch 9.0.2008: test: undofile left behind
Problem:  test: undofile left behind
Solution: cleanup undofile

fix: tmp file not deleted when running make test_undo

Temporary file `.Xtestfile.txt.un~` was left running `make test_undo`
and vim was configured with:
```
./configure --with-features=normal --enable-gui=no --enable-terminal
```

closes: #13304

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Dominique Pellé <dominique.pelle@tomtom.com>
2023-10-09 18:09:20 +02:00
Yegappan Lakshmanan
e467189022 patch 9.0.2007: Vim9: covariant parameter types allowed
Problem:  Vim9: covariant parameter types allowed when assigning
          functions
Solution: Enforce invariant type check for arguments and return value
          when assigning a funcref

closes: #13299
closes: #13305

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-10-09 18:01:06 +02:00
Yegappan Lakshmanan
f4ee1cb74b patch 9.0.2006: Vim9: need more tests
Problem:  Vim9: need more tests
Solution: add additional disassembly tests

closes: #13305

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-10-09 17:57:27 +02:00
Christian Brabandt
b56cef0be0 patch 9.0.2005: partially revert patch v9.0.1997
Problem:  partially revert patch v9.0.1997
Solution: add a comment, to make clear it's not used

related: #13288

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-09 17:55:02 +02:00
Christian Brabandt
d4afbdd071 patch 9.0.2004: Missing test file
Problem:  Missing test file
Solution: git-add the file to the repo

closes: #13305

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-09 08:15:00 +02:00
Christian Brabandt
7879bc5c13 patch 9.0.2003: xxd: compilation warning
Problem:  xxd: compilation warning
Solution: initialize variables

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-08 20:38:43 +02:00
Enno
1e33cd72b6 runtime: make command name for &iskeywordprg more unique (#13297)
See https://github.com/vim/vim/pull/13213/commits by @dkearns:
Rename 'keywordprg' user command to ShKeywordPrg as this is just a
leaking implementation detail.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-08 19:14:07 +02:00
Yegappan Lakshmanan
b852305dbf patch 9.0.2002: Vim9: need cleanup of class related interface code
Problem:  Vim9: need cleanup of class related interface code
Solution: Remove the unused class variable and class method related code
          for interfaces.

Remove unused class variable and class method related code for
interfaces.

Refactor the code.

Optimize the object/class member double lookup in compile_lhs().

Change unused global functions to static functions.

closes: #13302

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-10-08 19:07:39 +02:00
Antonio Giovanni Colombo
75b277d35c translation(it): updated translation of xxd manpage
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-08 19:05:02 +02:00
Ernie Rael
9771b2a67f patch 9.0.2001: Vim9: segfault with islocked()
Problem:  Vim9: segfault with islocked()
Solution: Check that the lval pointer is not null for objects and
          class variables

closes: #13295

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
2023-10-07 22:10:26 +02:00
Yegappan Lakshmanan
1087b8c29a patch 9.0.2000: Vim9: use-after-free in deep call stack
Problem:  Vim9: use-after-free in deep call stack
Solution: Get the objct pointer from execution stack

closes: #13296

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-10-07 22:03:18 +02:00
dkearns
2a281ccca0 runtime(sh): Update ftplugin (#13213)
Rename 'keywordprg' user command to ShKeywordPrg as this is just a
leaking implementation detail.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-06 19:59:42 +02:00
Ernie Rael
e6c9aa5e6a patch 9.0.1999: Vim9: some error messages can be improved
Problem:  Vim9: some error messages can be improved
Solution: Mention the defining class for variable access error message

closes: #13272

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Co-authored-by: Ernie Rael <errael@raelity.com>
2023-10-06 19:55:52 +02:00
tristhaus
85f4521808 patch 9.0.1998: xxd: cannot reverse a bit dump
Problem:  xxd: cannot reverse a bit dump
Solution: implement reversing the bit dump using -b -r

closes: #13286

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: tristhaus <tristhaus@yahoo.de>
2023-10-06 19:51:13 +02:00
dundargoc
580c1fcb4a patch 9.0.1997: Some unused code in move.c and string.c
Problem:  Some unused code in move.c and string.c
Solution: Remove it

closes: #13288

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: dundargoc <gocdundar@gmail.com>
2023-10-06 19:41:14 +02:00
zeertzjq
27e12c7669 runtime(doc): remove E1520 tag (#13289)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-06 19:34:04 +02:00
Ken Takata
fa145f2009 patch 9.0.1996: Cannot build with python312
Problem:  Cannot build with python312
Solution: Define wrapper types and functions for python 3.12

Py_SIZE() uses PyLong_Type and PyBool_Type starting from Python 3.12.
We need to define our own Py_SIZE() to replace Py{Bool,Long}_Type with
py3_Py{Bool,Long}_Type.
We also need to redefine PyTuple_GET_SIZE() and PyList_GET_SIZE(), because
they use Py_SIZE().

closes: #13281
closes: #13290

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
2023-10-06 19:27:13 +02:00
Yegappan Lakshmanan
26e8f7b0ab runtime(doc): Update vim9class help (#13292)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-06 19:24:10 +02:00
zeertzjq
a991ce9c08 patch 9.0.1995: Invalid memory access with empty 'foldexpr'
Problem:  Invalid memory access when 'foldexpr' returns empty string.
Solution: Check for NUL.

closes: #13293

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-10-06 19:18:12 +02:00
RestorerZ
ac9c6d5c78 patch 9.0.1994: inconsistent feature description
Problem:  inconsistent feature description
Solution: delete old mentioned feature sets small and big

The may however still be mentioned for historical reasons. e.g. The
last Amiga built version is for Vim6.2 and is still a big version.

closes: #13273

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: RestorerZ <restorer@mail2k.ru>
2023-10-05 22:25:12 +02:00
Christian Brabandt
9960ebcace patch 9.0.1993: warning about unused function definition
Problem:  warning about unused function definition
Solution: add ifdefs

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-05 22:17:09 +02:00
Christian Brabandt
20d161ace3 patch 9.0.1992: [security] segfault in exmode
Problem:  segfault in exmode when redrawing
Solution: skip gui_scroll when exmode_active

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-05 22:10:10 +02:00
Yee Cheng Chin
290b887e8c patch 9.0.1991: no cmdline completion for setting the font
Problem:  no cmdline completion for setting the font
Solution: enable it on Win32 and GTK builds

Add guifont cmdline completion (for Windows and GTK)

For Windows, auto-complete will only suggest monospace fonts as that's
the only types allowed. Will also suggest font options after the colon,
including suggesting the current font size for convenience, and misc
charset and quality options like `cANSI` and `qCLEARTYPE`.

For GTK, auto-complete will suggest only monospace fonts for `guifont`
but will include all fonts for `guifontwide`. The completion code
doesn't currently suggest the current font size, as the GTK guifont
format does not have a clear delimiter (':' for other platforms).

closes: #13264

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-10-05 20:54:21 +02:00
Christ van Willegen
ea746f9e86 patch 9.0.1990: strange error number
Problem:  strange error number
Solution: change error number,
          add doc tag for E1507

closes: #13270

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
2023-10-05 20:48:36 +02:00
KSR-Yasuda
0e95841004 runtime(netrw): diff (df) may open the wrong window (#13275)
closes: #11359

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-05 20:37:15 +02:00
KSR-Yasuda
f449825ae2 runtime(netrw): Update .netrwbook immediately on bookmark change (#13276)
closes: #9738

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-05 20:34:17 +02:00
K.Takata
9b259f520e translation(it): revert permission changes for xxd manpages again (#13277)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-05 20:30:08 +02:00
Ernie Rael
d615a3122a patch 9.0.1989: Vim9: double error message given
Problem:  Vim9: double error message given
Solution: Only give second error message, if ther
          wasn't one given before

closes: #13278

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
2023-10-05 20:28:16 +02:00
Yegappan Lakshmanan
d2f4800099 patch 9.0.1988: Vim9: potential use-after-free for class members
Problem:  Vim9: potential use-after-free for class members
Solution: Use the class-related grow array for storing the
          member type instead of using a temporary type
          list grow array

Use the type list grow array associated with the class than using a
temporary type list grow array to allocate the class member type.

For simple types, a predefined type is used. For complex types, the type
is dynamically allocated from a grow array. For class variables, the
type grow array in the class should be used. So that the lifetime of the
type is same as the lifetime of the class.

closes: #13279

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-10-05 20:24:18 +02:00
Ken Takata
da5da654de patch 9.0.1987: win32: font-size calculation can be improved
Problem:  win32: font-size calculation can be improved
Solution: calculate font size before the window size

Support calculating the new size even if a bitmap font is used.
Calculate the new font size before actually change the Window size.

closes: #13280
related: #11812, #13252

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
2023-10-05 20:20:58 +02:00
Ivan Pešić
c661e11e9c translation(sr): Update Serbian messages translation (#13282)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-05 20:17:28 +02:00
Yegappan Lakshmanan
b5a0719cb7 patch 9.0.1986: Vim9: accepting type-annotations
Problem:  Vim9: accepting type-annotations
Solution: Reject type annotations outside of declarations.

closes: #13267
closes: #13283

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-10-05 20:16:06 +02:00
dundargoc
b6d01f131c runtime(just): Correct filetype detection pattern and style (#13284)
See https://github.com/vim/vim/pull/13271#discussion_r1347279686 and
https://github.com/NoahTheDuke/vim-just/blob/main/ftdetect/just.vim.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-05 20:11:55 +02:00
dundargoc
9a00e7c7cf patch 9.0.1985: CI: codecov is intrusive
Problem:  CI: codecov is intrusive
Solution: disable codecov comments

The codecov report is incredibly intrusive, and getting a notification
for every PR to vim that codecov codecoved is annoying. If anyone is
interested in the report the information is readily available by
clicking on the job.

closes: #13285

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: dundargoc <gocdundar@gmail.com>
2023-10-05 20:07:11 +02:00
Christian Brabandt
85ff0c1912 patch 9.0.1984: CI: Test_open_delay*() fails on FreeBSD 14
Problem:  CI: Test_open_delay*() fails on FreeBSD 14
Solution: Skip it on BSD

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-04 21:58:24 +02:00
zeertzjq
8e5f26ec6a patch 9.0.1983: scrolling inactive window not possible with cursorbind
Problem:  Scrolling non-current window using mouse is inconsistent
          depending on 'scrollbind'/'scrolloff' and different from GUI
          vertical scrollbar when 'cursorbind' is set.
Solution: Don't move cursor in non-current windows for 'cursorbind' if
          cursor in the current window didn't move.

closes: #13219
closes: #13210

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-10-04 21:45:33 +02:00
yasuda
4dbb2669e9 runtime(netrw): error when trying to :bd unloaded buffer
closes: #13215
closes: #13082

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-04 20:52:44 +02:00
Ernie Rael
64885645e7 patch 9.0.1982: vim9: clean up from v9.0.1955
Problem:  vim9: clean up from v9.0.1955
Solution: Fix a few remaining issues, improve error message

- Use `cl_exec`, the executing class, to check permissions in `get_lval()`.
- Handle lockvar of script variable from class.
- Add 'in class "Xxx"' to e_cannot_access_private_variable_str.

closes: #13222

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
2023-10-04 20:16:22 +02:00
zeertzjq
0583491277 patch 9.0.1981: not being able to scroll up in diff mode
Problem:  Cannot scroll up in diff mode with many filler lines and zero
          'scrolloff'.
Solution: Invalidate w_cline_row before calling comp_botline().

closes: #13256

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-10-04 20:12:37 +02:00
Ken Takata
119fdd9293 patch 9.0.1980: win32: issues with stable python ABI
Problem:  win32: issues with stable python ABI
Solution: if_python3,win32: Fix Python3 stable ABI

There were some issues in current stable ABI implementation on Windows:
* Python DLL name should be `python3.dll` instead of `python311.dll` and
  so on. (See: https://docs.python.org/3/c-api/stable.html)
* Some non-stable API functions were used:
  - `_PyObject_NextNotImplemented`
  - `PyStdPrinter_Type`
* `reset_stdin()` and `hook_py_exit()` didn't work with `python3.dll`.
  `python3.dll` is a special type of DLL called forwarder DLL.
  It just forwards the functions to other DLL (e.g. `python311.dll`).
  There were two issues regarding these functions:
  - `python3.dll` doesn't have import tables. This caused a crash in
    `get_imported_func_info()`. Add a check whether the specified DLL
    has an import table.
  - `reset_stdin()` and `hook_py_exit()` should be applied to the
    forwarded DLL (e.g. `python311.dll`), not to `python3.dll`.
    Check the export directory of `python3.dll` to find the forwarded
    DLL and apply the functions to it.

closes: #13260

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
2023-10-04 20:05:05 +02:00
zeertzjq
317468aace patch 9.0.1979: Cirrus CI disabled
Problem:  Cirrus CI disabled
Solution: re-enable Cirrus CI

Ref patch 9.0.1912:

> Perhaps at the beginning of the next month we can revisit and enable
> just a build without testing it.  Hopefully this is won't take too
> many credits and we can at least verify that building works.

Actually enabling testing should be fine. In the last month there were
three Cirrus CI jobs and credits ran out on Sep 15, but now there is
only one Cirrus CI job, so credits shouldn't run out.

closes: #13261

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-10-04 19:57:35 +02:00
dundargoc
3d90f71b76 patch 9.0.1978: No filetype detection for just files
Problem:  No filetype detection for just files
Solution: Detect just files (*.just, justfile, etc)

closes: #13271

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: dundargoc <gocdundar@gmail.com>
2023-10-04 19:52:54 +02:00
Yegappan Lakshmanan
fe7b20a1a3 patch 9.0.1977: Vim9: object members can change type
Problem:  Vim9: object members can change type
Solution: Check type during assignment to object/class var

closes: #13127
closes: #13262

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-10-04 19:47:52 +02:00
Antonio Giovanni Colombo
b9a974df9e translation(it): update translation of xxd manpage
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-04 18:30:25 +02:00
Christian Brabandt
b74ebfc6bf runtime(doc): update xxd manpage and mention $NO_COLOR env
also regenerate the xxd.man document page.

fixes: #13257

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-03 16:58:55 +02:00
Aliaksei Budavei
b043ff34c1 runtime(doc): fix two typos in vim9.txt and options.txt (#13258)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-03 16:39:53 +02:00
zeertzjq
2dfc22908e runtime(doc): remove E1507 help tag, which is no longer used (#13254)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-03 08:12:56 +02:00
Christian Brabandt
3f168ec8ae patch 9.0.1976: style: space before tab in optionstr.c
Problem:  style: space before tab in optionstr.c
Solution: remove the space

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-02 23:21:11 +02:00
Gene C
993b17569b patch 9.0.1975: xattr: permission-denied errors on write
Problem:  xattr: permission-denied errors on write
Solution: ignore those errors

closes: #13246

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Gene C <arch@sapience.com>
2023-10-02 22:44:12 +02:00
Restorer
12a0d999b1 translation(ru): Update Russian message translation to Vim 9.0.1968 (#13239)
* Updated to Vim 9.0.1968. Several refinements and corrections
* typo fixed

Co-authored-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-02 21:53:27 +02:00
Yegappan Lakshmanan
cd39b69b02 runtime(doc): add missing error numbers in the help. (#13241)
closes: #13240

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-02 21:50:45 +02:00
dundargoc
20f48d5b2d runtime(doc): mention how to disable folding in diff mode (#13242)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-02 21:49:23 +02:00
h_east
ba77bbb5c7 runtime(doc): fix typos.
* Fix typo in document (Related: #12516)
* Fix E1363 duplication
* Fix one more typo.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-02 21:47:13 +02:00
Yegappan Lakshmanan
b32064fedb patch 9.0.1974: vim9: using contra-variant type-checks
Problem:  vim9: using contra-variant type-checks (after v9.0.1959)
Solution: Use invariant type checking instead

closes: #13248

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-10-02 21:43:58 +02:00
Yee Cheng Chin
6d11347260 patch 9.0.1973: Clean up cmdline option completion code
Problem:  Clean up cmdline option completion code
Solution: Fix various minor problems

- Fix manual array size calculations to just use `ARRAY_LENGTH()`.
- Fix unintentional typo in comments due to copy-paste error.
- Fix assert_equal() usages to pass the expected value to first
  parameter instead of 2nd one to avoid confusion.
- Fix signed vs unsigned warnings
- Correct misplaced comments about set_op_T and set_prefix_T
  and fix a typo in another comment

closes: #13249
closes: #13237

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-10-02 21:38:39 +02:00
Ken Takata
4a1ad55564 patch 9.0.1972: win32: missing '**' expansion test
Problem:  win32: missing '**' expansion test (after v9.0.1947)
Solution: Add test for MS-Windows

win32: Add "**" test

Vim supports "**" on MS-Windows. However, it is not tested by
`Test_glob_extended_bash`.

Unlike Unix, it doesn't use 'shell' and doesn't support {,} expansion.
So, I added as a separate test.

related: #13205
closes: #13250

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
2023-10-02 21:33:42 +02:00
Yee Cheng Chin
f59cbefd0a patch 9.0.1971: macOS: FEAT_SOUND guard too restrictive
Problem:  macOS: FEAT_SOUND guard too restrictive
Solution: check for older macOS support properly

Fix macOS FEAT_SOUND guards to be less restrictive

This allows +sound to work on older macOS platforms again. The +sound
implementation uses APIs available in 10.6, but the code itself uses
generics with type parameters which was only added in Xcode 7 / clang 7,
which was released for macOS 10.11. This means as long as Vim is
compiled under 10.11+, and using a deployment target >= 10.6, the
feature will work.

closes: #13251

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-10-02 21:28:50 +02:00
Ken Takata
7086b3e76a patch 9.0.1970: win32: high-dpi support can be improved
Problem:  win32: high-dpi support can be improved
Solution: implement WM_GETDPISCALEDSIZE

win32: Better support of Per-Monitor V2 High DPI

Implement WM_GETDPISCALEDSIZE.
It is not so easy to calculate the new size without actually changing
the size. So, this returns an approximate size.

This doesn't work well when a bitmap font (e.g. FixedSys) is selected,
but I think this is acceptable.

closes: #11812
closes: #13252

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
2023-10-02 21:26:03 +02:00
Christian Brabandt
3bd7fa12e1 patch 9.0.1969: [security] buffer-overflow in trunc_string()
Problem:  buffer-overflow in trunc_string()
Solution: Add NULL at end of buffer

Currently trunc_string() assumes that when the string is too long,
buf[e-1] will always be writeable. But that assumption may not always be
true. The condition currently looks like this

    else if (e + 3 < buflen)
    [...]
    else
    {
	// can't fit in the "...", just truncate it
	buf[e - 1] = NUL;
    }

but this means, we may run into the last else clause with e still being
larger than buflen. So a buffer overflow occurs.

So instead of using `buf[e - 1]`, let's just always
truncate at `buf[buflen - 1]` which should always be writable.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-02 20:59:47 +02:00
Yee Cheng Chin
6ee7b521fa patch 9.0.1968: cmdline completion should consider key option
Problem:  cmdline completion should consider key option
Solution: Disable cmdline completion for key option, slightly
          refactor how P_NO_CMD_EXPAND is handled

Harden crypto 'key' option: turn off cmdline completion, disable set-=

"set-=" can be used maliciously with a crypto key, as it allows an
attacker (who either has access to the computer or a plugin author) to
guess a substring by observing the modified state. Simply turn off
set+=/-=/^= for this option as there is no good reason for them to be
used.

Update docs to make that clear as well.

Also, don't allow cmdline completion for 'key' as it just shows *****
which is not useful and confusing to the user what it means (if the user
accidentally hits enter they will have replaced their key with "*****"
instead).

Move logic to better location, don't use above 32-bit for flags

Move P_NO_CMD_EXPAND to use the unused 0x20 instead of going above
32-bits, as currently the flags parameter is only 32-bits on some
systems. Left a comment to warn that future additions will need to
change how the flags work either by making it 64-bit or split into two
member vars.

Also, move the logic for detecting P_NO_CMD_EXPAND earlier so it's not
up to each handler to decide, and you won't see the temporary "..." that
Vim shows while waiting for completion handler to complete.

closes: #13224

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-10-01 09:19:18 +02:00
zeertzjq
7ece036d72 patch 9.0.1967: xattr errors not translated
Problem:  xattr errors not translated
Solution: mark for translation, consistently capitalize
          first letter.

closes: #13236

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-10-01 09:07:14 +02:00
Illia Bobyr
e379e21ddc patch 9.0.1966: configure prints stray 6 when checking libruby
Problem:  configure prints stray 6 when checking libruby
Solution: redirect stdout to dev/null

configure: Do not print "6" when checking for libruby

`expr` will print the matched string length to the standard output.
Current `configure` output looks like this:

```
checking Ruby header files...  /usr/include/ruby-3.1.0
6
```

The script really only cares about `expr` exit code.

closes: #13234

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Illia Bobyr <illia.bobyr@gmail.com>
2023-09-30 22:59:27 +02:00
Illia Bobyr
8c358e024f patch 9.0.1965: wrong auto/configure script
Problem:  wrong auto/configure script
Solution: regenerate with autoconf 2.71

configure: sys/xattr.hs: Regenerate with autoconf 2.71

It seems that `auto/configure` update in

  commit 6de4e58cf2 (tag: v9.0.1963)
  Author: zeertzjq <zeertzjq@outlook.com>
  Date:   Sat Sep 30 14:19:14 2023 +0200

      patch 9.0.1963: Configure script may not detect xattr

      Problem:  Configure script may not detect xattr correctly
      Solution: include sys/xattr instead of attr/xattr,
                make Test_write_with_xattr_support() test
                xattr feature correctly

      This also applies to the Smack security feature, so change the include
      and configure script for it as well.

      closes: #13229

      Signed-off-by: Christian Brabandt <cb@256bit.org>
      Co-authored-by: zeertzjq <zeertzjq@outlook.com>

was done manually, and missed an update to the generated variable name.

closes: #13235

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Illia Bobyr <illia.bobyr@gmail.com>
2023-09-30 22:57:19 +02:00
Christian Brabandt
a4dfbfed89 patch 9.0.1964: xattr support fails to build on MacOS X
Problem:  xattr support fails to build on MacOS X
Solution: Disable xattr support for MacOS X

MacOS X uses the same headers and functions sys/xattr.h but the function
signatures for xattr support are much different, so building fails.

So let's for now disable xattr support there.

closes: #13230
closes: #13232

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-30 18:51:36 +02:00
zeertzjq
6de4e58cf2 patch 9.0.1963: Configure script may not detect xattr
Problem:  Configure script may not detect xattr correctly
Solution: include sys/xattr instead of attr/xattr,
          make Test_write_with_xattr_support() test
          xattr feature correctly

This also applies to the Smack security feature, so change the include
and configure script for it as well.

closes: #13229

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-30 14:22:07 +02:00
Christian Brabandt
e085dfda5d patch 9.0.1962: No support for writing extended attributes
Problem:  No support for writing extended attributes
Solution: Add extended attribute support for linux

It's been a long standing issue, that if you write a file with extended
attributes and backupcopy is set to no, the file will loose the extended
attributes.

So this patch adds support for retrieving the extended attributes and
copying it to the new file. It currently only works on linux, mainly
because I don't know the different APIs for other systems (BSD, MacOSX and
Solaris).  On linux, this should be supported since Kernel 2.4 or
something, so this should be pretty safe to use now.

Enable the extended attribute support with normal builds.

I also added it explicitly to the :version output as well as make it
able to check using `:echo has("xattr")`, to have users easily check
that this is available.

In contrast to the similar support for SELINUX and SMACK support (which
also internally uses extended attributes), I have made this a FEAT_XATTR
define, instead of the similar HAVE_XATTR.

Add a test and change CI to include relevant packages so that CI can
test that extended attributes are correctly written.

closes: #306
closes: #13203

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-30 12:49:18 +02:00
zeertzjq
1f025b01e2 patch 9.0.1961: 'listchars' completion misses "multispace" and "leadmultispace"
Problem:  Cmdline completion for 'listchars' fields doesn't include
          "multispace" and "leadmultispace" (after 9.0.1958).
Solution: Include "multispace" and "leadmultispace" in lcstab.

closes: #13225

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-30 12:43:07 +02:00
Yee Cheng Chin
f7f746b167 patch 9.0.1960: Make CI checks more strict
Problem:  Make CI checks more strict
Solution: Add -Wstrict-prototypes -Wmissing-prototypes to CI,
          fix uncovered problems

Add -Wstrict-prototypes -Wmissing-prototypes warnings check to CI

Add two new warnings to CI, silence some Perl related build-warnings:

- `strict-prototypes` helps prevent declaring a function with an empty
  argument list, e.g. `int func()`. In C++, that's equivalent to `int
  func(void)`, but in C, that means a function that can take any number
  of arguments which is rarely what we want.

- `missing-prototypes` makes sure we use `static` for file-only internal
  functions. Non-static functions should have been declared on a
  prototype file.

- Add `no-compound-token-split-by-macro` to the perl cflags, since it
  throws out a bunch of perl-related warnings that make the CI log
  unnecessary verbose and hard to read. This seems to happen only with
  clang 12 and above.

When applying those changes, it already uncovered a few warnings, so fix
up the code as well (fix prototypes, make the code static, remove
shadowed var declaration)

GTK header needs to have #pragma warning suppressiong because GTK2
headers will warn on `-Wstrict-prototypes`, and it's included by gui.h
and so we can't just turn off the warning in a couple files.

closes: #13223
closes: #13226

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-09-30 12:32:37 +02:00
Yegappan Lakshmanan
f3b68d4759 patch 9.0.1959: Vim9: methods parameters and types are covariant
Problem:  Vim9: methods parameters and types are covariant
Solution: Support contra-variant type check for object method arguments
          (similar to Dart).

closes: #12965
closes: #13221

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-29 22:50:02 +02:00
Yee Cheng Chin
900894b09a patch 9.0.1958: cannot complete option values
Problem:  cannot complete option values
Solution: Add completion functions for several options

Add cmdline tab-completion for setting string options

Add tab-completion for setting string options on the cmdline using
`:set=` (along with `:set+=` and `:set-=`).

The existing tab completion for setting options currently only works
when nothing is typed yet, and it only fills in with the existing value,
e.g. when the user does `:set diffopt=<Tab>` it will be completed to
`set diffopt=internal,filler,closeoff` and nothing else. This isn't too
useful as a user usually wants auto-complete to suggest all the possible
values, such as 'iblank', or 'algorithm:patience'.

For set= and set+=, this adds a new optional callback function for each
option that can be invoked when doing completion. This allows for each
option to have control over how completion works. For example, in
'diffopt', it will suggest the default enumeration, but if `algorithm:`
is selected, it will further suggest different algorithm types like
'meyers' and 'patience'. When using set=, the existing option value will
be filled in as the first choice to preserve the existing behavior. When
using set+= this won't happen as it doesn't make sense.

For flag list options (e.g. 'mouse' and 'guioptions'), completion will
take into account existing typed values (and in the case of set+=, the
existing option value) to make sure it doesn't suggest duplicates.

For set-=, there is a new `ExpandSettingSubtract` function which will
handle flag list and comma-separated options smartly, by only suggesting
values that currently exist in the option.

Note that Vim has some existing code that adds special handling for
'filetype', 'syntax', and misc dir options like 'backupdir'. This change
preserves them as they already work, instead of converting to the new
callback API for each option.

closes: #13182

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-09-29 20:42:32 +02:00
Gregory Anders
3695d0e41b patch 9.0.1957: termcap options should change when setting keyprotocol
Problem:  termcap options should change on keyprotocol setting
Solution: Apply termcap entries when 'keyprotocol' changes

When the 'keyprotocol' option was set after startup (including in a
user's .vimrc) the termcap entries associated with the matching protocol
were not applied. Thus, setting the option has no affect.

When 'keyprotocol' is changed it should also update the termcap entries.

closes: #13211

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Gregory Anders <greg@gpanders.com>
2023-09-29 20:17:20 +02:00
zeertzjq
28a23602e8 patch 9.0.1956: Custom completion skips orig cmdline if it invokes glob()
Problem:  Custom cmdline completion skips original cmdline when pressing
          Ctrl-P at first match if completion function invokes glob().
Solution: Move orig_save into struct expand_T.

closes: #13216

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-29 19:58:35 +02:00
Ernie Rael
ee865f37ac patch 9.0.1955: Vim9: lockvar issues with objects/classes
Problem:  Vim9: lockvar issues with objects/classes
Solution: fix `get_lhs()` object/class access and avoid `SEGV`,
          make error messages more accurate.

- `get_lval()` detects/returns object/class access
- `compile_lock_unlock()` generate code for bare static and obj_arg access
- `do_lock_var()` check lval for `ll_object`/`ll_class` and fail if so.

Details:
- Add `ll_object`/`ll_class`/`ll_oi` to `lval_T`.
- Add `lockunlock_T` to `isn_T` for `is_arg` to specify handling of `lval_root` in `get_lval()`.
- In `get_lval()`, fill in `ll_object`/`ll_class`/`ll_oi` as needed; when no `[idx] or .key`, check lval_root on the way out.
- In `do_lock_var()` check for `ll_object`/`ll_class`; also bullet proof ll_dict case
  and give `Dictionay required` if problem. (not needed to avoid lockvar crash anymore)
- In `compile_lock_unlock()` compile for the class variable and func arg cases.

closes: #13174

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
2023-09-29 19:53:55 +02:00
Ken Takata
112431f217 patch 9.0.1954: CI: change netrw label in labeller bot
Problem:  CI: change netrw label in labeller bot
Solution: Rename it to 'plugin-netrw'

closes: #13217

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
2023-09-29 19:48:09 +02:00
Ken Takata
789b8854d2 patch 9.0.1953: Misplaced comment in errors.h
Problem:  Misplaced comment in errors.h
Solution: Move it up

closes: #13218

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
2023-09-29 19:45:42 +02:00
Yegappan Lakshmanan
5a05d374d3 patch 9.0.1952: Vim9: unused static field
Problem:  Vim9: unused static field
Solution: remove it and simplify code

closes: #13220

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-29 19:44:25 +02:00
Christian Brabandt
02902b547b runtime(doc): text-objects: document how escaped delimiters are handled
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-29 00:10:04 +02:00
Yegappan Lakshmanan
b90e3bc491 patch 9.0.1951: Vim9: hard to debug vim9_class errors from CI
Problem:  Vim9: hard to debug vim9_class errors from CI
Solution: Include the line number in assert_xxx() calls.  Include the
          entire error message in the tests.  Fix the indentation in the
          test file.  Add tags for new error codes.

closes: #13206

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-28 23:16:35 +02:00
Yegappan Lakshmanan
413f83990f patch 9.0.1950: Vim9: error codes spread out
Problem:  Vim9: error codes spread out
Solution: group them together and reserve 100
          more for future use

Reserve 100 error codes for future enhancements to the Vim9 class
support

closes: #13207

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-28 22:46:37 +02:00
Yegappan Lakshmanan
f057aca1cc patch 9.0.1949: Vim9: allows reserved keywords as members
Problem:  Vim9: allows reserved keywords as members
Solution: Disallow reserved keywords, disallow
          duplicate object and class variables

closes: #13209

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-28 22:28:15 +02:00
h-east
db38552dcd patch 9.0.1948: Vim9: object variable "this." should only be used in constructor
Problem:  Vim9: object variable "this." should only be used in
          constructor
Solution: Disallow to this in normal object methods (other than
          constructors)

closes: #13152
closes: #13212

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: h-east <h.east.727@gmail.com>
2023-09-28 22:18:19 +02:00
Ken Takata
03ca4002c1 patch 9.0.1947: Bash Expansion test fails on Windows/MacOS
Problem:  Bash Expansion test fails on Windows/MacOS
Solution: Disable Test_glob_extended_bash for now

This test doesn't work on Windows even if bash can be executed, since
the globstar functionality has only been enabled in Unix builds of Vim
(Commit 9eb1ce5315, patch 9.0.1946).

closes: #13205

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
2023-09-28 21:59:58 +02:00
Christian Brabandt
e845b38dab runtime(doc): regenerate xxd manpage
Commit f6fc255e8d (v9.0.1834) updated xxd.1 but the xxd.man
page wasn't re-generated. So let's just regenerate it now.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-27 23:33:39 +02:00
Christian Brabandt
9eb1ce5315 patch 9.0.1946: filename expansion using ** in bash may fail
Problem:  filename expansion using ** in bash may fail
Solution: Try to enable the globstar setting

Starting with bash 4.0 it supports extended globbing using the globstar
shell option. This makes matching recursively below a certain directory
using the ** pattern work as expected nowadays.  However, we need to
explicitly enable this using the 'shopt -s globstar' bash command.

So let's check the bash environment variable $BASH_VERSINFO (which is
supported since bash 3.0 and conditionally enable the globstar option,
if the major version is at least 4. For older bashs, this at least
shouldn't cause errors (unless one is using really ancient bash 2.X or
something).

closes: #13002
closes: #13144

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-27 19:08:25 +02:00
Yegappan Lakshmanan
2dede3dbfa patch 9.0.1945: Vim9: missing support for ro-vars in interface
Problem:  Vim9: missing support for ro-vars in interface
Solution: Support only read-only object variables in an interface,
          add additional checks when parsing class definitions.

closes: #13183
cloess: #13184
cloess: #13185.
closes: #13188

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-27 19:02:01 +02:00
zeertzjq
5277cfaf8a runtime(doc): mention mouse scrolling in scrollbind-quickadj (#13190)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-27 19:00:12 +02:00
Josef Litoš
54f70cf078 runtime(swayconfig): Update syntax file (#13192)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-27 18:58:15 +02:00
Josef Litoš
02774f99ce runtime(i3config): update i3config syntax (#13191)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-27 18:57:24 +02:00
Jakson Alves de Aquino
3474594239 runtime(rmd) Update ftplugin and syntax files (#13193)
ftplugin/rmd.vim:

  - Set 'commentstring' dynamically according to code region.

syntax/rmd.vim:

  - Include syntax highlighting of fenced languages dynamically.
  - Add conceal char for line break.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-27 18:56:02 +02:00
Yegappan Lakshmanan
a76fbe6e00 patch 9.0.1944: Vim9: function instruction pointer invalidated
Problem:  Vim9: function instruction pointer invalidated
Solution: Use the funcref index instead of the instruction pointer

closes: #13178
closes: #13196

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-27 18:53:10 +02:00
Ivan Pešić
91adcbdcc1 translation(sr): Update Serbian messages translation
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-27 18:48:42 +02:00
Philip H
f109bf93c9 patch 9.0.1943: CI not run with clang-17
Problem:  CI not run with clang-17
Solution: Update CI to use clang-17

closes: #12745

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2023-09-25 21:05:00 +02:00
Yegappan Lakshmanan
c1946267f2 patch 9.0.1942: Vim9: execution stack invalidated with null object
Problem:  Vim9: execution stack invalidated with null object
Solution: Check for a null object before adjusting the execution stack

closes: #13186

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-25 21:00:46 +02:00
Eisuke Kawashima
54e1f56cf2 runtime(sh): only invoke bash help in ftplugin if it has been detected to be bash (#13171)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-25 19:40:45 +01:00
Yegappan Lakshmanan
3aa114463f patch 9.0.1941: Memory leak detected
Problem:  Memory leak detected (after 9.0.1928)
Solution: Free arg_objm in get_lambda_tv()

closes: #13181

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-25 12:13:17 +02:00
Yegappan Lakshmanan
e1b95f5252 runtime(doc): Update help tags (#13180)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-25 08:19:48 +01:00
Christian Brabandt
ec8deb092c patch 9.0.1940: wrong upstream version in libvterm README
Problem:  wrong upstream version in libvterm README
Solution: correct version to 839

related: #12746

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-24 23:43:38 +02:00
Yegappan Lakshmanan
b80ae6cec3 patch 9.0.1939: still a problem when processing LSP RPC requests
Problem:  still a problem when processing LSP RPC requests
Solution: When processing async LSP RPC requests, compare sequence
          numbers only in response messages

A LSP request message can be sent to the language server either
synchronously (ch_evalexpr) or asynchronously (ch_sendexpr). In both
cases, when looking for response messages by using the sequence number,
LSP requests messages from the language server with the same sequence
number should not be used. Patch 9.0.1927 fixed this issue for
synchronous requests. This PR fixes the issue for asynchronous requests
and adds additional tests.

closes: #13158

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-24 23:38:46 +02:00
Yegappan Lakshmanan
ceffca683b runtime(todo): Update Vim9 class items (#13148)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-24 23:36:56 +02:00
Yegappan Lakshmanan
c3b315f496 runtime(doc): Vim9: Consistenly use class/object variable and class/object method in help (#13149)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-24 23:36:17 +02:00
zeertzjq
abc808112e patch 9.0.1938: multispace wrong when scrolling horizontally
Problem:  multispace wrong when scrolling horizontally
Solution: Update position in "multispace" or "leadmultispace" also in
          skipped chars. Reorder conditions to be more consistent.

closes: #13145
closes: #13147

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-24 23:32:18 +02:00
zeertzjq
46a0582ffa patch 9.0.1937: missing test for mouse click + 'virtedit'
Problem:  missing test for mouse click + 'virtedit'
Solution: Add test for clicking after eol with 'virtualedit' and wrapped
          line

closes: #13157

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-24 23:30:03 +02:00
Isao Sato
e6fca0e822 patch 9.0.1936: test: using wrong expected message in test_crypt
Problem:  test: using wrong expected message in test_crypt
Solution: make use of single quotes

closes: #13151

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Isao Sato <svardew@gmail.com>
2023-09-24 23:27:25 +02:00
RestorerZ
7fe8f43f49 patch 9.0.1935: Vim9: not consistent error messages
Problem:  Vim9: not consistent error messages
Solution: Make error messages more consistent. Use "variable" for
          (object/class) member

closes: #13155

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: RestorerZ <restorer@mail2k.ru>
2023-09-24 23:21:24 +02:00
zeertzjq
46bdae036a patch 9.0.1934: :bwipe fails after switching window from aucmd_win.
Problem:  :bwipe fails after switching window from aucmd_win.
Solution: Decrement b_nwindows after switching back to aucmd_win.

closes: #13160

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-24 23:17:14 +02:00
zeertzjq
edcba96c00 patch 9.0.1933: Can change the type of a v: variable using if_lua
Problem:  Can change the type of a v: variable using if_lua.
Solution: Add additional handling of v: variables like :let.

closes: #13161

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-24 23:13:51 +02:00
Yegappan Lakshmanan
7398f367d5 patch 9.0.1932: Vim9: error when using null object constructor
Problem:  Vim9: error when using null object constructor
Solution: Check for a null object only when calling an object method

closes: #13154
closes: #13163

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-24 23:09:10 +02:00
Dominique Pellé
960822a11f runtime(doc): grammar fixes in doc (#13164)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-24 23:07:39 +02:00
Yegappan Lakshmanan
7c948644fb runtime(doc): Update the version9.txt with a template for version 9.1 enhancements (#13165)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-24 23:07:03 +02:00
a5ob7r
790f9a890c runtime(doc): Add a missing '<' to the help of strutf16len() (#13168)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-24 23:05:47 +02:00
Dominique Pellé
ca0ffc0d63 patch 9.0.1931: make test_compilers fails on ubuntu
Problem:  make test_compilers fails on ubuntu
Solution: set LC_ALL=C

fix: make test_compiler failed on xubuntu 22.04.3

Problem: 'make test_compiler' failed on Linux xubuntu 22.04.3 but
         succeeded on e.g. macOS. To reproduce:
```
$ ./configure --with-features=huge --enable-gui=no --enable-perlinterp=yes
$ make -j12
$ cd vim/src/testdir
$ make test_compiler
...snip...
Found errors in Test_compiler():
command line..script /home/dope/sb/vim/src/testdir/runtest.vim[601]..function RunTheTest[54]..Test_compiler line 24: command did not fail: clist
command line..script /home/dope/sb/vim/src/testdir/runtest.vim[601]..function RunTheTest[54]..Test_compiler line 30: Pattern '\\n \\d\\+ Xfoo.pl:3: Global symbol "$foo" requires explicit package name' does not match '\n19 Xfoo.pl:3: Global symbol "$foo" requires explicit package name (did you forget to declare "my $foo"?)'
make: *** [Makefile:70: test_compiler] Error 1
```
Solution: set `LC_ALL` to "C" in `Test_compiler()`

closes: #13173

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Dominique Pellé <dominique.pelle@tomtom.com>
2023-09-24 22:57:41 +02:00
Remy Bos
8ffcb47a43 runtime(tutor): fix typo in tutor.nl (#13175)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-24 22:54:30 +02:00
Dominique Pellé
4927bc7d27 patch 9.0.1930: compiler warnings with clang-17
Problem:  compiler warnings with clang-17
Solution: Fix function prototypes and function pointer

fix: clang compilation warnings with -Wstrict-prototypes

Change fixes this kind of compilation warnings with clang:
```
proto/if_python3.pro:13:20: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
   13 | int python3_version();
      |                    ^
      |                     void
```

closes: #13166

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Dominique Pellé <dominique.pelle@tomtom.com>
2023-09-24 16:16:06 +02:00
Dominique Pellé
99c3849a92 patch 9.0.1929: runtime tests fail with tiny vim
Problem:  runtime tests fail with tiny vim
Solution: check for tiny vim, run runtime tests in CI
          even for tiny version

closes: #13169
closes: #13170

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Dominique Pellé <dominique.pelle@tomtom.com>
2023-09-24 16:09:31 +02:00
h-east
b895b0fabc patch 9.0.1928: Vim9: constructor type checking bug
Problem:  Vim9: constructor type checking bug
Solution: Fix class constructor regression

closes: #13102
closes: #13113

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: h-east <h.east.727@gmail.com>
2023-09-24 15:46:31 +02:00
Christian Brabandt
ceee7a808c patch 9.0.1927: patch 1916 (fixed terminal size) not optimal
Problem:  patch 1916 (fixed terminal size) not optimal
Solution: Add defines to make it easier changeable later

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-21 16:57:42 +02:00
Ernie Rael
696270bcae patch 9.0.1926: Vim9: not enough info in error message
Problem:  Vim9: not enough info in error message
Solution: Add class name, change member to variable, quote names

closes: #13136

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
2023-09-21 16:42:28 +02:00
Yee Cheng Chin
02c51b1dd8 patch 9.0.1925: if_python: still undefined behaviour with function pointer
Problem:  if_python: still undefined behaviour with function pointer
Solution: fix remaining problems

Fix remaining issues in the if_python code in casting incompatible
function pointers leading to Clang 17 giving runtime errors during
UBSAN.

closes: #13140

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-09-21 16:40:12 +02:00
Yegappan Lakshmanan
1926ae4184 patch 9.0.1924: LSP server message still wrongly handled (after 9.0.1922)
Problem:  LSP server message still wrongly handled (after 9.0.1922)
Solution: Handle 'method' messages properly, don't discard them, add
          tests.

closes: #13141

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-21 16:36:28 +02:00
zeertzjq
db54e989b5 patch 9.0.1923: curswant wrong on click with 've' and 'wrap' set
Problem:  curswant wrong on click with 've' and 'wrap' set
Solution: Add w_leftcol to mouse click column.

closes: #13142

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-21 16:33:09 +02:00
zeertzjq
a7aba6ca50 runtime(doc): format jumplist examples more consistently (#13137)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-21 07:22:57 +01:00
Yegappan Lakshmanan
78c5a5abc6 patch 9.0.1922: LSP server request message is misinterpreted as a response message
Problem:  LSP server request message is misinterpreted as a response message
Solution: Check that the message does not have the "message" field

closes: #13133

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-20 20:32:55 +02:00
Yegappan Lakshmanan
87018255e3 patch 9.0.1921: not possible to use the jumplist like a stack
Problem:  not possible to use the jumplist like a stack
Solution: Add the 'jumpoptions' setting to make the jumplist
          a stack.

Add an option for using jumplist like tag stack

related: #7738
closes: #13134

ported from NeoVim:

- https://neovim.io/doc/user/motion.html#jumplist-stack
- neovim/neovim@39094b3
- neovim/neovim#11530
- https://vi.stackexchange.com/questions/18344/how-to-change-jumplist-behavior

Based on the feedback in the previous PR, it looks like many people like
this option.

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Co-authored-by: butwerenotthereyet <58348703+butwerenotthereyet@users.noreply.github.com>
2023-09-20 20:25:17 +02:00
Ernie Rael
98e68c07ce patch 9.0.1920: Vim9: cannot write public var in nested object
Problem:  Vim9: cannot write public var in nested object
Solution: Write variable in nested read-only object reference.
          Also test write fails.

closes: #13130
closes: #13131

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
2023-09-20 20:13:06 +02:00
zeertzjq
03cd697d63 patch 9.0.1919: Wrong curswant when clicking on empty line or with vsplits
Problem:  Wrong curswant when clicking on empty line or with vsplits.
Solution: Don't check for ScreenCols[] before the start of the window
          and handle empty line properly.

closes: #13132

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-20 20:08:40 +02:00
Matt Polzin
5790a54166 patch 9.0.1918: No filetype detection for Authzed filetypes
Problem:  No filetype detection for Authzed filetypes
Solution: Detect the *.zed file extension as authzed filetype

closes: #13129

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Matt Polzin <mpolzin@workwithopal.com>
2023-09-20 20:03:52 +02:00
Yee Cheng Chin
d606fccf6f patch 9.0.1917: undefined behaviour with python function pointer
Problem:  undefined behaviour with python function pointer
Solution: correctly cast function pointers from void

Fix more undefined behaviors in if_python

Fix remaining UBSAN errors from Clang 17 in if_python in casting
function pointers.

Also fix a mistake where `PyMem_Free()` should be returning void, by the
dynamic build is mistakenly casting it as a function that returns an
int.

closes: #13128

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-09-20 19:59:47 +02:00
Christian Brabandt
aa64ba1587 patch 9.0.1916: Crash when allocating large terminal screen
Problem:  Crash when allocating large terminal screen
Solution: Don't allow values > 1000 for terminal
          screen columns and rows

closes: #13126

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-19 21:16:52 +02:00
Christian Brabandt
476733f3d0 patch 9.0.1915: r_CTRL-C works differently in visual mode
Problem:  r_CTRL-C works differently in visual mode
Solution: Make r_CTRL-C behave consistent in visual mode
          in terminal and Windows GUI

in visual mode, r CTRL-C behaves strange in Unix like environments. It
seems to end visual mode, but still is waiting for few more chars,
however it never seems to replace it by any characters and eventually
just returns back into normal mode.

In contrast in Windows GUI mode, r_CTRL-C replaces in the selected area
all characters by a literal CTRL-C.

Not sure why it behaves like this. It seems in the Windows GUI, got_int
is not set and therefore behaves as if any other normal character has
been pressed.

So remove the special casing of what happens when got_int is set and
make it always behave like in Windows GUI mode. Add a test to verify it
always behaves like replacing in the selected area each selected
character by a literal CTRL-C.

closes: #13091
closes: #13112

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-19 20:45:07 +02:00
Yegappan Lakshmanan
1db1514365 patch 9.0.1914: Vim9: few issues when accessing object members
Problem:  Vim9: few issues when accessing object members
Solution: When calling an object method, check for null object.
          Accessing a Dict object member doesn't work.

closes: #13119
closes: #13123
closes: #13124

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-19 20:36:02 +02:00
Yee Cheng Chin
2ce070c27a patch 9.0.1913: if_python: undefined behaviour for function pointers
Problem:  if_python: undefined behaviour for function pointers
Solution: Fix if_python undefined behavior for function pointer casts

Identified by clang 17 UBSAN (see #12745). Make sure to cast function
pointers with the same signature only.

closes: #13122

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-09-19 20:30:22 +02:00
Christian Brabandt
6f00d17e8d patch 9.0.1912: Cirrus-CI running out of credits
Problem:  Cirrus-CI running out of credits
Solution: disable Cirrus-CI for now

We are running out of credits for Cirrus CI already at the middle of the
month and unfortunately this means our CI now consistently fails. This
all hapens because cirrus ci is not enforcing the free-tier limits (see also
https://cirrus-ci.org/blog/2023/07/17/limiting-free-usage-of-cirrus-ci/).

Perhaps at the beginning of the next month we can revisit and
enable just a build without testing it.  Hopefully this is won't take
too many credits and we can at least verify that building works.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-19 20:19:08 +02:00
Ernie Rael
3da696db6a patch 9.0.1911: Vim9: segfault with null object and instanceof()
Problem:  Vim9: segfault with null object and instanceof()
Solution: return early

closes: #13121

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
2023-09-19 20:14:18 +02:00
Christian Brabandt
346ac1429c runtime(doc): add help tag describing object-selection
closes: #13114

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-18 20:12:22 +02:00
Sevan Janiyan
063c562a37 patch 9.0.1910: Mac OS X: missing sound support on older versions
Problem:  Mac OS X: missing sound support on older versions
Solution: Check Macro MAC_OS_X_VERSION_MIN_REQUIRED

Extend guard for sound support on OS X

Fixes build on legacy versions where required coreaudio functionality
may not be available. NSSoundDelegate apparently was introduced in Snow
Leopard yet the build breaks on it. Guarding off enabling sound support
to El Capitan as that's the next version I had access to for testing (it
may work on earlier versions)
https://developer.apple.com/documentation/appkit/nssounddelegate Vim
builds on OS X Tiger 10.4 and newer with this change.

closes: #13115

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Sevan Janiyan <venture37@geeklan.co.uk>
2023-09-18 20:04:32 +02:00
Yegappan Lakshmanan
00cd18222e patch 9.0.1909: Vim9: problem calling class method from other class
Problem:  Vim9: problem calling class method from other class
Solution: Fix this problem, fix readonly object access, update error
          messages.

Calling a class method from another method without the class name prefix
doesn't work properly.

A readonly object variable is modifiable outside the class using a
nested object assignment.

Remove the unused E1338 error message.

Update error messages.

closes: #13116

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-18 19:56:49 +02:00
Yee Cheng Chin
d25021cf03 patch 9.0.1908: undefined behaviour upper/lower function ptrs
Problem:  undefined behaviour upper/lower function ptrs
Solution: Fix UBSAN error in regexp and simplify upper/lowercase
          modifier code

The implementation of \u / \U / \l / \L modifiers in the substitute
command relies on remembering the state by setting function pointers on
func_all/func_one in the code. The code signature of `fptr_T` is
supposed to return void* (due to C function signatures not being able to
return itself due to type recursion), and the definition of the
functions (e.g. to_Upper) didn't follow this rule, and so the code tries
to cast functions of different signatures, resulting in undefined
behavior error under UBSAN in Clang 17. See #12745.

We could just fix `do_Upper`/etc to just return void*, which would fix
the problem. However, these functions actually do not need to return
anything at all. It used to be the case that there was only one pointer
"func" to store the pointer, which is why the function needs to either
return itself or NULL to indicate whether it's a one time or ongoing
modification. However, c2c355df6f
(7.3.873) already made that obsolete by introducing `func_one` and
`func_all` to store one-time and ongoing operations separately, so these
functions don't actually need to return anything anymore because it's
implicit whether it's a one-time or ongoing operation. Simplify the code
to reflect that.

closes: #13117

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-09-18 19:51:56 +02:00
Christian Brabandt
d8b86c937a runtime(netrw): fix filetype detection for remote editing files
closes: #12990
closes: #12992

this partially reverses commit 71badf9 by commenting out the line that
intentionally sets the filetype to an empty string.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-17 18:52:56 +02:00
dkearns
e30d8e4ce0 runtime(kotlin): Add Kotlin runtime files (#13110)
Closes udalov/kotlin-vim#39

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-17 18:51:22 +02:00
Romain Beauxis
6b5efcdd8e patch 9.0.1907: No support for liquidsoap filetypes
Problem:  No support for liquidsoap filetypes
Solution: Add liquidsoap filetype detection code

closes: #13111

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Romain Beauxis <toots@rastageeks.org>
2023-09-17 18:49:20 +02:00
Yegappan Lakshmanan
92d9ee5f4c patch 9.0.1906: Vim9: Interfaces should not support class methods and variables
Problem:  Vim9: Interfaces should not support class methods and
          variables
Solution: Make sure interface follow the interface specification

Vim9 interface changes to follow the new interface specification:

1) An interface can have only read-only and read-write instance
   variables.
2) An interface can have only public instance methods.
3) An interface cannot have class variables and class methods.
4) An interface cannot have private instance variables and private
   instance methods.
5) A interface can extend another interface using "extends". The
   sub-interface gets all the variables and methods in the super
   interface.

That means:
- Interfaces should not support class methods and variables.
- Adjust error numbers and add additional tests.
- Interface methods can be defined in one of the super classes.
- Interface variables can be defined in one of the super classes.
  and instance variables can be repeated in sub interfaces.
- Check the class variable types with the type in interface.

closes: #13100

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-17 17:03:19 +02:00
dundargoc
0483e49f90 patch 9.0.1905: FEAT_FLOAT no longer defined
Problem:  FEAT_FLOAT no longer defined
Solution: Remove last existing FEAT_FLOAT ifdefs in
          message_test

Remove FEAT_FLOAT as that should always be true

FEAT_FLOAT has been removed in v9.0.0491 (73e28dcc61) but
unfortunately, it was forgotten to remove it from message_test.c. So
let's remove the last mentioned ifdefs which are now unused.

closes: #13106

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: dundargoc <gocdundar@gmail.com>
2023-09-17 16:58:22 +02:00
dundargoc
e6059c321b patch 9.0.1904: Cirrus-CI fails because we have used all credits
Problem:  Cirrus-CI fails because we have used all credits
Solution: Remove FreeBSD 13.1 and MacOS M1

Cirrus CI has started introducing monthly limits. Vim has exceeded the
monthly limit which means our CI unfortunately starts to fail. So let's
remove some CI tasks, so that in the future we won't run out of credits
so fast.

closes: #13108

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: dundargoc <gocdundar@gmail.com>
2023-09-17 16:53:18 +02:00
Christian Brabandt
177437cc6f doc(INSTALLpc): mention additional packages for msys2
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-17 16:36:33 +02:00
Christian Brabandt
a66feb5fb5 patch 9.0.1903: CI fails because snd-dummy modules missing
Problem:  Github Actions fails because snd-dummy modules missing
          in current runner images
Solution: ignore modprobe error

related: actions/runner-images#8295

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-16 18:29:42 +02:00
Yee Cheng Chin
249a208803 runtime(man): Man plugin does not respect 'gdefault'
Fix the issue introduced by #12557. `:substitute` commands in plugins
need to take into account whether `gdefault` is set or not because
that depends on the user.

closes: #13097

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-16 18:12:14 +02:00
Yegappan Lakshmanan
e2deb7e598 patch 9.0.1902: Vim9: Coverity complains about dead code
Problem:  Vim9: Coverity complains about dead code
Solution: Copy only object methods from the super class
          to a subclass when extending a class.  Fix
          Coverity warning.

closes: #13103

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-16 18:05:07 +02:00
Ken Takata
ad29f6af0a patch 9.0.1901: win32: not correctly freeing environment
Problem:  win32: not correctly freeing environment
Solution: After we call GetEnvironmentStringsW, we should call
          FreeEnvironmentStringsW

closes: #13096
closes: #13094

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
2023-09-16 13:56:02 +02:00
Yee Cheng Chin
e7d79eb98a patch 9.0.1900: Configure script uses non-portable == comparison
Problem:  Configure script uses non-portable == comparison
Solution: Use the standard and portable "=" instead

closes: #13095
closes: #13099

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-09-16 13:38:26 +02:00
Christian Brabandt
ffb13674d1 patch 9.0.1899: potential buffer overflow in PBYTE macro
Problem:  potential buffer overflow in PBYTE macro
Solution: Check returned memline length

closes: #13083

the PBYTE macro is used to put byte c at a position lp of the returned
memline. However, in case of unexpected errors ml_get_buf() may return
either "???" or an empty line in which case it is quite likely that we
are causing a buffer overrun.

Therefore, switch the macro PBYTE (which is only used in ops.c anyhow)
to a function, that verifies that we will only try to access within the
given length of the buffer.

Also, since the macro is only used in ops.c, move the definition from
macros.h to ops.c

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-15 20:22:02 +02:00
Yegappan Lakshmanan
c30a90d9b2 patch 9.0.1898: Vim9: restrict access to static vars
Problem:  Vim9: restrict access to static vars and methods
Solution: Class members are accesible only from the class where they are
          defined.

Based on the #13004 discussion, the following changes are made:

    1) Static variables and methods are accessible only using the class
       name and inside the class where they are defined.
    2) Static variables and methods can be used without the class name in
       the class where they are defined.
    3) Static variables of a super class are not copied to the sub class.
    4) A sub class can declare a class variable with the same name as the
       super class.
    5) When a method or member is found during compilation, use more
       specific error messages.

This aligns the Vim9 class variable/method implementation with the Dart
implementation.

Also while at it, ignore duplicate class and object methods.

The access level of an object method can however be changed in a
subclass.

For the tests, use the new CheckSourceFailure() function instead of the
CheckScriptFailure() function in the tests.

closes: #13086

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-15 20:14:55 +02:00
dkearns
35928ee8f8 runtime(vim): Highlight all :loadkeymap abbreviations in vim syntax (#13092)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-15 20:12:50 +02:00
dkearns
c1f8bb37c6 runtime(forth): Fix :unlet error in ftplugin (#13090)
Fixes #13089.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-15 15:47:06 +01:00
Christian Brabandt
6ffcc58be3 runtime(help): Updated documentation on editorconfig
Add a small section about the distributed Editorconfig plugin at :h
usr_05.txt just below the matchit plugin.  While editing that help
document, also add a bit of more documentation about standard plugins
and local help file additions.

Regenerate $VIMRUNTIME/doc/tags file with all the new tags from the rust
runtime files.

While at it, update the Editorconfig help page (and re-generate the
helptags file).

closes: #13078

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-12 21:08:54 +02:00
Josef Litoš
8b2457a381 runtime(swayconfig): improve syntax highlighting (#13060)
* syntax(swayconfig): improved highlighting
* syntax(swayconfig): adapt to i3config structure

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-12 20:24:47 +02:00
Gregory Anders
fc93594d56 runtime(rust): sync rust runtime files with upstream (#13075)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-12 20:23:38 +02:00
Josef Litoš
f5356bf675 runtime(i3config): syntax structure cleanup (#13080)
* syntax(i3config): improved i3config highlighting
* syntax(i3config): refactor structure

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-12 20:20:25 +02:00
Christian Brabandt
596ad66d1d runtime(doc): documentation updates
This is a collection of various improvements to the help pages

closes #12790

Co-authored-by: Houl <anwoku@yahoo.de>
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Co-authored-by: Adri Verhoef <a3@a3.xs4all.nl>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-11 20:23:11 +02:00
Josef Litoš
62145db91b syntax(i3config): improved i3config highlighting (#13054)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-11 20:12:48 +02:00
Christian Brabandt
504543f98b patch 9.0.1897: Vim9: confusing error with .= in compiled functions
Problem:  Vim9: confusing error with .= in compiled functions
Solution: Check in error condition, if .= was attempted and in that case
          give a different error message.

closes: #12972
closes: #13066

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-11 20:08:50 +02:00
zeertzjq
6b9c202549 patch 9.0.1896: "below" virtual text doesn't work with 'rightleft'
Problem:  "below" virtual text doesn't work with 'rightleft'.
Solution: Use column from right border with 'rightleft'.

closes: #13071

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-11 20:01:17 +02:00
Ernie Rael
4d00b835c4 patch 9.0.1895: Vim9: finding object method/member is inefficient
Problem:  Vim9: finding method/member is inefficient
Solution: Use lookups

closes: #13073

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
2023-09-11 19:57:52 +02:00
Doug Kearns
f787ee8451 runtime(doc): Add g:c_syntax_for_h to filetype-overrule docs
closes: #13074

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-11 19:50:09 +02:00
dependabot[bot]
213c323184 CI: Bump actions/checkout from 3 to 4 (#13072)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-11 19:43:33 +02:00
Christian Brabandt
e5f7cd0a60 patch 9.0.1894: CI: trailing whitespace in tests
Problem:  CI: trailing white space in tests
Solution: clean up the trailing white space

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-10 19:26:47 +02:00
Christian Brabandt
983d808674 patch 9.0.1893: CI: strptime test fails on BSD14
Problem:  CI: strptime test fails on BSD14
Solution: Skip the test

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-10 19:06:09 +02:00
Philip H
24a95f42b8 patch 9.0.1892: CI: no FreeBSD 14 support
Problem:  CI: no FreeBSD 14 support
Solution: Drop support for FreeBSD 12, add FreeBSD 14

closes: #13059

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2023-09-10 18:31:51 +02:00
Wu Yongwei
e7833e7347 runtime(masm): add support for AVX-2 and AVX-512 (#13061)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-10 18:27:31 +02:00
Mahmoud Abduljawad
0ce2c594d0 patch 9.0.1891: No runtime support for Mojo
Problem:  No runtime support for Mojo
Solution: Add basic filetype and syntax plugins

closes: #13062
closes: #13063

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Co-authored-by: Mahmoud Abduljawad <mahmoud@masaar.com>
2023-09-10 18:23:04 +02:00
Yegappan Lakshmanan
f36bbcd402 patch 9.0.1890: Vim9: lookup code for class/object repaeated
Problem:  Vim9: lookup code for class/object repaeated
Solution: Refactor and make use of lookup functions

closes: #13067

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-10 18:19:06 +02:00
Emil Ejbyfeldt
0661033075 runtime(scala): Fix Scala highlighting string literal as type param (#13070)
Since https://docs.scala-lang.org/sips/42.type.html which is implemented
in Scala 2.13 and in Scala 3 it possible to use string literals as
singleton types. So code like
```
someFunc["abc"]
```
is valid. Currently this code is not hightlighted correctly and worse if
there is an unclosed `(` in the string it breaks the formating in the
rest of the file.

I also submitted this patch to the mentioned project for this runtime
file: https://github.com/derekwyatt/vim-scala/pull/173 But there are no
commits there over the last 2 years and no response in the week since I
created it. Also the last change to the Scala syntax file:
https://github.com/vim/vim/pull/9594 is yet to be backported to that
repo. Therefore I am opening this PR as well to get some feedback on how
to proceed to get this fixed.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-10 18:16:51 +02:00
Yegappan Lakshmanan
0405405536 patch 9.0.1889: Vim9 static tests fail
Problem:  Vim9 static tests fail
Solution: Fix tests, make CI happy ;)

closes: #13064

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-10 18:12:56 +02:00
Andrii Sokolov
733bbcde77 runtime(nasm): updated syntax file
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-09 12:00:09 +02:00
Yegappan Lakshmanan
342f4f626e patch 9.0.1888: Vim9: Problem trying to invoke class method
Problem:  Vim9: Problem trying to invoke class method
Solution: Lookup the class method insider other classes

closes: #13055

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-09 11:37:23 +02:00
Yegappan Lakshmanan
23c92d93c1 patch 9.0.1887: Vim9: class members are accessible via object
Problem:  Vim9: class members are accessible via object
Solution: Disable class member variable access using an object

Class methods can be accessed only using the class name and cannot be
accessed using an object. To be consistent with this, do the same for
class member variables also. They can be accessed only using the class
name and not using an object.

closes: #13057

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-09 11:33:29 +02:00
Christian Brabandt
ee17b6f70d patch 9.0.1886: Various Typos
Problem:  Various Typos
Solution: Fix Typos

This is a collection of typo related commits.

closes: #12753
closes: #13016

Co-authored-by: Adri Verhoef <a3@a3.xs4all.nl>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
Co-authored-by: nuid64 <lvkuzvesov@proton.me>
Co-authored-by: Meng Xiangzhuo <aumo@foxmail.com>
Co-authored-by: Dominique Pellé <dominique.pelle@gmail.com>

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-09 11:31:38 +02:00
Yegappan Lakshmanan
7bcd25cad3 patch 9.0.1885: Vim9: no support for abstract methods
Problem:  Vim9: no support for abstract methods
Solution: Add support for defining abstract methods in an abstract class

closes: #13044
closes: #13046

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-08 19:29:31 +02:00
fritzophrenic
86cfb39030 runtime(tohtml): Update TOhtml to version 9.0v2 (#13050)
Modified behavior:
  - Change default value of g:html_use_input_for_pc from "fallback" to
    "none". This means with default settings, only the standards-based
    method to make special text unselectable is used. The old method
    relying on unspecified browser behavior for <input> tags is now only
    used if a user specifically enables it.
  - Officially deprecate g:use_xhtml option (in favor of
    g:html_use_xhtml) by issuing a warning message when used.

Bugfixes:
  - Fix issue #8547: LineNr and other special highlight groups did not
    get proper style rules defined when using "hi link".
  - Fix that diff filler was not properly added for deleted lines at the
    end of a buffer.

Other:
  - Refactored function definitions from long lists of strings to use
    :let-heredoc variable assignment instead.
  - Corrected deprecated "." string concatenation operator to ".."
    operator in more places.


Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-08 19:20:01 +02:00
Christ van Willegen
1bd2cb1169 patch 9.0.1884: Wrong order of arguments for error messages
Problem:  Wrong order of arguments for error messages
Solution: Reverse order or arguments for e_aptypes_is_null_nr_str

closes: #13051

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
2023-09-08 19:18:58 +02:00
dkearns
4e554d282c runtime(perl): Update ftplugin and indent files (#13052)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-08 19:16:03 +02:00
Yegappan Lakshmanan
cc0bcf4c9f patch 9.0.1883: Vim9: Calling an interface method using a child object fails
Problem:  Vim9: Calling an interface method using a child object fails
Solution: Search methods of parent class

When a class implementing an interface is extended by another class and
a child class instance is passed to a function that accepts the
interface, calling an interface method doesn't work properly.

closes: #13053

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-08 19:12:03 +02:00
Christian Brabandt
11d2aeeca4 runtime(doc): update help tags file
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-06 16:39:14 +02:00
Christian Brabandt
da200c2f78 patch 9.0.1882: Trailing white space in tests
Problem:  Trailing white space in tests
Solution: Delete it

This causes test_codestyle to fail, so we need to remove it again.
Hopefully that makes the CI green again.

Note: I will start using annotated tags from now on.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-06 21:12:24 +02:00
Christian Brabandt
5856b07795 patch 9.0.1881: Test_crash fails on Mac
Problem:  Test_crash fails on Mac
Solution: Skip test on Mac

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-06 20:53:46 +02:00
Ernie Rael
cf138d4ea5 patch 9.0.1880: Vim9: Need more tests for inheritance
Problem:  Vim9: Need more tests for inheritance
Solution: Add access tests and fixes.

`inside_class` fix from yegappan. `object_index_from_itf_index` fix
access of member on class extending class implementing interface.

Based on tests from Vim9: Class/Object member variable access control #12979

closes: #13032
related: #12979

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-06 20:45:03 +02:00
Christian Brabandt
f7ac0ef509 runtime: don't execute external commands when loading ftplugins
This is a followup to 816fbcc262 (patch
9.0.1833: [security] runtime file fixes)

It basically disables that external commands are run on loading of the
filetype plugin, **unless** the user has set the `g:plugin_exec = 1`
global variable in their configuration or for a specific filetype the
variable g:<filetype>_exec=1.

There are a few more plugins, that may execute system commands like
debchangelog, gitcommit, sh, racket, zsh, ps1 but those do at least
do not run those commands by default during loading of the filetype plugin
(there the command is mostly run as convenience for auto-completion or
to provide documentation lookup).

closes: #13034

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Tim Pope <vim@tpope.org>
2023-09-06 20:41:25 +02:00
Yegappan Lakshmanan
1689e847ff patch 9.0.1879: Vim9: incorrect duplicate class member detection
Problem:  Vim9: incorrect duplicate class member detection
Solution: Incorrect duplicate class member detection when variable names
          have the same prefix.  Not able to access class member variables
          using an object. Fix coding style issues

closes: #13042

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-06 20:23:23 +02:00
Philip H
1690ec64ff patch 9.0.1878: tests running sh have problems
Problem:  tests running sh have problems
Solution: Check that dash is installed

closes: #13040

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-06 20:20:07 +02:00
Christian Brabandt
18d2709aa1 patch 9.0.1877: missing test for patch 9.0.1873
Problem:  missing test for patch 9.0.1873
Solution: add a test trying to exchange windows

Add a test, making sure that switching windows is not allowed when
textlock is active, e.g. when running `:s/<pat>/\=func()/`

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-06 20:02:27 +02:00
Anton Sharonov
67c951df4c runtime(ftplugin): allow to exec if curdir is in PATH
In case the current directory is present as valid $PATH entry, it is OK
to call the program from it, even if vim curdir is in that same
directory.

(Without that patch, for instance, you will not be able to open .zip
files while your current directory is /bin)

closes: #13027

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-05 21:04:44 +02:00
zdohnal
9b04c50319 Filelist: Add missing directory crash (#13036)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-05 20:55:47 +02:00
Christian Brabandt
00cb247465 patch 9.0.1876: Vim9: parsing commands with newlines wrong
Problem:  Vim9: parsing commands with newlines wrong
Solution: Accept a '\n' for parsing lists and command arguments

closes: #13015
closes: #13020

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-05 20:53:46 +02:00
Yegappan Lakshmanan
28a60f898d patch 9.0.1875: Vim9: improve test for disassemble + static
Problem:  Vim9: improve test for disassemble + static
Solution: Add a Vim9 script disassemble test for an interface with
          static members
closes: #13037

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-05 20:44:32 +02:00
Christian Brabandt
1c7397f3f1 patch 9.0.1874: CI may fail in test_recover_empty_swap
Problem:  CI may fail in test_recover_empty_swap
Solution: Set directory option

Fix failing Test_recover_empty_swap test

:recover by default not only looks in the current directory, but also in
~/tmp for files to recover. If it finds some files to recover, it will
interactively prompt for a file to recover. However, prompting doesn't
work when running the test suite (and even if it would, there is no one
that can answer the prompt).

So it doesn't really make sense during testing, to inspect different
directories for swap files and prompt and wait (which will lead to a
timeout and therefore a failing test).

So set the 'directory' option temporarily to the current directory only
and reset it back once the test finishes.

closes: #13038

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-05 20:40:25 +02:00
Christian Brabandt
f6d28fe2c9 patch 9.0.1873: [security] heap-buffer-overflow in vim_regsub_both
Problem:  heap-buffer-overflow in vim_regsub_both
Solution: Disallow exchanging windows when textlock is active

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-05 20:18:06 +02:00
Christian Brabandt
d2a08ba0fa patch 9.0.1872: CI: test_crash() fails on CI
Problem:  CI: test_crash() fails on CI
Solution: Skip test on BSD

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-05 07:45:04 +02:00
James McCoy
a4245a10ea patch 9.0.1871: Github CI does not run i386 job
Problem:  Github CI does not run i386 job
Solution: Add a i386 architecture

Add CI testing for i386

message_test recently failed on i386, which exposed a gap in the CI
testing.  Convert the shadowdir job to one that runs on i386 so we get
32-bit test coverage.

Since the GHA runners are x86_64, we can enable the i386 architecture
in dpkg and install i386 packages for the i386 CI jobs.  However, this
can't currently be done with features=huge since that would require
installing python3-dev:i386, which breaks the CI environment.

closes: #12975

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: James McCoy <jamessan@jamessan.com>
2023-09-05 07:41:23 +02:00
Ernie Rael
00df69e62b patch 9.0.1870: Vim9: disassamble does not show static
Problem:  Vim9: disassamble does not show static
Solution: Show static flag

Fix disassemble for instructions with optional static:
ISN_GET_OBJ_MEMBER and ISN_GET_ITF_MEMBER

closes: #13030

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
2023-09-05 07:39:14 +02:00
Yee Cheng Chin
c2a37013bd runtime(menu): Fix "Open &Tab..." CJK translations to have shortcut key (#13031)
Previous PR (#12993) fixed localization files to point to "Open &Tab..."
but they didn't add the shortcut key to the translated names. This adds
the shortcut keys to the CJK translations in the form of "(&T)".

Note that this doesn't add the shortcut to latin script languages like
Czech. These types of translated names tend to also localize the
shortcut keys for them to make sense to the user and it's up to each
translator to decide how to do so. CJK translations tend to just take
the English key directly since it doesn't make sense to have a localized
shortcut key in general.


Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-05 07:36:07 +02:00
Ernie Rael
86eda07805 patch 9.0.1869: Coverity warns about unitialized var
Problem:  Coverity warns about unitialized var
Solution: initialize it

closes: #13029

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
2023-09-05 07:33:48 +02:00
Christian Brabandt
59adcb4c20 patch 9.0.1868: test_crash still fails for circle ci
Problem:  test_crash still fails for circle ci
Solution: give even more time to complete

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-04 22:42:55 +02:00
Ivan Pešić
e4ba5df7c7 runtime(sr): Update Serbian messages translation
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-04 22:37:03 +02:00
Ernie Rael
18143d3111 patch 9.0.1867: Vim9: access to interface statics possible
Problem:  Vim9: access to interface statics possible
Solution: Prevent direct access to interface statics

closes: #13007

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
2023-09-04 22:30:41 +02:00
zeertzjq
dccc29c228 patch 9.0.1866: undo is synced after character find
Problem:  Undo is synced after character find.
Solution: Set no_u_sync when calling gotchars_nop().

closes: #13022
closes: #13024

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-04 22:25:07 +02:00
John Wellesz
3170342af3 runtime(php): Update the php indent script to the 1.75 (from 1.70) (#13025)
Changes:

1.75:
- Fix 2072/PHP-Indenting-for-VIm#87: The indent optimization was causing wrong indentation of lines
  preceded by a line ending with '}' when preceded by non white characters.
- Fix long standing non-reported regex escaping issue in cleaning end of line
  comments function. This should help fixing some other unreported issues when
  parts of codes are commented out at ends of lines...

1.74:
- Fix 2072/PHP-Indenting-for-VIm#86: Add support for `match` expression.

1.73:
- Fix 2072/PHP-Indenting-for-VIm#77 where multi line strings and true/false keywords at beginning of a
  line would cause indentation failures.

1.72:
- Fix vim/vim#5722 where it was reported that the option PHP_BracesAtCodeLevel
  had not been working for the last 6 years.

1.71:
- Fix 2072/PHP-Indenting-for-VIm#75 where the indent script would hang on some multi-line quoted strings.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-04 22:22:19 +02:00
Anton Sharonov (ant0sha)
282a94be99 runtime: Fix problem of checking wrong cwd for ruby ftplugin (#13026)
Co-authored-by: Anton Sharonov <anton.sharonov@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-04 22:21:00 +02:00
Yegappan Lakshmanan
544be0d893 patch 9.0.1865: Vim9: garbage collection may cause crash
Problem:  Vim9: garbage collection may cause crash
Solution: validate that class members typeval is not null

closes: #13028

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-04 22:14:28 +02:00
Christian Brabandt
623ba31821 patch 9.0.1864: still crash with bt_quickfix1_poc
Problem:  crash with bt_quickfix1_poc when cleaning up
          and EXITFREE is defined
Solution: Test if buffer is valid in a window, else close
          window directly, don't try to access buffer properties

While at it, increase the crash timeout slightly, so that CI has a
chance to finish processing the test_crash() test.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-04 22:09:12 +02:00
Christian Brabandt
e073a8b79f translation(it): revert permission changes for xxd manpages
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-04 07:58:39 +02:00
zeertzjq
7db89bdc23 patch 9.0.1863: wrong format specifiers in e_aptypes_is_null_str_nr
Problem:  wrong format specifiers in e_aptypes_is_null_str_nr
Solution: Fix the wrong format specifier

closes: #13020

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-04 07:54:02 +02:00
Yegappan Lakshmanan
e651e110c1 patch 9.0.1862: Vim9 Garbage Collection issues
Problem:  Vim9 Garbage Collection issues
Solution: Class members are garbage collected early leading to
          use-after-free problems.  Handle the garbage
          collection of classes properly.

closes: #13019

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-04 07:51:01 +02:00
K.Takata
233f956bd4 patch 9.0.1861: xxd: issue when -R is specified several times
Problem:  xxd: issue when -R is specified several times
Solution: Fix command line parsing

See: https://github.com/vim/vim/pull/12986#issuecomment-1704375892

closes: #13021

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: K.Takata <kentkt@csc.jp>
Co-authored-by: Aapo Rantalainen <aapo.rantalainen@gmail.com>
2023-09-04 07:46:59 +02:00
Christian Brabandt
f44cbe96fa patch 9.0.1860: CI: test_crash1() is flaky
Problem:  CI: test_crash1() is flaky
Solution: Wait a bit longer

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-04 07:42:27 +02:00
Christian Brabandt
6e60cf444a patch 9.0.1859: heap-use-after-free in bt_normal()
Problem:  heap-use-after-free in bt_normal()
Solution: check that buffer is still valid

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-03 21:43:46 +02:00
Christian Brabandt
ee9166eb3b patch 9.0.1858: [security] heap use after free in ins_compl_get_exp()
Problem:  heap use after free in ins_compl_get_exp()
Solution: validate buffer before accessing it

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-03 21:24:33 +02:00
Christian Brabandt
fc68299d43 patch 9.0.1857: [security] heap-use-after-free in is_qf_win()
Problem:  heap-use-after-free in is_qf_win()
Solution: Check buffer is valid before accessing it

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-03 20:20:52 +02:00
Christ van Willegen
aa90d4f031 patch 9.0.1856: issues with formatting positional arguments
Problem:  issues with formatting positional arguments
Solution: fix them, add tests and documentation

closes: #12140
closes: #12985

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
Tentatively fix message_test. Check NULL ptr.
2023-09-03 17:22:37 +02:00
h-east
71ebf3baca patch 9.0.1855: mode() doesn't indicate command line for terminal
Problem:  mode() doesn't indicate command line for terminal
Solution: make it return 'ct' for command-line from Terminal mode

closes: #6265
closes: #13017
closes: #13018

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: h-east <h.east.727@gmail.com>
2023-09-03 17:12:55 +02:00
Christian Brabandt
db510ca805 patch 9.0.1854: test_crash1() fails on CI
Problem:  test_crash1() fails on CI
Solution: don't run Screendump test, verify that it doesn't crash
          by running it through a shell command line, testing
          the exit value and concatenating success cmd using '&&'

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-03 09:30:09 +02:00
Christian Brabandt
15cbaae313 patch 9.0.1853: CI error on different signedness in regexp.c
Problem:  CI error on different signedness in regexp.c
          (after patch 9.0.1848)
Solution: Cast strlen() call to int

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02 22:08:43 +02:00
pierreganty
d69aecf141 patch 9.0.1852: i_CTRL-O does not reset Select Mode
Problem:  i_CTRL-O does not reset Select Mode
Solution: Reset select mode on CTRL-O in insert mode

closes: #13001
closes: #12115

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-02 21:59:52 +02:00
zeertzjq
3c3cf1d689 patch 9.0.1851: breakindent missing by virt text
Problem:  Virtual text at a column causes 'breakindent' and 'showbreak'
          to be missing (after patch 9.0.1124).
Solution: Add check for "tp_col" in another place where TP_FLAG_WRAP is
          checked.

closes: #12769
closes: #13008
closes: #13010

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-02 21:55:00 +02:00
LemonBoy
32f3461465 patch 9.0.1850: Vim9: wrong line number where options set
Problem:  Vim9: wrong line number where options set
Solution: Set source line number earlier

closes: #13006
closes: #13013

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-09-02 21:52:05 +02:00
Christian Brabandt
c8a034210f patch 9.0.1849: CI error on different signedness in ex_cmds.c
Problem:  CI error on different signedness
Solution: cast unsigned to int

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02 21:50:10 +02:00
Christian Brabandt
ced2c7394a patch 9.0.1848: [security] buffer-overflow in vim_regsub_both()
Problem:  buffer-overflow in vim_regsub_both()
Solution: Check remaining space

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02 21:37:04 +02:00
Christian Brabandt
889f6af371 patch 9.0.1847: [security] potential oob write in do_addsub()
Problem:  potential oob write in do_addsub()
Solution: don't overflow buf2, check size in for loop()

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02 19:43:33 +02:00
Christian Brabandt
4c6fe2e2ea patch 9.0.1846: [security] crash in fullcommand
Problem:  crash in fullcommand
Solution: Check for typeval correctly

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02 19:30:03 +02:00
Christian Brabandt
e0bfb7d301 patch 9.0.1845: xxd: Test_xxd_color start failing
Problem:  xxd: Test_xxd_color start failing
Solution: Revert changes to dump file

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02 19:13:45 +02:00
Yee Cheng Chin
8b20203141 patch 9.0.1844: doc helptags may not be up to date
Problem:  doc helptags may not be up to date
Solution: Add CI jobs to verify helptags are updated

Also, re-generate the tags file with updated list so it will pass CI.

closes: #13012

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02 16:04:50 +02:00
Christian Brabandt
b2422f7540 patch 9.0.1843: xxd color test flaky
Problem:  xxd color test flaky
Solution: Filter unneeded lines

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02 16:01:18 +02:00
Antonio Giovanni Colombo
67b0ecf754 translation(it): updated Italian xxd manpage
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02 15:12:35 +02:00
Ernie Rael
21d3212361 patch 9.0.1842: Need more accurate profiling
Problem:  Need more accurate profiling
Solution: Improve profiling results

closes: #12192

Reduce overhead of checking if a function should be profiled,
by caching results of checking (which are done with regexp).

Cache uf_hash for uf_name in ufunc_T.

Cache cleared when regexps are changed.

Break at first match for has_profiling lookup.

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
2023-09-02 15:09:18 +02:00
Christian Brabandt
9d093fd056 patch 9.0.1841: style: trailing whitespace in ex_cmds.c
Problem:  style: trailing whitespace in ex_cmds.c
Solution: remove it

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02 15:08:09 +02:00
Mike Williams
397e356d7b translation(en_GB): Update UK English translation (#13011)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02 15:04:51 +02:00
Christian Brabandt
e1dc9a6275 patch 9.0.1840: [security] use-after-free in do_ecmd
Problem:  use-after-free in do_ecmd
Solution: Verify oldwin pointer after reset_VIsual()

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02 14:44:47 +02:00
Dominique Pellé
acb91d3905 runtime(zserio): add zserio syntax (#13005)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-01 23:10:26 +02:00
Christian Brabandt
738ce77aa9 patch 9.0.1839: No Makefile rule to build cscope database
Problem:  No Makefile rule to build cscope database
Solution: Add rule

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-01 22:38:26 +02:00
Antonio Giovanni Colombo
f3db141aed translation(it): updated Italian translation + xxd manpage
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-01 22:19:37 +02:00
Yegappan Lakshmanan
3775f777a6 patch 9.0.1838: Vim9: Cannot modify class member vars from def function
Problem:  Vim9: Cannot modify class member vars from def function
Solution: Add support for modifying class member variables from a def
          function

closes: #12995

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-01 22:05:45 +02:00
Christian Brabandt
b147d31489 tests: Improve the codestyle test (#12988)
Improve it by the following:

1) Also check xxd source
2) Test_source_files():
   don't stop on the first error found, continue until the
   end of the file and report all found errors like this:

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-01 18:58:35 +02:00
Ernie Rael
456ae556b4 patch 9.0.1837: Vim9: class_member_type() can be optimized
Problem:  Vim9: class_member_type() can be optimized
Solution: class_member_type() provides more information;
          safe an additional alloc()/free()

closes: #12989

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
2023-09-01 18:57:09 +02:00
Yee Cheng Chin
c41b7a26fc Fix menu localization not updated for "Open Tab..." item (#12993)
THe menu item "Open Tab..." was changed to "Open &Tab..." in #12895 but
localization files were not updated. Update it here.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-01 18:53:30 +02:00
zeertzjq
ce53e3ea55 patch 9.0.1836: display wrong with virttext, linebreak and breakindent
Problem:  Wrong display with "above" virtual text and 'linebreak' or
          'breakindent' and 'showbreak'.
Solution: Exclude size of "above" virtual text when calculating them.

closes: #13000

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-01 18:49:30 +02:00
Yee Cheng Chin
7a9d1aa878 patch 9.0.1835: Perl interface has problems with load PL_current_context
Problem:  Perl interface has problems with load PL_current_context
Solution: Fix Perl interface to load PL_current_context from library

In #12914, in order to fix an issue with Perl 5.36 dynamic builds, (that
version introduced a thread-local `PL_current_context`), the file added
the variable manually so we can satisfy the linker. However, the
variable is a different one from the one in the library, so there could
be unpredictable behavior. Instead, just use `dlsym` to load the context
from the library. The fact that it's thread-local doesn't matter too
much to us because Vim's interface is single-threaded so it will work
properly.

closes: #12996

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-09-01 18:46:17 +02:00
K.Takata
f6fc255e8d patch 9.0.1834: Some problems with xxd coloring
Problem:  Some problems with xxd coloring
Solution: Fix the following problems:

* Support colored output on Windows.
  SetConsoleMode() is required to enable ANSI color sequences.
* Support "NO_COLOR" environment variable.
  If "NO_COLOR" is defined and not empty, colored output should be
  disabled.
  See https://no-color.org/
* "-R" should only accept "always", "never" or "auto" as the parameter.
* Adjust help and documentation. "-R" cannot omit the parameter. Remove
  surrounding brackets.

Related #12131
closes: #12997
closes: #12991
closes: #12986

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: K.Takata <kentkt@csc.jp>
2023-09-01 18:41:04 +02:00
Doug Kearns
da16a1b471 runtime(ruby): Update syntax, indent and ftplugin files
While making changes to the ruby ftplugin, slightly change the exepath()
conditional from patch 9.0.1833 and move it after the :cd invocation.

closes: 12981
closes: 12994

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Tim Pope <code@tpope.net>
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-09-01 18:36:49 +02:00
Christian Brabandt
816fbcc262 patch 9.0.1833: [security] runtime file fixes
Problem:  runtime files may execute code in current dir
Solution: only execute, if not run from current directory

The perl, zig and ruby filetype plugins and the zip and gzip autoload
plugins may try to load malicious executable files from the current
working directory.  This is especially a problem on windows, where the
current directory is implicitly in your $PATH and windows may even run a
file with the extension `.bat` because of $PATHEXT.

So make sure that we are not trying to execute a file from the current
directory. If this would be the case, error out (for the zip and gzip)
plugins or silently do not run those commands (for the ftplugins).

This assumes, that only the current working directory is bad. For all
other directories, it is assumed that those directories were
intentionally set to the $PATH by the user.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-31 23:52:30 +02:00
Christian Brabandt
0ffa97e8fa patch 9.0.1832: xxd: reporting wrong version
Problem:  xxd: reporting wrong version (after 9.0.1827)
Solution: Update version string

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-31 21:04:52 +02:00
Gianmaria Bajo
6ad4a60a97 patch 9.0.1831: Vim9: failing null test
Problem:  Vim9: failing null test
Solution: Use required public keyword

closes: #12982

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Gianmaria Bajo <mg1979.git@gmail.com>
2023-08-31 20:55:35 +02:00
Gianmaria Bajo
d7085a0635 patch 9.0.1830: Vim9: crash when accessing a null object
Problem:  Vim9: crash when accessing a null object
Solution: Check accessing a NULL object in def function

An object is NULL when the variable is declared, but the constructor
isn't called. Accessing/setting a member on the object crashed Vim.

Note: this happens inside def functions, at script level things work
differently. Accessing a NULL object member results in E1360
(correctly), while setting a value on it results in E1012 (type
mismatch) so there's still something to fix.

closes: #12973

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Gianmaria Bajo <mg1979.git@gmail.com>
2023-08-31 18:15:26 +02:00
Yegappan Lakshmanan
eb91e24d5e patch 9.0.1829: Vim9 missing access-checks for private vars
Problem:  Vim9 missing access-checks for private vars
Solution: Use the proper check for private/readonly variable.  Access
          level for a member cannot be changed in a class implementing an
          interface.  Update the code indentation

closes: #12978

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Co-authored-by: Ernie Rael <errael@raelity.com>
2023-08-31 18:10:46 +02:00
zeertzjq
ac2d8815ae patch 9.0.1828: cursor wrong with virt text before double-width char
Problem:  Wrong cursor position with virtual text before double-width
          char at window edge.
Solution: Check for double-width char before adding virtual text size.

closes: #12977

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-31 18:07:48 +02:00
Antonio Giovanni Colombo
e102e44fc6 translation(it): updated Italian manpages
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-31 18:03:11 +02:00
Aapo Rantalainen
e2528ae111 patch 9.0.1827: xxd: no color support
Problem:  xxd: no color support
Solution: Add color support using xxd -R

Add some basic color support for xxd

The hex-value and value are both colored with the same color depending
on the hex-value, e.g.:

    0x00 = white
    0xff = blue
    printable = green
    non-printable = red
    tabs and linebreaks = yellow

Each character needs 11 more bytes to contain color. (Same color in a
row could contain only one overhead but the logic how xxd creates colums
must be then changed.) Size of colored output is increased by factor of
~6. Also grepping the output will break when colors is used.

Flag for color is "-R", because less uses "-R".

Color uses parameters auto,always,never same as less and grep (among
others).

E.g.

xxd -R always $FILE | less -R

Add some screen-tests (that currently on work on linux) to verify the
feature works as expected.

closes: #12131

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Aapo Rantalainen <aapo.rantalainen@gmail.com>
2023-08-31 17:58:13 +02:00
xrandomname
0b8b145bf8 runtime(optwin): Fix for 'splitkeep' option (#12974)
'spk' was used as a boolean, rather than a string option.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-31 08:18:40 +02:00
dkearns
1610528cc3 runtime(forth): Update syntax and ftplugin files (#12976)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-31 08:17:16 +02:00
zeertzjq
1bed993c01 patch 9.0.1826: keytrans() doesn't translate recorded key typed in a GUI
Problem:  keytrans() doesn't translate recorded key typed in a GUI
Solution: Handle CSI like K_SPECIAL, like in mb_unescape()

closes: #12964
closes: #12966

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-30 19:38:24 +02:00
zeertzjq
6e55e85f92 patch 9.0.1825: wrong cursor position with virt text and 'linebreak'
Problem:  Wrong cursor position with virtual text before a whitespace
          character and 'linebreak'.
Solution: Always set "col_adj" to "size - 1" and apply 'linebreak' after
          adding the size of 'breakindent' and 'showbreak'.

closes: #12956

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-30 16:55:09 +02:00
Yegappan Lakshmanan
5bbcfbc4a2 patch 9.0.1824: Vim9: private members may be modifiable
Problem:  Vim9: private members may be modifiable
Solution: prevent modification for def function

closes: #12963

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-30 16:40:33 +02:00
Enno
9d8ef7cc43 runtime: cleanup :Sman command via the undo_ftplugin mechanism (#12967)
Regards to @dkearns as noticed in
2ac708b548

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-30 16:37:05 +02:00
Illia Bobyr
a96d544bc3 patch 9.0.1823: Autoconf 2.69 too old
Problem:  Autoconf 2.69 too old
Solution: Migrate to Autoconf 2.71

Autoconf 2.69 is almost 10 years old.  And 2.71 is also a few years old
as well.  Should be pretty well tested by now.  It brings a lot of
improvements and there seems to be an ongoing work on autoconf 2.72
already.

This change just addresses two minor changes `autoupdate` suggested, and
then `src/auto/configure` is regenerated by running

  cd src
  make AUTOCONF=autoconf2.71 autoconf

closes: #12958

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Illia Bobyr <illia.bobyr@gmail.com>
2023-08-30 16:30:15 +02:00
Yegappan Lakshmanan
e3b6c78ddc patch 9.0.1822: Vim9: no check for duplicate members in extended classes
Problem:  Vim9: no check for duplicate members in extended classes
Solution: Check for duplicate members in extended classes.
          Fix memory leak.

closes: #12948

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-29 22:34:36 +02:00
Gianmaria Bajo
4b9777a1df patch 9.0.1821: Vim9 constructors are always static
Problem:  Vim9 constructors are always static
Solution: make the "static" keyword an error

closes: #12945

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Gianmaria Bajo <mg1979.git@gmail.com>
2023-08-29 22:29:03 +02:00
dkearns
2ac708b548 runtime(sh): Update ftplugin (#12950)
Remove :Help command via the undo_ftplugin mechanism.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-29 22:24:37 +02:00
Doug Kearns
e06afb7860 patch 9.0.1820: Rexx files may not be recognised
Problem:  Rexx files may not be recognised
Solution: Add shebang detection and improve disambiguation of *.cls
	  files

closes: #12951

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-08-29 22:21:35 +02:00
ichizok
3e1e63de18 patch 9.0.1819: Github CI too complex
Problem:  Github CI too complex
Solution: CI: Tidy up matrix

Perform the following changes to the CI configuration:
 - Move common CFLAGS to ci/config.mk.sed
 - Change extra key to array to able to assign no or multiple values
   explicitly
 - Modify luaver variable handling
   - lib${{ matrix.luaver }}-dev ${{ matrix.luaver }} are confusing
     as package names
 - Deduplicate CONFOPT setting

closes: #12955

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: ichizok <gclient.gaap@gmail.com>
2023-08-29 22:20:21 +02:00
Jason King
3ac2d3da5f runtime(heex): Add HEEX comments to match_words in ftplugin (#12957)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-29 22:11:55 +02:00
Christian Brabandt
55460da26c patch 9.0.1818: dynamically linking perl is broken
Problem:  dynamically linking perl is broken
Solution: Fix all issues

This is a combination of several commits:

1) Fix if_perl.xs not being able to build on all versions of Perl (5.30)

This fixes the dynamic builds of Perl interface. The Perl interface file
previously had to manually copy and paste misc inline functions verbatim
from the Perl headers, because we defined `PERL_NO_INLINE_FUNCTIONS`
which prevents us form getting some function definitions. The original
reason we defined it was because those inline functions would reference
Perl functions that would cause linkage errors.

This is a little fragile as every time a new version of Perl comes out,
we inevitably have to copy over new versions of inline functions to our
file, and it's also easy to miss updates to existing functions.

Instead, remove the `PERL_NO_INLINE_FUNCTIONS` define, remove the manual
copy-pasted inline functions. Simply add stub implementations of the
missing linked functions like `Perl_sv_free2` and forward them to the
DLL version of the function at runtime. There are only a few functions
that need this treatment, and it's a simple stub so there is very low
upkeep compared to copying whole implementations to the file.

Also, fix the configure script so that if we are using dynamic linkage,
we don't pass `-lperl` to the build flags, to avoid accidental external
linkage while using dynamic builds. This is similar to how Python
integration works.

2) Fix GIMME_V deprecation warnings in Perl 5.38

Just use GIMME_V, and only use GIMME when using 5.30 to avoid needing to
link Perl_block_gimme. We could provide a stub like the other linked
functions like Perl_sv_free2, but simply using GIMME is the simplest and
it has always worked before.

3) Fix Perl 5.38 issues

Fix two issues:

3.1. Perl 5.38 links against more functions in their inline headers, so we
   need to stub them too.

3.2. Perl 5.38 made Perl_get_context an inline function, but *only* for
   non-Windows build. Fix that. Note that this was happening in Vim
   currently, as it would build, but fail to run Perl code at runtime.

4) Fix Perl 5.36/5.38 when thread local is used

Perl 5.36 introduced using `_Thread_local` for the current context,
which causes inline functions to fail. Create a stub
`PL_current_context` thread local variable to satisfy the linker for
inlined functions. Note that this is going to result in a different
`PL_current_context` being used than the one used in the library, but so
far from testing it seems to work.

5) Add docs for how to build Perl for dynamic linking to work

closes: #12827
closes: #12914

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-08-29 21:31:28 +02:00
Illia Bobyr
0e82b59df3 patch 9.0.1817: configure: using obsolete AC_HEADER_STDC
Problem:  configure: using obsolete AC_HEADER_STDC
Solution: Remove it and re-create configure

closes: #12949

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Illia Bobyr <illia.bobyr@gmail.com>
2023-08-29 21:17:50 +02:00
ichizok
bddc6adca6 patch 9.0.1816: configure: sed uses non-portable regex
Problem:  configure: sed uses non-portable regex
Solution: use '*' modifier instead of '\?' in regex
          for luajit version detection

closes: #12954

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: ichizok <gclient.gaap@gmail.com>
2023-08-29 20:54:32 +02:00
Christian Brabandt
a5eb6785ef runtime(doc): mention special case of i_CTRL-R_-
closes: #12947
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-29 16:23:22 +02:00
Christian Brabandt
7129de868c runtime(editorconfig): generate helptags, remove unused files
Remove the test suite and a few other non-used files from the
EditorConfig CI project

related: #12902
closes:  #12941

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-29 16:14:10 +02:00
Christian Brabandt
00d07a97ad runtime(tags): update helptags
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-28 21:45:55 +02:00
dkearns
0382f05dbd runtime: Set b:undo_indent where missing (#12944)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-28 21:32:59 +02:00
dkearns
f937ab32a1 runtime: Set b:undo_ftplugin where missing (#12943)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-28 21:32:27 +02:00
James McCoy
fe1463674c patch 9.0.1815: pango_coverage_unref() deprecated in pango > 1.51
Problem:  pango_coverage_unref() deprecated in pango > 1.51
Solution: use g_object_unref() instead

closes: #12942

Free PangoCoverage with g_object_unref for Pango >= 1.52

pango_coverage_unref was declared deprecated in Pango 1.52.0 in favor of
g_object_unref.  Adjust the call when building against a new enough
Pango to avoid the deprecation warning.

Signed-off-by: James McCoy <jamessan@jamessan.com>
Co-authored-by: James McCoy <jamessan@jamessan.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-28 21:29:13 +02:00
Yegappan Lakshmanan
2ba9d2e14e patch 9.0.1814: Vim9 no error on duplicate object member var
Problem:  Vim9 no error on duplicate object member var
Solution: detect duplicate members and error out

closes: #12938

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-28 21:26:23 +02:00
zeertzjq
1d3e0e8f31 patch 9.0.1813: linebreak incorrect drawn with breakindent
Problem: 'linebreak' is incorrectly drawn after 'breakindent'.
Solution: Don't include 'breakindent' size when already after it.

closes: #12937
closes: #12940

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-28 21:21:46 +02:00
Christian Brabandt
93ebb5e75e patch 9.0.1812: CI still fails with sodium_mlock error()
Problem:  CI still fails with sodium_mlock error()
Solution: Catch and ignore E1230 error in test_crypt

closes: #12939

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-28 21:17:36 +02:00
Yegappan Lakshmanan
85c3a5bc26 patch 9.0.1811: still some issues with term_debug test
Problem:  still some issues with term_debug test
Solution: Use WaitForAssert()

closes: #12936

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-27 22:01:23 +02:00
LemonBoy
d08745040b patch 9.0.1810: camel-case spelling has issues with digits
Problem:  camel-case spelling has issues with digits
Solution: Improve the camCase spell checking by taking digits
          and caps into account

Rewrite the conditions to check for word boundaries by taking into
account the presence of digits and all-caps sequences such as acronyms.

closes: #12644
closes: #12933

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-08-27 21:52:27 +02:00
Christian Brabandt
6c93c94929 patch 9.0.1809: termdebug test flayk
Problem:  termdebug test flayk
Solution: wait slightly longer

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-27 21:48:29 +02:00
Christian Brabandt
f2534434c9 patch 9.0.1808: termdebug: Typo in termdebug test
Problem:  termdebug: Typo in termdebug test
Solution: fix the typos

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-27 20:00:37 +02:00
Doug Kearns
9b73902dbe patch 9.0.1807: runtime: crystal scripts not recognised
Problem:  runtime: crystal scripts not recognised
Solution: Filetype detect Crystal scripts by shebang line

closes: #12935

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-08-27 19:51:37 +02:00
dkearns
73aba18eb7 runtime: Remove outdated scripts.vim comment (#12934)
Problem:  Comment in scripts.vim is outdated
Solution: Delete the comment

runtime/autoload/dist/script.vim is now Vim9 script so =~ does not use
'ignorecase'.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-27 19:47:29 +02:00
Antonio Giovanni Colombo
d58bad6bc1 translation(it): updated Italian manpage
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-27 19:35:34 +02:00
LemonBoy
90c27b2803 patch 9.0.1806: Vim9: bogus error on export
Problem:  Vim9: bogus error on export
Solution: Don't error out when the export command is not executed

closes: #12912
closes: #12930

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-08-27 19:28:15 +02:00
Yegappan Lakshmanan
639751d218 patch 9.0.1805: Vim9: problem compiling object method as function call arg
Problem:  Vim9: problem compiling object method as function call arg
Solution: After a object/class method call, remove the object/class from
          the stack.

closes: #12081
closes: #12929

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-27 19:26:16 +02:00
Yegappan Lakshmanan
cd7293bf6c patch 9.0.1804: Vim9: no support for private object methods
Problem:  Vim9: no support for private object methods
Solution: Add support for private object/class methods

closes: #12920

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-27 19:18:23 +02:00
NTBBloodbath
03e44a1d70 patch 9.0.1803: runtime(filetype): Add norg language detection
runtime(filetype): Add norg markup language detection

closes: #12913

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: NTBBloodbath <bloodbathalchemist@protonmail.com>
2023-08-27 19:15:20 +02:00
zeertzjq
e3daa06be1 patch 9.0.1802: Multiline regex with Visual selection fails with virtual text
Problem:  Multiline regex with Visual selection fails when Visual
          selection contains virtual text after last char.
Solution: Only include virtual text after last char when getting full
          line length.

closes: #12908

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-27 19:11:46 +02:00
Yegappan Lakshmanan
b49ad28d73 patch 9.0.1801: Vim9 instanceof() fails in a def func
Problem:  Vim9 instanceof() fails in a def func
Solution: allow Objects in compile time check

closes: #12907

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-27 19:08:40 +02:00
zeertzjq
6a3897232a patch 9.0.1800: Cursor position still wrong with 'showbreak' and virtual text
Problem:  Cursor position still wrong with 'showbreak' and virtual text
          after last character or 'listchars' "eol".
Solution: Remove unnecessary w_wcol adjustment in curs_columns(). Also
          fix first char of virtual text not shown at the start of a screen
          line.

closes: #12478
closes: #12532
closes: #12904

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-27 19:04:14 +02:00
RestorerZ
9a6cf34a1e patch 9.0.1799: Russian menu translation can be improved
Problem:  Russian menu translation can be improved
Solution: update the Russian menu files

closes: #12903

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: RestorerZ <restorer@mail2k.ru>
2023-08-27 19:00:42 +02:00
Christian Brabandt
e5e04306bf runtime: Distribute the editorconfig with vim (#12902)
This is the editorconfig-vim plugin Commit e014708e917b457e8f6c57f357d55dd3826880d4
from https://github.com/editorconfig/editorconfig-vim

closes: #2286
related: https://github.com/editorconfig/editorconfig-vim/issues/223

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-27 18:52:18 +02:00
Doug Kearns
6dfdff3f27 patch 9.0.1798: The 'syntax' option has no completion.
Problem:  The 'syntax' option has no completion.
Solution: Add syntax option completion.

closes: #12900

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-08-27 18:48:51 +02:00
Doug Kearns
f97f6bbf56 patch 9.0.1797: Vimball/Visual Basic filetype detection conflict
Problem:  Vimball/Visual Basic filetype detection conflict
Solution: runtime(vb): Improve Vimball and Visual Basic detection logic

Only run Vimball Archiver's BufEnter autocommand on Vimball archives.
Fixes #2694.

closes: #12899

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-08-27 18:44:09 +02:00
Ernie Rael
5c018bee0e patch 9.0.1796: Vim9 problems with null_objects
Problem:  Vim9 problems with null_objects
Solution: Vim9 improve null_object usage

Fix "xvar == null", where xvar might have been assigned null_object.

Fix compilation failure: "var o2: C = null_object".

closes: #12890

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
2023-08-27 18:40:26 +02:00
Yegappan Lakshmanan
d4e4ecbb37 patch 9.0.1795: Indentation issues
Problem:  Indentation issues
Solution: Fix code indentation issues.

closes: #12906

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-27 18:35:45 +02:00
Illia Bobyr
74e1dada41 patch 9.0.1794: autoconf: not correctly detecing include dirs
Problem:  autoconf: not correctly detecing include dirs
Solution: make use of python3 to generate includedirs

configure: Python3: Use sysconfig for -I

It seems better to use tools provided by Python for determining the
include directories, rather than construct them "manually".

Current system is broken when using virtual environments for python
3.11.4.  It used to work before, but now it detects a incorrect value
for `-I`.

It would probably make sense to switch to a similar logic for lib
folders, that is for the `-l` switch.  There are also
`sysconfig.get_config_h_filename()` and
`sysconfig.get_makefile_filename()`, that could replace more Python
specific logic in the current `configure{.ac,}`.

sysconfig provides the necessary tools since Python 2.7.

closes: #12889

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Illia Bobyr <illia.bobyr@gmail.com>
2023-08-27 18:26:54 +02:00
Illia Bobyr
f39842f148 patch 9.0.1793: obsolete macros in configure script
Problem:  obsolete macros in configure script
Solution: Remove those and start moving to autoconf 2.71

src/configure.ac: Remove obsolete macros

These macros are declared obsolete in autoconf 2.69, which is almost 10
years old by now:

  https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html

They generate warnings when in a subsequent upgrade to autoconf 2.71.

`autoupdate` from autoupdate 2.71 suggests most of these changes, except
that it also adds obsolete warnings, that where individually checked and
removed.

Regenerated `src/auto/configure` by running:

  cd src
  autoconf2.69 --output=auto/configure configure.ac
  sed --in-place --expression='s@>config.log@>auto/config.log@g' auto/configure

closes: #12888

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Illia Bobyr <illia.bobyr@gmail.com>
2023-08-27 18:24:59 +02:00
zeertzjq
d809c0a903 patch 9.0.1792: problem with gj/gk/gM and virtual text
Problem:  Normal mode "gM", "gj", "gk" commands behave incorrectly with
          virtual text.
Solution: Use linetabsize() instead of linetabsize_str().

closes: #12909

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-27 11:17:39 +02:00
Yegappan Lakshmanan
58f39d89a8 patch 9.0.1791: No tests for the termdebug plugin
Problem:  No tests for the termdebug plugin
Solution: Add some simple tests for the termdebug plugin

closes: #12927

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-27 11:14:44 +02:00
Magnus Groß
8fbd9449e7 patch 9.0.1790: Redundant LSP Content-Type header
Problem:  The Content-Type header is an optional header that some LSP
          servers struggle with and may crash when encountering it.
Solution: Drop the Content-Type header from all messages, because we use
          the default value anyway.

Because pretty much all popular LSP clients (e.g. coc.nvim, VSCode) do
not send the Content-Type header, the LSP server ecosystem has developed
such that some LSP servers may even crash when encountering it.
To improve compatibility with these misbehaving LSP servers, we drop
this header as well.

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Magnus Groß <magnus@mggross.com>
2023-08-27 11:11:22 +02:00
Anatolii Sakhnik
0db1ea4815 translation(ua): Refine (synchronize with Neovim) (#12928)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-27 10:31:58 +02:00
mathew
20f61d96f8 patch 9.0.1789: too early declaration of variable in pum_set_selected()
Problem:  too early declaration of variable in pum_set_selected()
Solution: Move declaration to where it is actually used

closes: #12915

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: mathew <glephunter@gmail.com>
2023-08-26 18:11:31 +02:00
K.Takata
4c215ecdaf patch 9.0.1788: C4090 warnings in strings.c
Problem:  C4090 warnings in strings.c
Solution: Add type casts

closes: #12917

MSVC shows the following warnings:
```
strings.c(2436): warning C4090: 'function': different 'const' qualifiers
strings.c(2774): warning C4090: 'function': different 'const' qualifiers
strings.c(3865): warning C4090: 'function': different 'const' qualifiers
```

So add type casts to suppress them.

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken .Takata <kentkt@csc.jp>
2023-08-26 18:05:08 +02:00
Herrington Darkholme
535b9e12d0 runtime(typescript): Fix highlighting symbols after number literal (#12911)
fixes #12831
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-26 18:01:47 +02:00
Anatolii Sakhnik
fa0094e162 translation(ua): Update Ukrainian translation (#12916)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-26 18:00:54 +02:00
Kevin Scannell
1da9fdb8c7 translation(ir): Updated irish translation (#12918)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-26 17:59:34 +02:00
Yegappan Lakshmanan
e750f8c330 runtime(todo): Update todo.txt to remove recently addressed issues (#12910)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-24 15:07:05 +01:00
Christian Brabandt
d42f95bbfb patch 9.0.1787: Cannot build with latest luajit
Problem:  Cannot build with latest luajit
Solution: adjust sed regexp and don't expect '-' in version output

closes: #12896

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-24 08:15:38 +02:00
Enno
2f25e40b1f runtime: configure keywordpg for some file types (#5566)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-23 21:27:50 +02:00
Christian Brabandt
e8d6f03f6a runtime: Remove Brams name from a few more runtime files (#12780)
syntax/model.vim: minor wording improvement

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Adri Verhoef <a3@a3.xs4all.nl>
2023-08-23 21:23:07 +02:00
Viktor Szépe
3fc7a7e44a runtime: Fix typos in various files
closes: #12836

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
2023-08-23 21:20:00 +02:00
LemonBoy
afe0466fb1 patch 9.0.1786: Vim9: need instanceof() function
Problem:  Vim9: need instanceof() function
Solution: Implement instanceof() builtin

Implemented in the same form as Python's isinstance because it allows
for checking multiple class types at the same time.

closes: #12867

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-08-23 21:08:11 +02:00
zeertzjq
1193951beb patch 9.0.1785: wrong cursor position with 'showbreak' and lcs-eol
Problem:  wrong cursor position with 'showbreak' and lcs-eol
Solution: Add size of 'showbreak' before when 'listchars' "eol" is used.
          Also fix wrong cursor position with wrapping virtual text on
          empty line and 'showbreak'.

closes: #12891

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-23 20:58:01 +02:00
mathew
c51fa7bc46 patch 9.0.1784: redundant else in pum_set_selected()
Problem:  redundant else in pum_set_selected()
Solution: Remove it

closes: #12893

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: mathew <glephunter@gmail.com>
2023-08-23 20:55:17 +02:00
Sean Dewar
3d3a9152fa runtime(termdebug): more termdebug fixes and improvements (#12892)
- Fix and attempt to simplify :Frame/:Up/:Down documentation.

- Accept a count instead for :Up/:Down/+/-.

- Update the "Last Change" dates.

- Fix a missing :let (caused an error if gdb fails to start).

- Wipe the prompt buffer when ending prompt mode (if it exists and wasn't wiped
  by the user first). Avoids issues with stale prompt buffers (such as E95 when
  starting a new prompt mode session).

- Kill the gdb job if the prompt buffer is unloaded (similar to what's done for
  a terminal buffer). Fixes not being able to start a new termdebug session if
  the buffer was wiped by the user, for example.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-23 17:14:49 +01:00
Emir SARI
79d9cb4cb0 Translation(tr): Update Turkish translations (#12897)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-23 17:10:16 +01:00
Christian Brabandt
e059fae100 runtime(menu): define shortcut for File->Open Tab (#12895)
Seems missing as noted by Antonio Giovanni Colombo. So add it and use
the 'T' as shortcut, which does not seem to be used in the File dialog.

Verified on Windows.

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Antonio Giovanni Colombo <azc100@gmail.com>
2023-08-23 17:07:55 +01:00
Karim Belabas
9180633e68 Codeowners: add KBelabas for runtime/syntax/gp.vim (#12898)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-23 17:07:23 +01:00
Job Noorman
544b209a2d runtime(scala): Link Scala highlighting groups using 'hi def link' in syntax script (#9594)
They were linked using 'hi link' which made it impossible for color
schemes to override highlight groups.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-22 22:37:40 +02:00
Oskar Stenman
6e93689bde runtime(bindzone): updated syntax file
- Add support for APL type in runtime/syntax/bindzone.vim
- all values between 0- 4294967295 are valid serials

closes: #9743
closes: #8382

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-22 22:34:26 +02:00
MichaWiedenmann
118f8e9da3 runtime(cmake) Recognize add_compile_definitions in syntax script (#10416)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-22 22:25:50 +02:00
Moviuro
cdd934439d runtime(crontab): add support for BSD specifics in syntax script (#11196)
* OpenBSD supports the use of `~` as alias for "random valid value"
* FreeBSD supports `@every_{minute,second}`

See:

* https://man.openbsd.org/crontab.5
* https://www.freebsd.org/cgi/man.cgi?query=crontab&sektion=5

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-22 22:24:26 +02:00
Simon Sobisch
2ae7ffe0bc runtime(termdebug): add frame related commands (#12511)
implementing `:Frame`, `:Up` and `:Down'

partially fixing #10393

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-22 22:19:14 +02:00
Antonio Giovanni Colombo
6551ace0fe Translations(it): Update po and menus for it
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-22 22:15:13 +02:00
zeertzjq
b557f48982 patch 9.0.1783: Display issues with virt text smoothscroll and showbreak
Problem:  Wrong display with wrapping virtual text or unprintable chars,
          'showbreak' and 'smoothscroll'.
Solution: Don't skip cells taken by 'showbreak' in screen lines before
          "w_skipcol". Combined "n_skip" and "skip_cells".

closes: #12597

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-22 22:07:34 +02:00
Yegappan Lakshmanan
171c5b9b03 patch 9.0.1782: prop_list() does not return text_padding_left
Problem:  prop_list() does not return text_padding_left
Solution: Store and return the text_padding_left value for text
          properties

closes: #12870

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-22 21:48:50 +02:00
Christian Brabandt
757593c07a patch 9.0.1781: Problems when setting bin/paste option
Problem:  Problems when setting bin/paste option
Solution: When setting binary/paste, remember that this also affects
          depending options, so that :verbose set returns the right
          location.

Mention if depending options for 'binary' or 'paste' have been reset
indirectly. Add a test to verify it works.

Also noticed as small bug, that the global option value for expandtab
was not reset when paste option is set, so fix that while at it.

closes: #12837
closes: #12879

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-22 21:44:10 +02:00
Yegappan Lakshmanan
618e47d1cd patch 9.0.1780: Vim9 type not defined during object creation
Problem:  Vim9 type not defined during object creation
Solution: Define type during object creation and not during class
          definition, parse mulit-line member initializers, fix lock
          initialization

If type is not specified for a member, set it during object creation
instead of during class definition.  Add a runtime type check for the
object member initialization expression

Also, while at it, when copying an object or class, make sure the lock
is correctly initialized.

And finally, parse multi-line member initializers correctly.

closes: #11957
closes: #12868
closes: #12869
closes: #12881

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-08-22 21:29:28 +02:00
zeertzjq
8dabccd295 patch 9.0.1779: Need more state() tests
Problem:  Need more state() tests
Solution: Add a few more tests for operater pending mode and register
          yank command

closes: #12883

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: author
2023-08-22 21:22:24 +02:00
Sean Dewar
a76f3221cd runtime(termdebug): Fix various Termdebug issues (#12875)
* Fix some Termdebug issues after #12403

Problem: Cleanup for :Var and :Asm buffers did not apply to prompt mode, and
E86 was possible if they were hidden.
Solution: Move cleanup to s:EndDebugCommon. Check that the buffers exist before
switching.

* Fix :Asm in Termdebug prompt mode

Problem: :Asm does not work in prompt mode.
Solution: Make it work by handling disassembly-related messages properly.

The previous implementation depended on the typed or sent (via s:SendCommand())
"disassemble ..." message being visible to s:CommOutput(), but this was only
true for the terminal-based job.

A more robust solution would be to use GDB MI's -data-disassemble command. I may
implement this in a future PR.

* Fix Termdebug s:DecodeMessage escaping logic

Problem: Termdebug does not escape gdb messages properly.
Solution: Improve the logic. Do not mangle messages if they have inner escaped
quotes. Use line continuation comments properly.

Interestingly, due to the missing line continuation comments (`"\`), most of
these substitutions were ignored.

Presumably, this logic still isn't exact. For example, if a message ends in
`\\"`, the quote may be preserved, even though it's the `\` being escaped
(similar issues may exist for the other escapes). This may not be a problem in
practice, though.
2023-08-22 19:30:29 +01:00
José-Paul D
b0d584d97a runtime(go): Update Go syntax file with 1.21 builtins (#12876)
* Update Go syntax file with 1.21 builtins
2023-08-22 19:29:19 +01:00
dkearns
e34b51e95f runtime(solidity): add new ftplugin (#12877)
Set undo_{ftplugin,indent}

closes #11240

Co-authored-by: cothi <jiungdev@gmail.com>
2023-08-22 19:28:42 +01:00
Karim Belabas
c6d533b0ad runtime(gp): update gp.vim syntax file for the GP language (version 2.15) (#12884)
- add missing defaults
- add missing control structures (incl. parallelism)
- add missing scope declarations
- whitespace edits (remove extra tabs)
2023-08-22 19:25:06 +01:00
Christian Brabandt
6909639249 runtime(dosini): save and restore cpo value in syntax script
Commit dd0ad25988  introduced
line-continuation. However, to make sure this does not cause an error
when Vim is run in compatible mode, we need to set compatibility mode
temporarily and reset it back when finished reading the file.

This fixes: https://groups.google.com/g/vim_use/c/9zccgo_RIqM/m/xlUmhBktBgAJ

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-21 06:49:38 +02:00
Christian Brabandt
75dc1ed1ad patch 9.0.1778: if_py_both: code-style issue
Problem:  if_py_both: code-style issue
Solution: add space

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-20 23:19:24 +02:00
Christian Brabandt
be07caa071 patch 9.0.1777: patch 9.0.1771 causes problems
Problem:  patch 9.0.1771 causes problems
Solution: revert it

Revert "patch 9.0.1771: regex: combining chars in collections not handled"
This reverts commit ca22fc36a4.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-20 22:28:28 +02:00
Jordi Altayó
6d626c4184 runtime(sdc): Add underscore to sdc flags in syntax file (#6201) 2023-08-20 21:45:13 +02:00
Jay Sitter
a0fddaa2f4 Runtime(javascript): add new document properties to completion file
closes: #6536

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-20 21:41:01 +02:00
Enrico Maria De Angelis
5e6e4042b1 runtime(haskell): Add single quote to iskeyword in ftplugin (#8191)
The single quote `'` is a valid character in variable names, so it should be included in `iskeyword`; this, for instance, makes the <kbd>*</kbd> command behave predictably
2023-08-20 21:29:09 +02:00
Brian C. Lane
a03380baa4 runtime(spec): ftplugin: Revert change dropping <SID> from SpecChangelog (#9032)
Without this it will return an error when creating a new changelog
entry:
"Unknown function: SpecChangelog"
2023-08-20 21:27:20 +02:00
Adrian Heine né Lang
309ded1954 runtime(css): Update pseudo-classes in syntax script (#11595) 2023-08-20 21:23:18 +02:00
beardedsakimonkey
9fa35b1c38 runtime(lua): fix lua indentation of non-lowercase "keywords" (#11759) 2023-08-20 21:21:51 +02:00
Meqa
e71e9d9ad3 runtime(javascript): fix default link of javaScriptNumber in syntax file (#11788)
cool unused matching
2023-08-20 21:20:59 +02:00
Yee Cheng Chin
c13b3d1350 patch 9.0.1776: No support for stable Python 3 ABI
Problem:  No support for stable Python 3 ABI
Solution: Support Python 3 stable ABI

Commits:
1) Support Python 3 stable ABI to allow mixed version interoperatbility

Vim currently supports embedding Python for use with plugins, and the
"dynamic" linking option allows the user to specify a locally installed
version of Python by setting `pythonthreedll`. However, one caveat is
that the Python 3 libs are not binary compatible across minor versions,
and mixing versions can potentially be dangerous (e.g. let's say Vim was
linked against the Python 3.10 SDK, but the user sets `pythonthreedll`
to a 3.11 lib). Usually, nothing bad happens, but in theory this could
lead to crashes, memory corruption, and other unpredictable behaviors.
It's also difficult for the user to tell something is wrong because Vim
has no way of reporting what Python 3 version Vim was linked with.

For Vim installed via a package manager, this usually isn't an issue
because all the dependencies would already be figured out. For prebuilt
Vim binaries like MacVim (my motivation for working on this), AppImage,
and Win32 installer this could potentially be an issue as usually a
single binary is distributed. This is more tricky when a new Python
version is released, as there's a chicken-and-egg issue with deciding
what Python version to build against and hard to keep in sync when a new
Python version just drops and we have a mix of users of different Python
versions, and a user just blindly upgrading to a new Python could lead to
bad interactions with Vim.

Python 3 does have a solution for this problem: stable ABI / limited API
(see https://docs.python.org/3/c-api/stable.html). The C SDK limits the
API to a set of functions that are promised to be stable across
versions. This pull request adds an ifdef config that allows us to turn
it on when building Vim. Vim binaries built with this option should be
safe to freely link with any Python 3 libraies without having the
constraint of having to use the same minor version.

Note: Python 2 has no such concept and this doesn't change how Python 2
integration works (not that there is going to be a new version of Python
2 that would cause compatibility issues in the future anyway).

---

Technical details:
======

The stable ABI can be accessed when we compile with the Python 3 limited
API (by defining `Py_LIMITED_API`). The Python 3 code (in `if_python3.c`
and `if_py_both.h`) would now handle this and switch to limited API
mode. Without it set, Vim will still use the full API as before so this
is an opt-in change.

The main difference is that `PyType_Object` is now an opaque struct that
we can't directly create "static types" out of, and we have to create
type objects as "heap types" instead. This is because the struct is not
stable and changes from version to version (e.g. 3.8 added a
`tp_vectorcall` field to it). I had to change all the types to be
allocated on the heap instead with just a pointer to them.

Other functions are also simply missing in limited API, or they are
introduced too late (e.g. `PyUnicode_AsUTF8AndSize` in 3.10) to it that
we need some other ways to do the same thing, so I had to abstract a few
things into macros, and sometimes re-implement functions like
`PyObject_NEW`.

One caveat is that in limited API, `OutputType` (used for replacing
`sys.stdout`) no longer inherits from `PyStdPrinter_Type` which I don't
think has any real issue other than minor differences in how they
convert to a string and missing a couple functions like `mode()` and
`fileno()`.

Also fixed an existing bug where `tp_basicsize` was set incorrectly for
`BufferObject`, `TabListObject, `WinListObject`.

Technically, there could be a small performance drop, there is a little
more indirection with accessing type objects, and some APIs like
`PyUnicode_AsUTF8AndSize` are missing, but in practice I didn't see any
difference, and any well-written Python plugin should try to avoid
excessing callbacks to the `vim` module in Python anyway.

I only tested limited API mode down to Python 3.7, which seemes to
compile and work fine. I haven't tried earlier Python versions.

2) Fix PyIter_Check on older Python vers / type##Ptr unused warning

For PyIter_Check, older versions exposed them as either macros (used in
full API), or a function (for use in limited API). A previous change
exposed PyIter_Check to the dynamic build because Python just moved it
to function-only in 3.10 anyway. Because of that, just make sure we
always grab the function in dynamic builds in earlier versions since
that's what Python eventually did anyway.

3) Move Py_LIMITED_API define to configure script

Can now use --with-python-stable-abi flag to customize what stable ABI
version to target. Can also use an env var to do so as well.

4) Show +python/dyn-stable in :version, and allow has() feature query

Not sure if the "/dyn-stable" suffix would break things, or whether we
should do it another way. Or just don't show it in version and rely on
has() feature checking.

5) Documentation first draft. Still need to implement v:python3_version

6) Fix PyIter_Check build breaks when compiling against Python 3.8

7) Add CI coverage stable ABI on Linux/Windows / make configurable on Windows

This adds configurable options for Windows make files (both MinGW and
MSVC). CI will also now exercise both traditional full API and stable
ABI for Linux and Windows in the matrix for coverage.

Also added a "dynamic" option to Linux matrix as a drive-by change to
make other scripting languages like Ruby / Perl testable under both
static and dynamic builds.

8) Fix inaccuracy in Windows docs

Python's own docs are confusing but you don't actually want to use
`python3.dll` for the dynamic linkage.

9) Add generated autoconf file

10) Add v:python3_version support

This variable indicates the version of Python3 that Vim was built
against (PY_VERSION_HEX), and will be useful to check whether the Python
library you are loading in dynamically actually fits it. When built with
stable ABI, it will be the limited ABI version instead
(`Py_LIMITED_API`), which indicates the minimum version of Python 3 the
user should have, rather than the exact match. When stable ABI is used,
we won't be exposing PY_VERSION_HEX in this var because it just doesn't
seem necessary to do so (the whole point of stable ABI is the promise
that it will work across versions), and I don't want to confuse the user
with too many variables.

Also, cleaned up some documentation, and added help tags.

11) Fix Python 3.7 compat issues

Fix a couple issues when using limited API < 3.8

- Crash on exit: In Python 3.7, if a heap-allocated type is destroyed
  before all instances are, it would cause a crash later. This happens
  when we destroyed `OptionsType` before calling `Py_Finalize` when
  using the limited API. To make it worse, later versions changed the
  semantics and now each instance has a strong reference to its own type
  and the recommendation has changed to have each instance de-ref its
  own type and have its type in GC traversal. To avoid dealing with
  these cross-version variations, we just don't free the heap type. They
  are static types in non-limited-API anyway and are designed to last
  through the entirety of the app, and we also don't restart the Python
  runtime and therefore do not need it to have absolutely 0 leaks.

  See:
  - https://docs.python.org/3/whatsnew/3.8.html#changes-in-the-c-api
  - https://docs.python.org/3/whatsnew/3.9.html#changes-in-the-c-api

- PyIter_Check: This function is not provided in limited APIs older than
  3.8. Previously I was trying to mock it out using manual
  PyType_GetSlot() but it was brittle and also does not actually work
  properly for static types (it will generate a Python error). Just
  return false. It does mean using limited API < 3.8 is not recommended
  as you lose the functionality to handle iterators, but from playing
  with plugins I couldn't find it to be an issue.

- Fix loading of PyIter_Check so it will be done when limited API < 3.8.
  Otherwise loading a 3.7 Python lib will fail even if limited API was
  specified to use it.

12) Make sure to only load `PyUnicode_AsUTF8AndSize` in needed in limited API

We don't use this function unless limited API >= 3.10, but we were
loading it regardless. Usually it's ok in Unix-like systems where Python
just has a single lib that we load from, but in Windows where there is a
separate python3.dll this would not work as the symbol would not have
been exposed in this more limited DLL file. This makes it much clearer
under what condition is this function needed.

closes: #12032

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-08-20 21:18:38 +02:00
Johan Mattsson
20cd8699ac patch 9.0.1775: Wrong comparison in vim9type.c
Problem:  Wrong comparison in vim9type.c
Solution: Change condition to false

closes: #12047

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Johan Mattsson <39247600+mjunix@users.noreply.github.com>
2023-08-20 21:07:29 +02:00
Shougo Matsushita
92997dda78 patch 9.0.1774: no support for custom cmdline completion
Problem:  no support for custom cmdline completion
Solution: Add new vimscript functions

Add the following two functions:
- getcmdcompltype() returns custom and customlist functions

- getcompletion() supports both custom and customlist

closes: #12228

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2023-08-20 20:55:55 +02:00
Doug Kearns
19a3bc3add patch 9.0.1773: cannot distinguish Forth and Fortran *.f files
Problem:  cannot distinguish Forth and Fortran *.f files
Solution: Add Filetype detection Code

Also add *.4th as a Forth filetype

closes: #12251

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-08-20 20:53:47 +02:00
champignoom
6633611f42 runtime(lua): indent curly bracket followed by line comment (#12306)
fixes #12305
2023-08-20 20:49:16 +02:00
Luuk van Baal
16af913eee patch 9.0.1772: Cursor may be adjusted in 'splitkeep'ed windows
Problem:    Cursor is adjusted in window that did not change in size by
            'splitkeep'.
Solution:   Only check that cursor position is valid in a window that
            has changed in size.

closes: #12509

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2023-08-20 20:44:59 +02:00
Raphael
478668013f runtime(rust): fix rust indent (#12542) 2023-08-20 20:42:39 +02:00
lifecrisis
17befac581 runtime(man): remove backslashes in man pages using Vim script (#12557)
Closes: vim/vim#12301

Co-authored-by: Jason Franklin <jason@oneway.dev>
2023-08-20 20:41:25 +02:00
Christian Brabandt
ca22fc36a4 patch 9.0.1771: regex: combining chars in collections not handled
Problem:  regex: combining chars in collections not handled
Solution: Check for following combining characters for NFA and BT engine

closes: #10459
closes: #10286

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-20 20:38:56 +02:00
Ibby
a6ab5e69d3 patch 9.0.1770: lines disappear when modifying chars before virt text
Problem:  lines disappear when modifying chars before virt text
Solution: take virtual text property length into account

closes: #12558
closes: #12244

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ibby <33922797+SleepySwords@users.noreply.github.com>
2023-08-20 20:24:18 +02:00
Shane-XB-Qian
f6fb52b667 runtime(termdebug): refactor error printing (#12856)
// vs not act like exception from vim or termdebug

Signed-off-by: shane.xb.qian <shane.qian@foxmail.com>
2023-08-20 20:07:49 +02:00
Shane-XB-Qian
19968fc4ec runtime(termdebug): re-indent lines (#12857)
Signed-off-by: shane.xb.qian <shane.qian@foxmail.com>
2023-08-20 20:06:49 +02:00
AmberArr
f5d0f54790 patch 9.0.1769: executable() ignoring symlinks on Windows
Problem:  executable() ignoring symlinks on Windows
Solution: resolve reparse points

closes: #12562

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: AmberArr <me@frost.moe>
2023-08-20 20:03:45 +02:00
laburnumT
9f29621415 Runtime(termdebug): Add support to view local and argument variables
closes: 12403

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-20 20:00:27 +02:00
James Fleming
72904d5fda Runtime: Add nixInherit matcher in nix.vim syntax
Perform the lookahead in `nixInheritAttributeScope`, then hand over to a
new region called `nixInheritAttributeSubExpr`, which sets the match
start to one char after the opening bracket to avoid a double-match.

Finally, only do a lookahead to `)` in `nixInheritAttributeSubExpr` (and
thus make sure the region is closed to not get a match of `nixParen`
here) and let `nixInheritAttributeScope` close the bracket.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-20 19:20:55 +02:00
Scott McKendry
2d0988ef93 patch 9.0.1768: Runtime: no support for bicep files
Problem:  Runtime: no support for bicep files
Solution: Add filetype support for bicepparam

closes: #12784

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Scott McKendry <scott.c.mckendry@gmail.com>
2023-08-20 19:17:42 +02:00
Gregory Anders
d4376dc3eb patch 9.0.1767: '.-' no allowed in highlight group names
Problem:  '.-' no allowed in highlight group names
Solution: Allow dot and hyphen characters in highlight group names

Allow dots and hyphens in group names. There does not seem
to be any reason for these to be disallowed.

closes: #12807

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
2023-08-20 19:14:03 +02:00
ChaseKnowlden
bedc69f9d6 patch 9.0.1766: Runtime: Missing QML support
Problem:  Runtime: Missing QML support
Solution: Add QML support to Vim

closes: #12810

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: ChaseKnowlden <haroldknowlden@gmail.com>
2023-08-20 19:10:03 +02:00
Mike Gilbert
a055b441f5 patch 9.0.1765: Error when cross-compiling Vim
Problem:  Error when cross-compiling Vim
Solution: use AC_CHECK_SIZEOF to find sizeof(wchar_t)

This fixes an error when cross compiling.

closes: #12828

Bug: https://bugs.gentoo.org/889430
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-20 19:01:41 +02:00
Philip H
4924ad099f patch 9.0.1764: CI: label should not be set on all yml files
Problem:  CI: label should not be set on all yml files
Solution: only set it for specific yml files in .github

closes: #12855

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2023-08-20 18:58:46 +02:00
Christian Brabandt
787de412b8 Translation: also update ru.cp1251.po file after 6cc8bc8366
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-20 18:46:41 +02:00
zeertzjq
ab9f2ecfd4 patch 9.0.1763: crash when passing invalid buffer to undotree()
Problem:  crash when passing invalid buffer to undotree()
Solution: Use get_buf_arg() instead of tv_get_buf_from_arg().

closes: #12862
closes: #12830

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-20 18:41:42 +02:00
Yegappan Lakshmanan
f9037f186a patch 9.0.1762: Not able to get the virtual text property
Problem:  Not able to get the virtual text property
Solution: Make prop_list() return virtual text and alignment

closes: #12860

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-20 18:27:45 +02:00
zeertzjq
654bdbbd32 patch 9.0.1761: g<kEnd> behaves different from g<end>
Problem:  g<kEnd> behaves different from g<end>
Solution: Make g<kEnd> behave like g<End>

closes: #12861

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-20 18:24:20 +02:00
Yegappan Lakshmanan
6ac1544e13 patch 9.0.1760: vim9 class problem with new() constructor
Problem:  vim9 class problem with new() constructor
Solution: Don't allow a return type for the new() class constructor.

closes: #12863
closes: #12040

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-20 18:20:17 +02:00
Restorer
6cc8bc8366 Translation: Russian PO file updated to Vim version 9.0.1757 (#12864)
Co-authored-by: RestorerZ <restorer@mail2k.ru>
2023-08-20 18:15:48 +02:00
zeertzjq
8fc6a1dae0 patch 9.0.1759: Visual highlight not working with cursor at end of screen line
Problem:  Visual highlight not working with cursor at end of screen line
          and 'showbreak'.
Solution: Only update "vcol_prev" when drawing buffer text.

closes: #12865

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-20 18:12:54 +02:00
LemonBoy
0ffc17aa47 patch 9.0.1758: vim9 no class identifiers in stack dumps
Problem:  vim9 no class identifiers in stack dumps
Solution: Prefix class members in stack traces with the class name
          followed by a dot.

closes: #12866
closes: #12078

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-08-20 18:09:11 +02:00
Yegappan Lakshmanan
4b1cc7906f patch 9.0.1757: ex_class() function is too long
Problem:  ex_class() function is too long
Solution: refactor it

closes: #12858

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-19 22:39:33 +02:00
Christian Brabandt
e1eaae27f4 patch 9.0.1756: failing cursorline sign test
Problem:  failing cursorline sign test
Solution: only reset char attr, if cursorline
          option is not set

Unfortunately, commit dbeadf05b6 causes a
failure with the sign test Test_sign_cursor_position()

The root cause is, that resetting the character attribute will also
reset the existing cursor line highlighting and this breaks the test,
that expects the cursor line highlighting to overrule the sign line
highlighting.

So change the condition to reset the character attribute by making sure
that this only happens, if the 'cursorline' option is not active and the
cursor is not at the same line as the line to be drawn

closes: #12854
closes: #12859

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-19 22:36:12 +02:00
Christian Brabandt
25dec33c9b patch 9.0.1755: CI still fails with sodium mlock error
Problem: CI still fails with sodium mlock error
Solution: catch mlock failure

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-19 22:15:44 +02:00
LemonBoy
f244b2fbf2 patch 9.0.1754: still Ci breakage (after 9.0.1741)
Problem: still ci breakage (after 9.0.1741)
Solution: fix remaining issue

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-08-19 16:02:04 +02:00
Christian Brabandt
b5f6fe9ca2 patch 9.0.1753: can't move to last non-blank char
Problem: can't move to last non-blank char
Solution: Make g<end> behave like that

Make it possible to move to last non-blank char on a line

We can distinguish between g0 and g^ to move to the very first character
and the first non-blank char.

And while we can move to the last screen char, we cannot go to the last
non-blank screen char.

Since I think g$ is the more widely used and known movement command (and
g<end> is synonymous to it) change the behaviour of g<end> to move to
last non-screen char instead and don't have this be the same command as
the g$ command anymore.

If you want to keep the old behaviour, you can use:

```
nnoremap g<end> g$
```

Add a test to verify the behaviour.

closes: #12593

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-19 15:55:35 +02:00
Christian Brabandt
2b6a12af4d patch 9.0.1752: CI: Coveralls is no longer used
Problem: CI: Coveralls is no longer used
Solution: Remove .coveralls.yml

Coveralls is no longer used, we ditched using it in patch v9.0.1547,
commit 12eb0f4ec5 issue #12389

So let's remove the .coveralls.yml file, it does not seem useful
anymore.

closes: #12851

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-19 15:50:52 +02:00
Philip H
8b8f7d19f8 patch 9.0.1751: CI: labeler configuration not found
Problem: CI: labeler configuration not found
         (after 9.0.1748)
Solution: set configuration path

closes: #12852

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2023-08-19 15:46:11 +02:00
rhysd
0bbc1be0a3 patch 9.0.1750: CI: fails because of changed error messages
Problem: CI: fails because of changed error messages
         (after: 9.0.1741)
Solution: Adjust expected error messages

closes: #12853

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: rhysd <lin90162@yahoo.co.jp>
2023-08-19 15:42:54 +02:00
Christian Brabandt
dbeadf05b6 patch 9.0.1749: Text property highlight doesn't override a sign highlight on TAB
Problem: Text property highlight doesn't override a sign highlight over
         a tab character
Solution: Let text_property override tab highlighting

This fixes a few problems of text properties:

-  text property highlighting when override=true does not overwrite TAB
   highlighting
-  text property highlighting when override=true does not overwrite TAB
   highlighting with :set list
-  text property highlighting is used instead of sign highlight after
   the actual text ends when signs are present with linehl is set

closes: #21584
closes: #21592

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-19 15:35:04 +02:00
Philip H
6d192a4ac9 patch 9.0.1748: CI: cannot label issues automatically
Problem:  CI: cannot label issues automatically
Solution: Create CI labeler

closes: #12788

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2023-08-19 14:45:26 +02:00
Viktor Szépe
b23db545ce docs: Improve Markdown in README (#12829) 2023-08-19 14:16:10 +02:00
zeertzjq
6235a109c4 patch 9.0.1747: screenpos() may cause unnecessary redraw
Problem:  screenpos() may cause unnecessary redraw.
Solution: Don't unnecessarily reset VALID_WROW flag.

VALID_WROW flag is only used by two functions: validate_cursor() and
cursor_valid(), and cursor_valid() is only used once in ex_sleep().
When adjust_plines_for_skipcol() was first added in patch 9.0.0640, it
was called in two functions: comp_botline() and curs_rows().
- comp_botline() is called in two places:
  - onepage(), which resets VALID_WROW flag immediately afterwards.
  - validate_botline_win(), where resetting a VALID_ flag is strange.
- curs_rows() is called in two places:
  - curs_columns(), which sets VALID_WROW flag afterwards.
  - validate_cline_row(), which is only used by GUI mouse focus.

Therefore resetting VALID_WROW there doesn't seem to do anything useful.
Also, a w_skipcol check (which resets VALID_WROW flag) was added to
check_cursor_moved() in patch 9.0.0734, which seems to make more sense
than resetting that flag in the middle of a computation.

While at it make adjust_plines_for_skipcol() and textpos2screenpos() a
bit less confusing:
- Make adjust_plines_for_skipcol() return "off" instead of "n - off".
- Use 0-based "row" in textpos2screenpos() until W_WINROW is added.

closes: #12832

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-19 14:12:42 +02:00
Christian Brabandt
28ae5a32fd patch 9.0.1746: vim9class compile error for char/char_u conversion
Problem: vim9class compile error for char/char_u conversion
Solution: Correctly cast to (char *)

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-19 14:10:48 +02:00
zeertzjq
fc3058495d patch 9.0.1745: Missing test coverage for blockwise Visual highlight
Problem:  Missing test coverage for blockwise Visual highlight with
          virtual that starts with a double-width char.
Solution: Add a new virtual text to the test. Some other small fixes.

closes: #12835

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-19 13:27:03 +02:00
Sean Dewar
c3172fe9e4 patch 9.0.1744: Dead code in open_cmdwin()
Problem: Dead code in open_cmdwin()
Solution: Remove it

closes: #12839

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
2023-08-19 13:23:50 +02:00
K.Takata
04510566b1 Translations: Update po files for zh and ja
Update po files by running `make` in `src/po/`.
Some po files were out of sync with the files in other encodings.

Related: #12749, #12787
closes: #12826
closes: #12840
2023-08-19 13:20:19 +02:00
Doug Kearns
44a6b72d7f patch 9.0.1743: Parameter of gui_gtk:gui_mch_browse incorrectly marked as UNUSED
Problem:    Parameter of gui_gtk:gui_mch_browse incorrectly marked as
            UNUSED.
Solution:   Remove UNUSED flag.

closes: #12841

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-08-19 13:13:11 +02:00
zeertzjq
9994160bfe patch 9.0.1742: wrong curswant when clicking on second cell of double-width char
Problem:  Wrong curswant when clicking and the second cell of a
          double-width char.
Solution: Don't copy virtcol of the first char to the second one.

closes: #12842

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-19 13:08:50 +02:00
LemonBoy
c5d2744c04 patch 9.0.1741: No type checking in interfaces
Problem: No type checking in interfaces
Solution: Implement member type check in vim9 interfaces

Most of the code is a small refactoring to allow the use of a where_T
for signaling the type mismatch, the type checking itself is pretty
simple.

Improve where_T error reports

Let the caller explicitly define the kind of location it's referring to
and free the WT_ARGUMENT enum from its catch-all role.

Implement type checking for interface methods

Follows closely the logic used for type-checking the members.

closes: #12844

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-08-19 13:04:53 +02:00
dkearns
56bafd7a6a Runtime: add new sed ftplugin (#12843) 2023-08-19 12:13:31 +02:00
Pierre Colin
0a07646845 patch 9.0.1740: segfault when reading invalid viminfo file
Problem: segfault when reading invalid viminfo file
Solution: Check the expected type in the viminfo file

Thanks to @yegappan for the included test.

closes: #12652
closes: #12845

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Pierre Colin <48397990+Pierre-Colin@users.noreply.github.com>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-19 11:56:57 +02:00
James McCoy
38ab19e00f patch 9.0.1739: Leftover files in libvterm
Problem: leftover files in libvterm
Solution: Fix cleaning of libvterm directory

Delete the libvterm/src/.libs directory and fix typo in libvterm/t/.libs
directory name.

closes: #12846

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: James McCoy <jamessan@jamessan.com>
2023-08-19 11:38:49 +02:00
zeertzjq
4dd266cb66 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: #12847

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-19 11:35:03 +02:00
Yegappan Lakshmanan
b102728c20 patch 9.0.1737: Calling a base class method through an extended class fails
Problem: Calling a base class method through an extended class fails
Solution: Create lookup table for member index in the interface to
          to the member class implementing the interface

Create additional tests for Vim9 classes.  Fix unconvered memory leaks
and crashes found by the new tests.

closes: #12848
closes: #12089

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>author
2023-08-19 11:26:42 +02:00
Antonio Giovanni Colombo
e27578aee6 Runtime: Update Italian Translation
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Antonio Giovanni Colombo <azc100@gmail.com>
2023-08-19 11:18:30 +02:00
Christian Brabandt
07a2b61d4c patch 9.0.1736: Github Actions times out after 20 minutes
Problem: Github Actions times out after 20 minutes
Solution: Increase the timeout to 25 minutes

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-18 01:20:42 +02:00
Bruno-366
817db406bb Add TODO, FIXME to Haskell syntax file (#8055)
Adding TODO, XXX, FIXME to Haskell syntax file #8054
2023-08-18 00:04:54 +02:00
Stuart Henderson
442d1746f4 bindzone runtime: add new DNS record types (#7351)
Recognize some newer DNS record types - CAA (RFC8659, certificate authority authorization), OPENPGPKEY (RFC7929), SMIMEA (RFC8162). Sort SSHFP alphabetically while there.
2023-08-18 00:04:24 +02:00
Yuri Klimov
a5988f582e Keywords 'of' and 'yield' for Javascript. (#7873)
* Keyword 'of' in for...of statement.

* Keyword 'yield' for generator function.
2023-08-18 00:03:23 +02:00
zeertzjq
e9ef347c13 patch 9.0.1735: Rename completion specific findex var
Problem: Rename completion specific findex var
Solution: Move "findex" static variable to xp_selected in expand_T

closes: #12548

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-17 23:57:05 +02:00
zeertzjq
be5cdd1d63 patch 9.0.1734: :runtime completion fails for multiple args
Problem: :runtime completion fails for multiple args
Solution: Make it work

closes: #12616

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-17 23:48:58 +02:00
Philip H
d2af6c66fe patch 9.0.1733: CI: cannot cache linux-modules-extra
Problem: CI: cannot cache linux-modules-extra
Solution: Enable caching and reduce failed downloads

closes: #12779

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2023-08-17 23:45:08 +02:00
Christian Brabandt
d5475e8d8d patch 9.0.1732: vimexpr: shadowing variable
Problem: vimexpr: shadowing variable
Solution: Rename local variable

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-17 23:41:33 +02:00
zeertzjq
6e940d9a1d patch 9.0.1731: blockwise Visual highlight not working with virtual text
Problem: blockwise Visual highlight not working with virtual text
Solution: Reset the correct variable at the end of virtual selection and
          Check for double-width char inside virtual text.

closes: #12606

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-17 23:21:40 +02:00
goweol
8cfe52e6fb man.vim: Recognise hyphenated-at-eol cross-references (#12609)
Manual pages requested for output may undergo formatting
arranged by some roff-descendant program. Lines longer
than MANWIDTH or COLUMNS or real-estate width of a device
(with support for horizontal scrolling considered) can be
divided at either blank characters and/or at groups of word
characters (syllables) according to supported hyphenation
rules (although page authors are free to disable hyphenation
or prevent particular words from being hyphenated).

Groff‘s manual describes it as follows:

    5.1.2 Hyphenation

    Since the odds are not great for finding a set of words, for
    every output line, which fit nicely on a line without
    inserting excessive amounts of space between words, gtroff
    hyphenates words so that it can justify lines without
    inserting too much space between words. It uses an internal
    hyphenation algorithm (a simplified version of the algorithm
    used within TeX) to indicate which words can be hyphenated
    and how to do so. When a word is hyphenated, the first part
    of the word is added to the current filled line being output
    (with an attached hyphen), and the other portion is added to
    the next line to be filled.

It would be expedient for autoload/dist/man.vim (along with
syntax/man.vim‘s highlighting and ftplugin/man.vim‘s Ctrl-],
\K mappings) to allow for hyphenation of cross-references
to manual pages.

For example,

  # Launch Vim [v9.0; patched: 1-1378, 1499] as follows:
  MANWIDTH=80 vim --not-a-term +MANPAGER '+Man man' '+/conv(1)' '+norm B'

  # Press Ctrl-] with cursor on _m_: "... use man‐
  # conv(1) directly."_______________________[^]
  #
  # (Man v2.11.2)

  # Launch Vim as follows:
  MANWIDTH=80 vim --not-a-term +MANPAGER '+Man git' '+/config(1)' '+norm B'

  # Press Ctrl-] with cursor on _g_: "... in git-
  # config(1) for a more ..."_______________[^]
  #
  # (Git v2.39.2)

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2023-08-17 23:13:29 +02:00
goweol
6e5ab2b994 man.vim: Uniformly place cursor at the same column with Ctrl-t (#12608)
Functions col and cursor count each tab (0x9) as a byte, and
are complementary. On the other hand, the | command motion
takes into consideration how many screen columns a tab does
occupy and may move cursor to a column closer to the start
of line than col would report at that position.

The provided changes prefer the cursor function to the | command.

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2023-08-17 23:12:42 +02:00
zeertzjq
008c91537b patch 9.0.1730: passing multiple patterns to runtime not working
Problem: passing multiple patterns to runtime not working
Solution: prepend prefix to each argument separately

closes: #12617

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-17 23:08:53 +02:00
zeertzjq
bfe377b8f2 patch 9.0.1729: screenpos() wrong when w_skipcol and cpoptions+=n
Problem:    screenpos() wrong result with w_skipcol and cpoptions+=n
Solution:   Use adjust_plines_for_skipcol() instead of subtracting
            w_skipcol.

closes: #12625

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-17 22:58:53 +02:00
zeertzjq
825cf813fa patch 9.0.1728: missing winid argument for virtcol()
Problem: missing winid argument for virtcol()
Solution: Add a {winid} argument to virtcol()

Other functions col(), charcol() and virtcol2col() support a {winid}
argument, so it makes sense for virtcol() to also support than.

Also add test for virtcol2col() with 'showbreak' and {winid}.

closes: #12633

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-17 22:55:25 +02:00
Sean Dewar
b0efa49ed1 patch 9.0.1727: minor problems with the teapot
Problem: minor problems with the teapot()
Solution: remove the null check, update documentation

Update the builtin-function-list entry. (It implicitly returns 0, but such
functions usually use "none")

Also, tv_get_string_strict() can not return NULL, so remove that check

closes: #12647

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
2023-08-17 22:48:43 +02:00
Sean Dewar
876f5fb570 patch 9.0.1726: incorrect heights in win_size_restore()
Problem: incorrect heights in win_size_restore()
Solution: avoid restoring incorrect heights in win_size_restore()

Changing 'showtabline' or 'cmdheight' in the cmdwin restores incorrect
window heights after closing the cmdwin.

This may produce a gap between the cmdline and the window above.

Solution: restore window sizes only if the number of lines available for windows
changed; subtract the rows of the tabline, cmdline and last window's statusline
from 'lines' (other statuslines don't matter).

closes: #12704

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
2023-08-17 22:40:05 +02:00
zeertzjq
e500ae8e29 patch 9.0.1725: cursor pos wrong after concealed text with 'virtualedit'
Problem:    Wrong cursor position when clicking after concealed text
            with 'virtualedit'.
Solution:   Store virtual columns in ScreenCols[] instead of text
            columns, and always use coladvance() when clicking.

This also fixes incorrect curswant when clicking on a TAB, so now
Test_normal_click_on_ctrl_char() asserts the same results as the ones
before patch 9.0.0048.

closes: #12808

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-17 22:35:26 +02:00
h-east
2261c89a49 patch 9.0.1724: vim9class constructor argument type checking bug
Problem: vim9class constructor argument type checking bug
Solution: fix it

closes: #12816

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: h-east <h.east.727@gmail.com>
2023-08-17 22:31:10 +02:00
Ivan Pešić
5a0dd71ed9 Update sr.po (#12820) 2023-08-17 22:28:59 +02:00
Yegappan Lakshmanan
bfc461f756 Use string interpolation (#12823) 2023-08-17 22:28:33 +02:00
zeertzjq
ad0c442f1f patch 9.0.1723: Fix regression in {func} argument of reduce()
Problem: Fix regression in {func} argument of reduce()
Solution: pass function name as string again

Before patch 9.0.0548, passing a string as {func} argument of reduce()
is treated as a function name, but after patch 9.0.0548 it is treated as
an expression instead, which is useless as reduce() doesn't set any v:
variables. This PR restores the behavior of {func} before that patch.

Also correct an emsg() call, as e_string_list_or_blob_required doesn't
contain format specifiers.

closes: #12824

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-17 22:15:47 +02:00
zeertzjq
4f389e7c0f patch 9.0.1722: wrong error messages when passing wrong types to count()
Problem: wrong error messages when passing wrong types to count()
Solution: fix it

This fixes two problems:
1. When passing wrong type to {ic} argument of count(), two error
   messages are given, the second of which is misleading.
2. When passing wrong type to {comp} argument of count(), the error
   message doesn't mention that {comp} may be a String.

closes: #12825

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-17 22:11:16 +02:00
zeertzjq
4112acae08 patch 9.0.1721: Build failure on Windows with dynamic lua
Problem: Build failure on Windows with dynamic lua (after 9.0.1719)
Solution: move definition further down in if_lua

closes: #12811
closes: #12814
closes: #12818

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-16 20:25:10 +02:00
Yegappan Lakshmanan
a456b12011 patch 9.0.1720: Vim9 class using wrong index for overridden method
Problem: Vim9 class using wrong index for overridden method
Solution: Use correct index for overridden method

closes: #12524
closes: #12813

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-16 20:14:37 +02:00
dkearns
20b33b56ad Update FreeBASIC syntax file (#12781) 2023-08-15 23:23:40 +02:00
依云
cf8cde2e5a zh_CN: update to use reordering (#12787) 2023-08-15 23:22:48 +02:00
Jesse Pavel
8a35033782 patch 9.0.1719: if_lua: crash for for Lua functions invoked via Vim callbacks
Problem: if_lua: crash for Lua functions invoked via Vim callbacks
Solution: Use Lua registry rather than upvalues for udata cache

closes: #12785

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Jesse Pavel <jpavel@alum.mit.edu>
2023-08-15 23:21:05 +02:00
LemonBoy
e98fb643ec patch 9.0.1718: dict-completion does not respect region
Problem: dict-completion does not respect region
Solution: respect selected region in dict completion

Set do_region to zero as we don't want a complete dump of the matching
words, we want the code to filter them according to the user's selected
region.

closes: #12792
closes: #7025

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-08-15 23:14:30 +02:00
Restorer
636d32b327 The keyboard layout "russian-typograph" has been updated to version 3.3 (#12796)
Co-authored-by: RestorerZ <restorer@mail2k.ru>
2023-08-15 23:06:18 +02:00
lunasophia
10f23e10a9 Update syntax/muttrc.vim to latest mutt (#12797)
Nothing complicated, just lots of tedium keeping the lines wrapped at
reasonable lengths.
2023-08-15 23:05:36 +02:00
Ajit-Thakkar
4868f637b8 Update syntax/fortran.vim (#12798)
Several small improvements including better discrimination of "real" used as a type and as an intrinsic
2023-08-15 23:05:00 +02:00
Yegappan Lakshmanan
b209b86e66 patch 9.0.1717: virtcol2col returns last byte of a multi-byte char
Problem: virtcol2col returns last byte of a multi-byte char
Solution: Make it return the first byte for a multi-byte char

closes: #12786
closes: #12799

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-15 23:01:44 +02:00
Zdenek Dohnal
15a0a0281a patch 9.0.1716: Windows build with python 3.12 and clang fails
Problem: Windows build with python 3.12 and clang fails
Solution: Remove the PyBool_Type function pointer for python 3.12

Clang on Win doesn't like non-static functions in static struct with
Python 3.12 - removing the new obfuscated function and protecting the
old PyBool function for older Pythons fixes the issue.

closes: #12800

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Zdenek Dohnal <zdohnal@redhat.com>
2023-08-15 22:52:01 +02:00
zeertzjq
7772c93a3e patch 9.0.1715: duplicate test in message_test.c
Problem: duplicate test in message_test.c
Solution: Remove duplicate test and make functions static

closes: #12803

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-15 22:48:40 +02:00
zeertzjq
e4c79d3615 patch 9.0.1714: getcompletion() "cmdline" fails after :autocmd
Problem:  getcompletion() "cmdline" fails after :autocmd
Solution: Use set_cmd_context() instead of set_one_cmd_context().

closes: #12804

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-15 22:41:53 +02:00
Zdenek Dohnal
ba913b14dd patch 9.0.1713: Github CI fails to load snd-dummy kernel module
Problem: Github CI fails to load snd-dummy kernel module
Solution: Make installation of linux-modules-extra optional

linux-modules-extra package are not available on Ubuntu 22 at the
moment, which breaks CI runs. The change make its installation
conditional as the original `if-else` structure tried to do.

closes: #12801

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Zdenek Dohnal <zdohnal@redhat.com>
2023-08-15 22:34:45 +02:00
Jia-Ju Bai
5b0889b8bf patch 9.0.1712: missing null check in object_clear()
Problem: missing null check in object_clear()
Solution: Add null check of cl

closes: #12627

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Jia-Ju Bai <baijiaju@buaa.edu.cn>
2023-08-13 20:05:18 +02:00
zeertzjq
d3515a1e88 patch 9.0.1711: dead code in charset.c
Problem: dead code in charset.c
Solution: remove it

linetabsize_col() calls init_chartabsize_arg() with 0 as "lnum", so
cts.cts_has_prop_with_text is always FALSE.

closes: #PR

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-13 20:00:14 +02:00
Christian Brabandt
4a8eb6e7a9 patch 9.0.1710: scrolloff options work slightly different
Problem: sidescrolloff and scrolloff options work slightly
         different than other global-local options
Solution: Make it behave consistent for all global-local options

It was noticed, that sidescrolloff and scrolloff options behave
differently in comparison to other global-local window options like
'listchars'

So make those two behave like other global-local options. Also add some
extra documentation for a few special local-window options.

Add a few tests to make sure all global-local window options behave
similar

closes: #12956
closes: #12643

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-13 19:43:42 +02:00
Zdenek Dohnal
e5e4709a6a patch 9.0.1709: dynamic build with python 3.12 breaks
Problem: dynamic build with python 3.12 breaks
Solution: if_python3.c: Fix building dynamic Python3 interpreter

There are new extern global variables defined in python3 development
files, which types are within python3 library, so they break dynamic
python3 interpret Vim plugin.

Since the variables are used in macro `Py_SIZE` which is used in other
python3 headers, the dummy variables have to defined before including
Python.h.

closes: #12660

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Zdenek Dohnal <zdohnal@redhat.com>
2023-08-13 19:39:27 +02:00
Christian Brabandt
8ef1fbc0c3 patch 9.0.1708: getcompletion() failes for user-defined commands
Problem: getcompletion() failes for user-defined commands
Solution: set context for completion function

closes: #12681
closes: #12680

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-13 19:32:37 +02:00
Christian Brabandt
badeedd913 patch 9.0.1707: Cannot wrap around in popup_filter_menu()
Problem: Cannot wrap around in popup_filter_menu()
Solution: Allow to wrap around by default

Currently, it is not possible, to wrap around at the end of the list
using e.g. down (and go back to the top) or up at the beginning of the
list and go directly to the last item. This is not consistent behaviour
with e.g. how the pum-menu currently works, so let's just allow this.

Also adjust tests about it.

closes: #12689
closes: #12693

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-13 19:27:46 +02:00
Matthias Braun
02551c9de0 patch 9.0.1706: typos in the xxd manpage
Problem: typos in the xxd manpage
Solution: Fix typos and formatting

closes: #12645

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Matthias Braun <mb720@users.noreply.github.com>
2023-08-13 19:21:38 +02:00
Christian Brabandt
96d6c4aabe runtime: Remove Brams email in indent/README.txt
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-13 18:17:21 +02:00
zeertzjq
b25dbb3f9b patch 9.0.1705: cursor position wrong when clicking on an unprintable char
Problem:  cursor position wrong when clicking on an unprintable char
Solution: Don't update prev_ptr when wlv.n_extra is not zero.

closes: #12664

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-13 18:11:05 +02:00
Christ van Willegen
0c6181fec4 patch 9.0.1704: Cannot use positional arguments for printf()
Problem: Cannot use positional arguments for printf()
Solution: Support positional arguments in string formatting

closes: #12140

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
2023-08-13 18:06:00 +02:00
Christian Brabandt
1688938dd5 runtime: Add a few more remarks about Bram and new runtime files
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-13 17:53:07 +02:00
Yegappan Lakshmanan
74cc13cc40 patch 9.0.1703: Vim9 Calling a method in an extended class fails
Problem: Vim9 Calling a method in an extended class fails
Solution: use method index directly

closes: #12778

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-13 17:41:26 +02:00
ObserverOfTime
9ad1bf7afd runtime(pymanifest): fix mistake in syntax definition
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-08-13 10:38:14 +02:00
Christian Brabandt
e978b4534a Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
* Dedicate upcoming Vim 9.1 to Bram

Also replace in a few more places Brams email address and mention new
maintainers.

* Remove Bram from any Maintainer role

* runtime: Align Header

* it's mailing list not mailinglist
2023-08-13 10:33:05 +02:00
zeertzjq
9c30f43899 patch 9.0.1702: Undo test is flaky
Problem:  Undo test is flaky.
Solution: Apply filter and change time to "1 second ago" in both dumps.

closes: #12771

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-13 10:31:27 +02:00
ObserverOfTime
2f339aad6c Add syntax & ftplugin for pymanifest (#12773) 2023-08-13 10:26:20 +02:00
ObserverOfTime
f9c4c2f97d Update iss syntax file (#11890)
- Add 'ExternalSize:' parameter
- Add 'setntfscompression' files flag
- Fix escaped left brace highlight
- Fix 'String:' parameter highlight
- Remove trailing whitespace
2023-08-13 10:25:41 +02:00
Yegappan Lakshmanan
57a02ccf4c patch 9.0.1701: vim9 crash when class member overridden
Problem: vim9 crash when class member overridden
Solution: Use method_count field instead

closes: #12676
closes: #12677

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-13 10:19:38 +02:00
K.Takata
32f586eec1 patch 9.0.1700: Cannot compile with dynamic perl < 5.38
Problem: Cannot compile with dynamic perl < 5.38 (after 9.0.1681)
Solution: Fix if_perl/dyn from perl 5.32 to 5.38

closes: #12755

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: K.Takata <kentkt@csc.jp>
2023-08-13 10:15:05 +02:00
Mike Williams
6c313bbb04 patch 9.0.1699: compile warning for xdiff/xutils on MS-Windows
Problem: compile warning for xdiff/xutils on MS-Windows
Solution: add explicit type cast from size_t to long

closes: #12531

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Mike Williams <mikew@globalgraphics.com>
2023-08-12 20:50:55 +02:00
zeertzjq
7fe1089904 patch 9.0.1698: Test_map_restore_sid fails in GUI
Problem: Test_map_restore_sid fails in GUI
Solution: Feed an unsimplified Ctrl-B

closes: #12770

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-12 20:44:21 +02:00
Christ van Willegen
73b8209266 patch 9.0.1697: incsearch test not sufficient
Problem: incsearch test not sufficient (after 9.0.1691)
Solution: add an additional test

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
2023-08-12 20:17:26 +02:00
Christian Brabandt
8878653a44 patch 9.0.1696: sodium_mlock may still fail in CI
Problem: sodium_mlock may still fail in CI
Solution: Catch E1230 in testscript and skip test

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-12 09:41:23 +02:00
Christian Brabandt
f1cc4d55b9 patch 9.0.1695: Crash with overlong textprop above
Problem: Crash with overlong textprop above
Solution: Consider only positive padding

closes: #12665
closes: #12661

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-12 00:14:14 +02:00
zeertzjq
bacc83009b patch 9.0.1694: wrong mapping applied when replaying a char search
Problem: wrong mapping applied when replaying a char search
Solution: Store a NOP after the ESC

closes: #12708
closes: #6350

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-12 00:09:31 +02:00
Christian Brabandt
2d63e4b3cc patch 9.0.1693: Ctrl-Q not handled like Ctrl-V in replace mode
Problem: Ctrl-Q not handled like Ctrl-V in replace mode
Solution: Handle Ctrl-Q like Ctrl-V

closes: #12686
closes: #12684

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-12 00:03:57 +02:00
cions
db4fd29063 patch 9.0.1692: Android not handling AI_V4MAPPED ai_flag
Problem: Android not handling AI_V4MAPPED ai_flag
Solution: don't set AI_V4MAPPED flag when on Android, since
          Android's getaddrinfo returns EAI_BADFLAGS if ai_flags
          contains it

closes: #12613

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: cions <gh.cions@gmail.com>
2023-08-11 23:53:13 +02:00
zeertzjq
7b7b4cb6f2 patch 9.0.1691: wrong viewport restored for incsearch and smoothscroll
Problem: wrong viewport restored for incsearch and smoothscroll
Solution: Save and restore skipcol as well

closes: #12713

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-11 23:48:27 +02:00
Christian Brabandt
f6cdab3704 patch 9.0.1690: popup_create() not aborting on errors
Problem: popup_create() not aborting on errors
Solution: check for errors in arguments given and abort if an error
          occurred

closes: #12711

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-11 23:42:02 +02:00
Zdenek Dohnal
288bf26c53 patch 9.0.1689: python 3.12 produces warnings and fails test
Problem: python 3.12 produces warnings and fails test
Solution: Make use of raw strings in python3 tests

closes: #12765

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Zdenek Dohnal <zdohnal@redhat.com>
2023-08-11 23:32:23 +02:00
Tom Praschan
ca6ac99077 patch 9.0.1688: cannot store custom data in quickfix list
Problem: cannot store custom data in quickfix list
Solution: add `user_data` field for the quickfix list

closes: #11818

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Tom Praschan <13141438+tom-anders@users.noreply.github.com>
2023-08-11 23:26:12 +02:00
zeertzjq
7e0bae024d patch 9.0.1687: mapset() not properly handling script ID
Problem: mapset() not properly handling script ID
Solution: replace_termcodes() may accept a script ID

closes: #12699
closes: #12697

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-11 23:16:10 +02:00
Philip H
cd4e4e169a .cirrus.yml: skip pkg update for FreeBSD 13.1 (#12767) 2023-08-11 23:10:02 +02:00
Keith Smiley
d8f981138a Add commentstring for nix file format (#12696) 2023-08-11 23:07:50 +02:00
Devin J. Pohly
5fee111149 patch 9.0.1686: undotree() only works for the current buffer
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: #4001
closes: #12292

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Devin J. Pohly <djpohly@gmail.com>
2023-08-11 22:53:39 +02:00
Philip H
422b9dcbfa patch 9.0.1685: silence Python 3.11 depreciations for gcc
Problem: Python 3.11 interface throws deprecation warnings
Solution: ignore those warnings for gcc and clang

Python 3.11 deprecation warnings are already silenced for clang using
the pragma
```
 # pragma clang diagnostic ignored "-Wdeprecated-declarations"
```

However those warnings are also emitted when using gcc. To avoid them
for both compilers, change use the __GNUC__ ifdef, which is defined for
gcc as well as clang.

Additionally, instead of using the "clang diagnostic ignored" pragma,
let's make use of 'GCC diagnostic ignored' which is again supported by
clang and GCC

closes: #12610

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2023-08-11 22:38:48 +02:00
zeertzjq
b00df7aa38 patch 9.0.1684: Update libvterm to rev 839
Problem: libvterm slightly outdated
Solution: Update libvterm from rev 818 to rev 839

Notable fix: libvterm now handles DECSM/DECRM with multiple arguents,
so several ncurses programs (e.g. nnn) can enable mouse properly when
run in Vim's terminal in XTerm.

closes: #12746

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-11 21:15:08 +02:00
dkearns
8f5a8d8a8b Update CODEOWNERS (#12760) 2023-08-11 19:30:55 +02:00
Lily Ballard
21aaff3faa Update my name and email in runtime files (#12763) 2023-08-11 19:30:27 +02:00
Hong Xu
dd0ad25988 Update syntax/dosini.vim to the latest version (#12764)
The latest version is in https://github.com/xuhdev/syntax-dosini.vim/blob/master/syntax/dosini.vim. I've sent the file to Bram at the end of June, unfortunately it wasn't able to make into the Vim repository. RIP!
2023-08-11 19:29:20 +02:00
Dragan Simic' via vim_dev
81b8bf5b4a Update the vimscript code for restoring cursor position
Using xxd(1) to filter and edit binary files causes the input files
to have dual nature, so to speak, which effectively makes restoring
the cursor position broken.  Fix that by ignoring the "xxd" file type
in the code that restores the cursor position.

Interactive rebasing in git causes files to be edited in vim, which,
similarly to commit messages, are rarely the same as the last one
edited.  Thus, also add "gitrebase" to the list of file types for
which the cursor position isn't restored.

While there, refactor the code a bit to possibly save a few CPU cycles
and to keep the line lengths in check, and use the long form of the
commands and variables, to make the code slightly more consistent and
more understandable to newcomers.

Update the relevant comments in the code and the associated parts of
the documentation, to keep them in sync with the updated code.

Remove some redundant trailing whitespace as well, as spotted.
2023-08-10 06:43:14 +02:00
Dragan Simic' via vim_dev
6a500661a9 Improve the vimscript code in ":h hex-editing"
Save and restore the view position before and after saving the buffer,
respectively, to keep the current view of the xxd(1)'s hex dump
unchanged after doing ":w", which previously caused the window to
scroll back to the very beginning of the buffer.  I believe it's
needless to say how annoying and counterproductive that was.

Get rid of the "Press ENTER or type command to continue" message, which
was previously displayed after opening larger binary files.  The use
of "silent" and "redraw" commands is tailored specifically to avoid
screen flickering, e.g. when doing ":w", which is caused by the buffer
being filtered by an external command.

Increase the number of octets per line, produced by xxd(1), from the
default value of 16 to 32.  This puts bigger chunks of the hex dump
on the screen and makes the whole thing much more usable.

While there, reformat the code to make it more readable, and use the
long form of the commands and variables to make the code slightly more
consistent and more understandable to newcomers.
2023-08-10 06:43:14 +02:00
Christian Brabandt
6efb198033 Updated runtime files
This is a collection of various PRs from github that all require a minor
patch number:

1) https://github.com/vim/vim/pull/12612

    Do not conflate dictionary key with end of block

2) https://github.com/vim/vim/pull/12729:

    When saving and restoring 'undolevels', the constructs `&undolevels` and
    `:set undolevels` are problematic.

    The construct `&undolevels` reads an unpredictable value; it will be the
    local option value (if one has been set), or the global option value
    (otherwise), making it unsuitable for saving a value for later
    restoration.

    Similarly, if a local option value has been set for 'undolevels',
    temporarily modifying the option via `:set undolevels` changes the local
    value as well as the global value, requiring extra work to restore both
    values.

    Saving and restoring the option value in one step via the construct
    `:let &undolevels = &undolevels` appears to make no changes to the
    'undolevels' option, but if a local option has been set to a different
    value than the global option, it has the unintended effect of changing
    the global 'undolevels' value to the local value.

    Update the documentation to explain these issues and recommend explicit
    use of global and local option values when saving and restoring.  Update
    some unit tests to use `g:undolevels`.

3) https://github.com/vim/vim/pull/12702:

    Problem:    Pip requirements files are not recognized.
    Solution:   Add a pattern to match pip requirements files.

4) https://github.com/vim/vim/pull/12688:

    Add indent file and tests for ABB Rapid

5) https://github.com/vim/vim/pull/12668:

    Use Lua 5.1 numeric escapes in tests and add to CI

    Only Lua 5.2+ and LuaJIT understand hexadecimal escapes in strings.  Lua
    5.1 only supports decimal escapes:

    > A character in a string can also be specified by its numerical value
    > using the escape sequence \ddd, where ddd is a sequence of up to three
    > decimal digits. (Note that if a numerical escape is to be followed by a
    > digit, it must be expressed using exactly three digits.) Strings in Lua
    > can contain any 8-bit value, including embedded zeros, which can be
    > specified as '\0'.

    To make sure this works with Lua 5.4 and Lua 5.1 change the Vim CI to
    run with Lua 5.1 as well as Lua 5.4

6) https://github.com/vim/vim/pull/12631:

    Add hurl filetype detection

7) https://github.com/vim/vim/pull/12573:

    Problem:   Files for haskell persistent library are not recognized
    Solution:  Add pattern persistentmodels for haskell persistent library

closes: #12612
closes: #12729
closes: #12702
closes: #12688
closes: #12668
closes: #12631
closes: #12573

Co-authored-by: lacygoill <lacygoill@lacygoill.me>
Co-authored-by: Michael Henry <drmikehenry@drmikehenry.com>
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
Co-authored-by: KnoP-01 <knosowski@graeffrobotics.de>
Co-authored-by: James McCoy <jamessan@jamessan.com>
Co-authored-by: Jacob Pfeifer <jacob@pfeifer.dev>
Co-authored-by: Borys Lykah <lykahb@fastmail.com>
2023-08-10 06:19:18 +02:00
Christian Brabandt
6019fed0c5 patch 9.0.1682: sodium encryption is not portable
Problem: crypt: sodium encryption is not portable
Solution: use little-endian byte order for sodium encrypted files

As mentioned in #12586, sodium encryption only works on little ending
architectures, because reading and writing the sodium encryption
parameters are stored in the encrypted files in an arch-dependent way.

This of course fails for big-endian architectures like s390.

So make sure to use little-endian byte order when reading and writing
sodium encrypted files.

fixes: #12586
closes: 12655
2023-08-09 21:35:38 +02:00
Patrick Meiser-Knosowski
92f076e53e Update krl and add rapid syntax files (#12750) 2023-08-09 20:35:35 +02:00
Santos Gallegos
6ec7808c4a Add security policy (#12687)
* Add security policy

Currently is hard to find where to report security issues,
the only mention of it is in the issue template.

4c0089d696/.github/ISSUE_TEMPLATE/bug_report.yml (L12-L15)

Adding a SECURITY.md file will make it easier to find,
it will be displayed in https://github.com/vim/vim/security.

* Mention that reports are private
2023-08-09 20:11:37 +02:00
Balki
c41b3c9f95 defaults.vim: Update comment to simplify reverting augroup
closes: #12673
2023-08-09 20:07:26 +02:00
Philip H
1d7caa58e3 patch 9.0.1681: Build Failure with Perl 5.38
Problem: Build Failure with Perl 5.38
Solution: Fix Build Failure

closes: #12543, closes: #12575
2023-08-09 19:58:58 +02:00
Christian Brabandt
335c584940 patch 9.0.1680: sodium test fails in Github CI
Problem:    sodium test fails in Github CI
Solution:   Catch sodium_mlock() errors and do not error out

sodium_mlock() seems to fail consistently on the Github CI. Perhaps
[sodium_mlock()](https://libsodium.gitbook.io/doc/memory_management#text-locking-memory)
is called too often or with too much memory by the runners so
that this starts failing.

Let's just try to catch this and skip the test, when this starts
happening.

closes: #12751
2023-08-09 18:16:16 +02:00
Daniel Steinberg
c2bd205254 Change "the" to "then" under ':help bufload()' (#12662) 2023-08-09 18:10:59 +02:00
Filip Gospodinov
64dea84bb0 Manpager: apply g flag conditionally to s command (#12679)
Problem: The `s` command with `g` flag only substitutes
         one occurrence when `gdefault` is set.
Solution: Use `g` flag conditionally.
2023-08-09 18:00:36 +02:00
Christian Brabandt
bd76c89e31 update matchit (#12611) 2023-08-09 17:39:53 +02:00
zeertzjq
0401933a5b Fix alignment in filetype.txt (#12618)
There are three spaces because the "<" is concealed.
2023-08-09 17:39:05 +02:00
Dominique Pellé
077ade4f67 feat: recognize geojson extension as json filetype (#12636) 2023-08-09 17:36:40 +02:00
Max Gautier
b69b9d5e17 Add filetype detection for eyaml files (#12659)
https://github.com/voxpupuli/hiera-eyaml/ uses and produces the eyaml
format, which is simply yaml with some encrypted values.

It's convenient to edit the file without decrypting when not touching
encrypted values (or when you don't have access to the decryption key),
which is why vim should treat those files as yaml files.
2023-08-09 17:18:36 +02:00
ObserverOfTime
958e15bb1c Highlight editorconfig properties with dashes (#12691)
Problem: editorconfig properties with dashes are not highlighted
Solution: update the property pattern to include dashes
2023-08-09 17:05:39 +02:00
Turiiya
2eb413f89b detect filetype for *.vsh and *.vv files (#12692)
Co-authored-by: Turiiya <34311583+tobealive@users.noreply.github.com>
2023-08-09 17:04:59 +02:00
ObserverOfTime
44ff25d524 PyPA manifest files are not recognized (#12707)
Problem:    PyPA manifest files are not recognized.
Solution:   Add a pattern to match PyPA manifest files.
2023-08-09 16:52:33 +02:00
Anton Parkhomenko
7159ac7fec Unison support (#12715) 2023-08-09 16:50:52 +02:00
Chris Vincent
8967f6c4b9 feat(heex): borrow matchit support from html (#12717)
* feat(heex): borrow matchit support from html

Makes % support behave the same in heex as in html. For example, quickly moving the cursor between opening and closing tags.

* Remove unnecessary line; define b:undo_ftplugin first

* Remove b:html_set_match_words
2023-08-09 16:49:44 +02:00
Gergő Sályi
a13eb2b147 Add WebGPU Shading Language (WGSL) filetype (#12723)
The current W3C Working Draft for the WebGPU Shading Language (WGSL) specifies
'text/wgsl' media type for WGSL modules with the '.wgsl' file extension:
https://www.w3.org/TR/WGSL/#text-wgsl-media-type

It has also been registered at the Internet Assigned Numbers Authority (IANA):
https://www.iana.org/assignments/media-types/text/wgsl

Neovim's nvim-lspconfig already associates wgsl language servers
with 'filetype wgsl':
https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#wgsl_analyzer

However currenly setting 'filetype wgsl' for *.wgsl files by defalut in Neovim
is blocked by adding this filetype to the vim project first:
https://github.com/neovim/neovim/pull/23331

This commit adds this missing wgsl filetype.
2023-08-09 16:49:01 +02:00
Linda_pp
8f566fdb1e update .wast files syntax highlighting (#12741) 2023-08-09 16:45:52 +02:00
Christian Brabandt
84bc00e9b5 patch 9.0.1679: Cleanup Tests from leftover files
Problem:    Tests may leave leftover files around
Solution:   Clean up tests and remove files

There were a few failures in 'linux (huge, gcc, testgui, true, true)'
e.g. here: https://github.com/vim/vim/actions/runs/5497376153/jobs/10018060156

,----
| Error detected while processing command line..script /home/runner/work/vim/vim/src/testdir/runtest.vim[585]..function RunTheTest[54]..Test_lvimgrep_crash[16]..TestTimeout[12]..VimLeavePre Autocommands for "*"..function EarlyExit[7]..FinishTesting:
| line   70:
| E445: Other window contains changes
| E937: Attempt to delete a buffer that is in use: Xtest_stable_xxd.txt
| E937: Attempt to delete a buffer that is in use: Xtest_stable_xxd.txt
| E937: Attempt to delete a buffer that is in use: Xtest_stable_xxd.txtmalloc(): unsorted double linked list corrupted
`----

Which is puzzling, because the Xtest_stable_xxd file should have been
long gone after test_crypt.vim is run (and definitely no longer be
staying around in test_quickfix.vim).

So try to clean up properly after a test script is run, just in case any
X<file> is still around. During testing, a found a few leftover files,
which I also fixed in the relevant test-file.

Unfortunately, the test workflow 'linux (huge, gcc, testgui, true,
true)' now seems to fail with 'E1230: Encryption: sodium_mlock()' in
test_crypt.vim. Hopefully this is only temporary.
2023-08-08 20:39:55 +02:00
Christian Brabandt
9fcde94176 Merge pull request #12740 from k-takata/import-9.0.1678
Bring Bram's last patch (9.0.1678) to GitHub
2023-08-07 17:00:41 +02:00
ObserverOfTime
ad34abee25 patch 9.0.1678: blade files are not recognized
Problem:    Blade files are not recognized.
Solution:   Add a pattern for Blade files. (closes #12650)

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-07 03:24:20 +09:00
THARAK HEGDE
4c0089d696 patch 9.0.1677: typo in syntax test input file
Problem:    Typo in syntax test input file.
Solution:   Fix the typo and the expected dump files. (THARAK HEGDE,
            closes #12635)
2023-07-09 02:38:28 +01:00
Bram Moolenaar
16abd997c9 patch 9.0.1676: warning for buffer in use when exiting early
Problem:    Warning for buffer in use when exiting early.
Solution:   Change file names to be able to see what buffer is in use when
            exiting.
2023-07-08 00:54:06 +01:00
Bram Moolenaar
7c2beb48ef patch 9.0.1675: test may run into timeout when using valgrind
Problem:    Test may run into timeout when using valgrind.
Solution:   Use a longer timeout when using valgrind.
2023-07-08 00:25:56 +01:00
Bram Moolenaar
416bd916b4 patch 9.0.1674: help for builtin functions is not sorted properly
Problem:    Help for builtin functions is not sorted properly.
Solution:   Put err_teapot() help in the right position.
2023-07-07 23:19:18 +01:00
Bram Moolenaar
80adaa8ae8 patch 9.0.1673: cannot produce a status 418 or 503 message
Problem:    Cannot produce a status 418 or 503 message.
Solution:   Add err_teapot().
2023-07-07 18:57:40 +01:00
zeertzjq
d392a74c5a patch 9.0.1672: tabline highlight wrong after truncated double width label
Problem:    Tabline highlight wrong after truncated double width label.
Solution:   Fill up half a double width character later. (closes #12614)
2023-07-01 20:24:40 +01:00
skywind3000
e7d9ca2b3b patch 9.0.1671: Termdebug: error with more than 99 breakpoints
Problem:    Termdebug: error with more than 99 breakpoints.
Solution:   Use a different sign for breakpoint 100 and over. (closes #12589,
            closes #12588)
2023-06-28 23:27:28 +01:00
Bram Moolenaar
bf5f189e44 patch 9.0.1670: resetting local option to global value is inconsistent
Problem:    Resetting local option to global value is inconsistent.
Solution:   Handle "<" specifically for 'scrolloff' and 'sidescrolloff'.
            (closes #12594)
2023-06-27 21:51:07 +01:00
Christian Brabandt
19e6c4fd2d patch 9.0.1669: Crash syncing swapfile in new buffer when using sodium crypt
Problem:    Crash syncing swapfile in new buffer when using sodium crypt.
            (James McCoy)
Solution:   Add checks for sodium encryption. (Christian Brabandt,
            closes #12591, closes #12585)
2023-06-27 18:57:10 +01:00
ObserverOfTime
0256d76a33 patch 9.0.1668: PEM files are not recognized
Problem:    PEM files are not recognized.
Solution:   Add patterns to match PEM files. (closes #12582)
2023-06-26 22:05:37 +01:00
zeertzjq
e429893741 patch 9.0.1667: regression test doesn't fail when fix is reverted
Problem:    Regression test doesn't fail when fix is reverted.
Solution:   Add "n" to 'cpoptions' instead of using :winsize. (closes #12587,
            issue #12528)
2023-06-26 19:02:43 +01:00
Christian Brabandt
a2a90d5e20 patch 9.0.1666: compiler may warn for uninitialized variable
Problem:    Compiler may warn for uninitialized variable.
Solution:   Initialize this_props_len. (Christian Brabandt, closes #12599)
2023-06-26 18:48:09 +01:00
Christian Brabandt
590aae3557 patch 9.0.1665: empty CmdlineEnter autocommand causes errors in Ex mode
Problem:    Empty CmdlineEnter autocommand causes errors in Ex mode.
Solution:   Save and restore ex_pressedreturn. (Christian Brabandt,
            closes # 12581, closes #12578)
2023-06-25 22:34:22 +01:00
fullwaywang
8154e642aa patch 9.0.1664: divide by zero when scrolling with 'smoothscroll' set
Problem:    Divide by zero when scrolling with 'smoothscroll' set.
Solution:   Avoid using a negative width. (closes #12540, closes #12528)
2023-06-24 21:58:09 +01:00
Christian Brabandt
c9a4a8ab28 patch 9.0.1663: Termdebug on MS-Windows: some file names are not recognized
Problem:    Termdebug on MS-Windows: some file names are not recognized.
Solution:   Do not always change \t and \n. (Christian Brabandt,
            closes #12565, closes #12560, closes #12550)
2023-06-24 20:02:25 +01:00
Bram Moolenaar
4e2406c7a9 patch 9.0.1662: crash when using a class member twice
Problem:    Crash when using a class member twice. (Christian J. Robinson)
Solution:   Make a copy of the value.
2023-06-24 19:22:21 +01:00
Son Luong Ngoc
b46e0f3263 patch 9.0.1661: BUCK files are not recognized
Problem:    BUCK files are not recognized.
Solution:   Recognize BUCK files as "bzl". (Son Luong Ngoc, closes #12564)
2023-06-24 17:11:04 +01:00
Yegappan Lakshmanan
2d8e998544 patch 9.0.1660: error for using matchfuzzy() returning a list of dicts
Problem:    Error for using matchfuzzy() in Vim9 script returning a list of
            dicts.
Solution:   Make return type of matchfuzzy() list<any>. (Yegappan Lakshmanan,
            closes #12574)
2023-06-24 16:42:25 +01:00
Christian Brabandt
279de0cd1f patch 9.0.1659: Termdebug: default highlight cleared if changing colorscheme
Problem:    Termdebug: default highlight cleared when changing colorscheme.
Solution:   Use a ColorScheme autocommand. (Christian Brabandt, closes #12566,
            closes #12555)
2023-06-24 14:20:36 +01:00
Christian Brabandt
c8b6d4b378 patch 9.0.1658: autoload files for "zig" are not installed
Problem:    Autoload files for "zig" are not installed.
Solution:   Add install and uninstall rules in the makefile. (Christian
            Brabandt, closes #12577, closes #12567)
2023-06-24 13:30:04 +01:00
Bram Moolenaar
79186bee78 patch 9.0.1657: one more syntax test depends on the system
Problem:    One more syntax test depends on the system.
Solution:   Use "dash" instead of "sh".
2023-06-24 01:35:51 +01:00
Bram Moolenaar
7d0dbd0070 patch 9.0.1656: syntax test fails when detected shell type differs
Problem:    Syntax test fails when detected shell type differs.
Solution:   Avoid using "/bin/sh", it depends on the system.  Add a check that
            the shell type detection is correct.
2023-06-24 00:56:50 +01:00
Bram Moolenaar
2f43ec9363 patch 9.0.1655: syntax test fails when Vim window is not tall enough
Problem:    Syntax test fails when Vim window is not tall enough.
Solution:   Make sure each terminal window is closed.
2023-06-23 22:59:26 +01:00
Bram Moolenaar
813b7a85f2 patch 9.0.1654: MS-Windows: test for default 'viewdir' fails
Problem:    MS-Windows: test for default 'viewdir' fails.
Solution:   Escape the pattern.
2023-06-23 22:56:47 +01:00
Christian Brabandt
b8b1c8ebd4 patch 9.0.1653: Amiga: default 'viewdir' may not work
Problem:    Amiga: default 'viewdir' may not work.
Solution:   Use "home:" instead of "$VIM". Add a test. (Christian Brabandt,
            closes #12576)
2023-06-23 22:23:01 +01:00
Bram Moolenaar
bd32e8ad8d patch 9.0.1652: unclear why syntax test fails on Mac
Problem:    Unclear why syntax test fails on Mac.
Solution:   Echo v:errors when it's not empty.
2023-06-23 21:36:31 +01:00
Bram Moolenaar
10c1dbc06a patch 9.0.1651: unclear why syntax test fails on Mac
Problem:    Unclear why syntax test fails on Mac.
Solution:   Temporarily show the whole "messages" file.
2023-06-23 19:37:19 +01:00
Bram Moolenaar
801961d2c2 patch 9.0.1650: MS-Windows: default 'viewdir' may include read-only directory
Problem:    MS-Windows: default 'viewdir' may include read-only directory.
Solution:   Use $HOME instead of $VIM for 'viewdir' default. (closes #12119)
2023-06-23 16:15:13 +01:00
Bram Moolenaar
c6530c9d68 patch 9.0.1649: syntax test failure causes script to abort
Problem:    Syntax test failure causes script to abort.
Solution:   Fix appending string to list.
2023-06-22 23:04:11 +01:00
Bram Moolenaar
031d632188 patch 9.0.1648: result of syntax tests is hard to see
Problem:    Result of syntax tests is hard to see.
Solution:   List the failed tests.
2023-06-22 22:38:54 +01:00
Bram Moolenaar
1aa5f1c21f patch 9.0.1647: insufficient testing for syntax plugins
Problem:    Insufficient testing for syntax plugins.
Solution:   Add shell file examples. (Charles Campbell)  Create a messages
            file for easier debugging and reporting the test results.
2023-06-22 21:57:51 +01:00
Philip H
982ded68b6 patch 9.0.1646: CI: codecov may take a very long time to run
Problem:    CI: codecov may take a very long time to run.
Solution:   Add a timeout. (Philip Heiduck, closes #12559)
2023-06-22 18:12:46 +01:00
=?UTF-8?q?Dominique=20Pell=C3=A9?=
2b994da57a patch 9.0.1645: zserio files are not recognized
Problem:    zserio files are not recognized.
Solution:   Add a pattern for zserio files. (Dominique Pellé,
            closes #12544)
2023-06-22 14:36:39 +01:00
smjonas
bd087ae8f0 patch 9.0.1644: not all filetype file name matches are tested
Problem:    Not all filetype file name matches are tested.
Solution:   Add more file names to test with. (Jonas Strittmatter,
            closes #12569)
2023-06-22 12:41:19 +01:00
Bram Moolenaar
c12e4eecbb patch 9.0.1643: filetype detection fails if file name ends in many '~'
Problem:    Filetype detection fails if file name ends in many '~'.
Solution:   Strip multiple '~' at the same time. (closes #12553)
2023-06-22 12:18:57 +01:00
Bram Moolenaar
545c8a506e patch 9.0.1642: build failure with tiny features
Problem:    Build failure with tiny features.
Solution:   Add #ifdef's.
2023-06-21 15:51:47 +01:00
Bram Moolenaar
55f1b822d8 patch 9.0.1641: the log file does not give information about window sizes
Problem:    The log file does not give information about window sizes.
Solution:   Add a few log messages about obtaining the window size.
2023-06-21 13:42:48 +01:00
Bram Moolenaar
7f29122c8c patch 9.0.1640: compiler warning for unused variables without crypt feature
Problem:    Compiler warning for unused variables without the crypt feature.
Solution:   Adjust #ifdefs
2023-06-17 16:19:30 +01:00
Bram Moolenaar
bc385a150f patch 9.0.1639: build failure without the crypt feature
Problem:    Build failure without the crypt feature.
Solution:   Adjust #ifdefs
2023-06-17 15:35:03 +01:00
Bram Moolenaar
438d0c5e58 patch 9.0.1638: crypt tests hang and cause memory errors
Problem:    crypt tests hang and cause memory errors
Solution:   Move variable to start of function.
2023-06-17 15:00:27 +01:00
Christian Brabandt
54f50cbf6a patch 9.0.1637: compiler warning for uninitialized variable
Problem:    Compiler warning for uninitialized variable.
Solution:   Move the variable to an inner block and initialize it. (Christian
            Brabandt, closes #12549)
2023-06-16 21:42:06 +01:00
zeertzjq
094dd152fe patch 9.0.1636: expanding a pattern interferes with cmdline completion
Problem:    Expanding a pattern interferes with command line completion.
Solution:   Set the file index only when appropriate. (closes #12519)
2023-06-15 22:51:57 +01:00
Bram Moolenaar
da51ad51bf patch 9.0.1635: error message is cleared when removing mode message
Problem:    Error message is cleared when removing mode message.
Solution:   Also reset flags when the message is further down.
2023-06-15 18:44:50 +01:00
Bram Moolenaar
800cdbb7ca patch 9.0.1634: message is cleared when removing mode message
Problem:    Message is cleared when removing mode message (Gary Johnson).
Solution:   Do not clear the command line after displaying a message.
2023-06-15 16:40:02 +01:00
zeertzjq
19dfa276c3 patch 9.0.1633: duplicate code for converting float to string
Problem:    Duplicate code for converting float to string.
Solution:   Use tv_get_string(). (closes #12521)
2023-06-15 10:56:41 +01:00
Marcin Szamotulski
166cd7b801 patch 9.0.1632: not all cabal config files are recognized
Problem:    Not all cabal config files are recognized.
Solution:   Add a couple of patterns. (Marcin Szamotulski, closes #12463)
2023-06-14 19:45:43 +01:00
zeertzjq
4c7cb372c1 patch 9.0.1631: passing wrong variable type to option gives multiple errors
Problem:    Passing a wrong variable type to an option gives multiple errors.
Solution:   Bail out early on failure. (closes #12504)
2023-06-14 16:39:54 +01:00
Ben Jackson
8d687a7424 patch 9.0.1630: "make clean" at the toplevel fails
Problem:    "make clean" at the toplevel fails.
Solution:   Clean the indent and syntax directories in a sub-shell.  (Ben
            Jackson, closes #12536, closes #12526)
2023-06-14 15:10:02 +01:00
Yegappan Lakshmanan
95707037af patch 9.0.1629: having utf16idx() rounding up is inconvenient
Problem:    Having utf16idx() rounding up is inconvenient.
Solution:   Make utf16idx() round down. (Yegappan Lakshmanan, closes #12523)
2023-06-14 13:10:15 +01:00
K.Takata
d5b952a871 patch 9.0.1628: syntax tests fail on FreeBSD
Problem:    Syntax tests fail on FreeBSD.
Solution:   Pass the Vim executable path with VIMPROG. (Ken Takata,
            closes #12535)  Adjust the paths.
2023-06-13 22:44:57 +01:00
Bram Moolenaar
46acad7284 patch 9.0.1627: no generic mechanism to test syntax plugins
Problem:    No generic mechanism to test syntax plugins.
Solution:   Add a syntax plugin test mechanism, using screendumps.  Add a
            simple test for "c".
2023-06-11 19:04:18 +01:00
Bram Moolenaar
10e8ff9b26 Update runtime files 2023-06-10 21:40:39 +01:00
Bram Moolenaar
f578ca2c8f patch 9.0.1626: Visual area not shown when using 'showbreak'
Problem:    Visual area not shown when using 'showbreak' and start of line is
            not visible. (Jaehwang Jung)
Solution:   Adjust "fromcol" for the space taken by 'showbreak'.
            (closes #12514)
2023-06-10 19:40:30 +01:00
Bram Moolenaar
ce723f3918 patch 9.0.1625: "super" is not considered a reserved name
Problem:    "super" is not considered a reserved name.
Solution:   Add "super" to the list of reserved names. (closes #12515)
2023-06-10 19:00:12 +01:00
Bram Moolenaar
5ca05fa59e patch 9.0.1624: crash when calling object constructor
Problem:    Crash when calling object constructor from legacy script. (Israel
            Chauca Fuentes)
Solution:   Pass a pointer for "ufunc". (closes #12502)
2023-06-10 16:45:13 +01:00
Bram Moolenaar
f07d1a7108 patch 9.0.1623: the program to filetype translation is not exported
Problem:    The program to filetype translation is not exported.
Solution:   Export Exe2filetype().
2023-06-09 21:01:47 +01:00
Christoph Sax
740df76c90 patch 9.0.1622: filetype name t32 is a bit obscure
Problem:    Filetype name t32 is a bit obscure.
Solution:   Rename t32 to trace32. (Christoph Sax, closes #12512)
2023-06-09 19:20:04 +01:00
Bram Moolenaar
c81dfaa69c patch 9.0.1621: FILETYPE_FILE is defined to the same value multiple times
Problem:    FILETYPE_FILE is defined to the same value multiple times.  Same
            for a few similar macros.
Solution:   Define FILETYPE_FILE and others in feature.h only
2023-06-08 22:16:23 +01:00
Bram Moolenaar
19548c6a74 patch 9.0.1620: Nix files are not recognized from the hashbang line
Problem:    Nix files are not recognized from the hashbang line.
Solution:   Add a hashbang check. (issue #12507)
2023-06-08 21:27:13 +01:00
Bram Moolenaar
85ef2df075 patch 9.0.1619: the focus gained/lost escape sequences cause trouble
Problem:    The focus gained/lost escape sequences cause trouble for a
            terminal where Vim does not expect them.
Solution:   Always recognize the codes for focus gained/lost. (closes #12499)
2023-06-08 18:44:01 +01:00
Christoph Sax
7fbcee6f92 patch 9.0.1618: Trace32 files are not recognized
Problem:    Trace32 files are not recognized.
Solution:   Add patterns for the t32 filetype. (Christoph Sax, closes #12505)
2023-06-08 17:57:19 +01:00
Yegappan Lakshmanan
577922b917 patch 9.0.1617: charidx() result is not consistent with byteidx()
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 #12503)
2023-06-08 17:09:45 +01:00
Shane Harper
5bf042810b patch 9.0.1616: quickfix text field is truncated
Problem:    Quickfix text field is truncated.
Solution:   Fix output of text field after pattern field in quickfix buffer.
            (Shane Harper, closes #12498)
2023-06-07 19:09:57 +01:00
ObserverOfTime
cdb7b4c508 patch 9.0.1615: URL shortcut files are not recognized
Problem:    URL shortcut files are not recognized.
Solution:   Add a pattern for URL shortcut files. (closes #12474)
2023-06-07 18:27:01 +01:00
zeertzjq
59f7038536 patch 9.0.1614: strlen() called too often for :spellrepall
Problem:    strlen() called too often for :spellrepall.
Solution:   Store the result in a variable. (closes #12497)
2023-06-06 15:59:59 +01:00
Gregory Anders
d1911a8e2b patch 9.0.1613: some make output gets picked up by 'errorformat'
Problem:    Some make output gets picked up by 'errorformat'.
Solution:   Ignore make output by default. (Gregory Anders, closes #12481)
2023-06-05 21:52:46 +01:00
Bram Moolenaar
15d4747ffd patch 9.0.1612: "skipcol" not reset when using multi-byte characters
Problem:    "skipcol" not reset when using multi-byte characters.
Solution:   Compare with w_virtcol instead of w_cursor.col. (closes #12457)
2023-06-05 20:44:55 +01:00
Bram Moolenaar
16d2c02c80 patch 9.0.1611: v:maxcol can be changed in a :for loop
Problem:    v:maxcol can be changed in a :for loop.
Solution:   Check for read-only loop variable. (closes #12470)
2023-06-05 19:46:18 +01:00
zeertzjq
d9a92dc70b patch 9.0.1610: display is wrong when 'smoothscroll' is set
Problem:    Display is wrong when 'smoothscroll' is set and scrolling multiple
            lines.
Solution:   Redraw with UPD_NOT_VALID when "skipcol" is or was set.
            (closes #12490, closes #12468)
2023-06-05 18:41:35 +01:00
Bram Moolenaar
f7ca56f719 patch 9.0.1609: crash when an object indirectly references itself
Problem:    Crash when an object indirectly references itself.
Solution:   Avoid clearing an object while it is already being cleared.
            (closes #12494)
2023-06-05 16:53:25 +01:00
Luuk van Baal
5c606846b9 patch 9.0.1608: update_topline() is called twice
Problem:    update_topline() is called twice.
Solution:   Do not call update_topline() before curs_columns(). (Luuk van
            Baal, closes #12495)
2023-06-05 15:00:05 +01:00
zeertzjq
55daae3921 patch 9.0.1607: screenpos() returns wrong row with diff filler lines
Problem:    screenpos() returns wrong row with diff filler lines.
Solution:   Only add filler lines when appropriate.  Also don't add the
            'smoothscroll' marker when w_skipcol is zero. (closes #12485,
            closes #12484)
2023-06-04 19:29:22 +01:00
zeertzjq
58e1e01045 patch 9.0.1606: using freed memory when 'foldcolumn' is set
Problem:    Using freed memory when 'foldcolumn' is set.
Solution:   Save extra pointer to free it later. (closes #12492)
2023-06-04 18:46:28 +01:00
Ernie Rael
114ec813b3 patch 9.0.1605: crash when calling method on super in child constructor
Problem:    Crash when calling method on super in child constructor. (Israel
            Chauca Fuentes)
Solution:   Clear the type list. (Ernie Rael, closes #12489, closes #12471)
2023-06-04 18:11:35 +01:00
Bram Moolenaar
abc8130d6a patch 9.0.1604: errors from the codestyle test are a bit confusing
Problem:    Errors from the codestyle test are a bit confusing.
Solution:   Use assert_report() with a clearer message.  Avoid a warning for
            an existing swap file.
2023-06-04 16:55:27 +01:00
zeertzjq
3c80227760 patch 9.0.1603: display wrong if scrolling multiple lines with 'smoothscroll'
Problem:    Display wrong when scrolling multiple lines with 'smoothscroll'
            set.
Solution:   Redraw when w_skipcol changed. (closes #12477, closes #12468)
2023-06-03 22:08:33 +01:00
zeertzjq
ecb87dd7d3 patch 9.0.1602: stray character visible if marker on top of double-wide char
Problem:    Stray character is visible if 'smoothscroll' marker is displayed
            on top of a double-wide character.
Solution:   When overwriting a double-width character with the 'smoothscroll'
            marker clear the second half. (closes #12469)
2023-06-03 19:45:06 +01:00
zeertzjq
664fd12aa2 patch 9.0.1601: filetype detection fails for *.conf file without comments
Problem:    Filetype detection fails for *.conf file without comments.
            (Dmitrii Tcyganok)
Solution:   Use "conf" filetype as a fallback for an empty .conf file.
            (closes #12487, closes #12483)
2023-06-03 17:56:30 +01:00
zeertzjq
f0e68c0e2a patch 9.0.1600: screenpos() does not take w_skipcol into account
Problem:    screenpos() does not take w_skipcol into account.
Solution:   Subtract w_skipcol from column. (closes #12486, closes #12476)
2023-06-03 17:11:47 +01:00
Luuk van Baal
a109f39ef5 patch 9.0.1599: Cursor not adjusted when 'splitkeep' is not "cursor"
Problem:    Cursor not adjusted when near top or bottom of window and
            'splitkeep' is not "cursor".
Solution:   Move boundary checks to outer cursor move functions, inner
            functions should only return valid cursor positions. (Luuk van
            Baal, closes #12480)
2023-06-02 14:16:35 +01:00
zeertzjq
47eec6716b patch 9.0.1598: screenchar() and others are wrong with DBCS 'encoding'
Problem:    screenchar(), screenchars() and screenstring() do not work
            properly when 'encoding' is set to a double-byte encoding.
Solution:   Fix the way the bytes of the characters are obtained.
            (issue #12469)
2023-06-01 20:26:55 +01:00
Bram Moolenaar
8509014add patch 9.0.1597: cursor ends up below the window after a put
Problem:    Cursor ends up below the window after a put.
Solution:   Mark w_crow and w_botline invalid when changing the cursor line.
            (closes #12465)
2023-06-01 19:27:08 +01:00
Julio B
eb43b7f053 patch 9.0.1596: :registers command does not work in sandbox
Problem:    :registers command does not work in sandbox.
Solution:   Add flag to the command. (closes #12473)
2023-06-01 12:45:22 +01:00
Luuk van Baal
e84c773d42 patch 9.0.1595: line pointer becomes invalid when using spell checking
Problem:    Line pointer becomes invalid when using spell checking.
Solution:   Call ml_get() at the right places. (Luuk van Baal, closes #12456)
2023-05-31 18:57:36 +01:00
RestorerZ
68ebcee023 patch 9.0.1594: some internal error messages are translated
Problem:    Some internal error messages are translated.
Solution:   Consistently do not translate internal error messages.
            (closes #12459)
2023-05-31 17:12:14 +01:00
K.Takata
3c240f608c patch 9.0.1593: MS-Windows: assert error when compiled with debug mode
Problem:    MS-Windows: assert error when compiled with debug mode.
Solution:   Adjust arguments to setvbuf(). (Ken Takata, closes #12467)
2023-05-31 12:47:45 +01:00
Bram Moolenaar
29b4c513b1 patch 9.0.1592: not all timer tests are marked as flaky
Problem:    Not all timer tests are marked as flaky.
Solution:   Set the flaky flag for all timer tests. (closes #12355)
2023-05-30 15:34:50 +01:00
Omar El Halabi
c9fbd2560f patch 9.0.1591: some "gomod" files are not recognized
Problem:    Some "gomod" files are not recognized.
Solution:   Check for "go.mod" file name before checking out the contents.
            (Omar El Halabi, closes #12462)
2023-05-29 19:59:45 +01:00
Bram Moolenaar
247caa378f patch 9.0.1590: filetype test has trailing white space
Problem:    Filetype test has trailing white space.
Solution:   Remove trailing white space.
2023-05-29 17:37:13 +01:00
Bram Moolenaar
b140c114f6 patch 9.0.1589: filetype test contains too many special characters
Problem:    Filetype test contains too many special characters.
Solution:   Use Vim9 syntax for a few things.
2023-05-29 17:06:05 +01:00
K.Takata
9cf6ab1332 patch 9.0.1588: Incsearch not triggered when pasting clipboard register
Problem:    Incsearch not triggered when pasting clipboard register on the
            command line.
Solution:   Also set "literally" when using a clipboard register. (Ken Takata,
            closes #12460)
2023-05-29 16:08:08 +01:00
Jake Stanger
05843e8960 patch 9.0.1587: Corn config files are not recognized
Problem:    Corn config files are not recognized.
Solution:   Add a pattern for Corn config files. (Jake Stanger, closes #12449)
2023-05-28 22:11:21 +01:00
Bram Moolenaar
78ee62563e patch 9.0.1586: error for using two messages with ngettext() differing in "%"
Problem:    Checking translations gives an error for using two messages with
            ngettext() that differ in "%" items.
Solution:   Adjust the check script to tolerate omitting one "%" item.
2023-05-28 18:39:55 +01:00
Luuk van Baal
30805a1aba patch 9.0.1585: weird use of static variables for spell checking
Problem:    Weird use of static variables for spell checking.
Solution:   Move the variables to a structure and pass them from win_update()
            to win_line(). (Luuk van Baal, closes #12448)
2023-05-27 22:22:10 +01:00
Bram Moolenaar
1ba0b9e36f patch 9.0.1584: not all meson files are recognized
Problem:    Not all meson files are recognized.
Solution:   Add "meson.options". (Liam Beguin, closes #12444)
2023-05-27 19:01:52 +01:00
Bram Moolenaar
3a2a60ce4a patch 9.0.1583: get E304 when using 'cryptmethod' "xchacha20v2"
Problem:    Get E304 when using 'cryptmethod' "xchacha20v2". (Steve Mynott)
Solution:   Add 4th crypt method to block zero ID check.  Avoid syncing a swap
            file before reading the file. (closes #12433)
2023-05-27 18:02:55 +01:00
zeertzjq
a40c0bcc83 patch 9.0.1582: :stopinsert may not work in a popup close handler
Problem:    :stopinsert may not work in a popup close handler. (Ben Jackson)
Solution:   Restore stop_insert_mode when appropriate. (closes #12452,
            closes #12434)
2023-05-27 14:10:08 +01:00
Bram Moolenaar
a1d5f9f33c patch 9.0.1581: translation does not work for plural argument
Problem:    Translation does not work for plural argument.
Solution:   Use PLURAL_MSG() for errors and with xgettext. (closes #12443)
2023-05-27 13:40:11 +01:00
ichizok
9f3afe7a70 patch 9.0.1580: CI: indent test hangs on FreeBSD
Problem:    CI: indent test hangs on FreeBSD.
Solution:   Set 'nomore' when running the indent tests. (Ozaki Kiichi,
            closes #12446)
2023-05-26 14:40:45 +01:00
RestorerZ
d87dec0582 patch 9.0.1579: some error messages are not translated
Problem:    Some error messages are not translated.
Solution:   Add the N_() marker on messages. (closes #12427)
2023-05-25 20:13:48 +01:00
Luuk van Baal
2ac6497f0e patch 9.0.1578: SpellCap highlight not always updated when needed
Problem:    SpellCap highlight not always updated when needed.
Solution:   Handle updating line below closed fold and other situations where
            only part of the window is redrawn. (Luuk van Baal, closes #12428,
            closes #12420)
2023-05-25 17:14:42 +01:00
K.Takata
1271572a35 patch 9.0.1577: MS-Windows: context menu translations may be wrong
Problem:    MS-Windows: context menu translations may be wrong.
Solution:   Set the encoding before using gettext(). (Ken Takata,
            closes #12441, closes #12431)
2023-05-25 16:43:27 +01:00
Bram Moolenaar
097c5370ea patch 9.0.1576: users may not know what to do with an internal error
Problem:    Users may not know what to do with an internal error.
Solution:   Add a translated message with instructions.
2023-05-24 21:02:24 +01:00
Bram Moolenaar
a8490a4952 patch 9.0.1575: "file N of M" message is not translated
Problem:    "file N of M" message is not translated.
Solution:   Make argument count message translatable. (close #12429)
2023-05-23 18:00:58 +01:00
Bram Moolenaar
167fb6d39b patch 9.0.1574: MS-Windows: list of translation input files incomplete
Problem:    MS-Windows: list of translation input files incomplete.
Solution:   Move the list of files to a common file. (closes #12426)
2023-05-23 15:27:51 +01:00
Bram Moolenaar
d4a9b7f614 patch 9.0.1573: error for function name has wrong line number
Problem:    Error for function name has wrong line number.
Solution:   Set the line number before giving the error.
2023-05-23 14:48:42 +01:00
Bram Moolenaar
50809a45eb patch 9.0.1572: error messages are not translated
Problem:    Error messages are not translated.
Solution:   Add _().
2023-05-20 16:39:07 +01:00
Bram Moolenaar
79cdf026f1 patch 9.0.1571: RedrawingDisabled not used consistently
Problem:    RedrawingDisabled not used consistently.
Solution:   Avoid RedrawingDisabled going negative.  Set RedrawingDisabled in
            win_split_ins(). (closes #11961)
2023-05-20 14:07:00 +01:00
Bram Moolenaar
bf63011a52 patch 9.0.1570: some tests are slow
Problem:    Some tests are slow.
Solution:   Make a few test cases faster.
2023-05-19 21:41:02 +01:00
900 changed files with 70608 additions and 25658 deletions

View File

@@ -29,7 +29,6 @@ environment:
# disabled
# - FEATURE: TINY
# - FEATURE: NORMAL
# - FEATURE: BIG
matrix:
fast_finish: true

View File

@@ -5,15 +5,11 @@ env:
freebsd_task:
name: FreeBSD
matrix:
- name: FreeBSD 13.1
- name: FreeBSD 14.0
freebsd_instance:
image_family: freebsd-13-1
- name: FreeBSD 12.4
freebsd_instance:
image_family: freebsd-12-4
image_family: freebsd-14-0
timeout_in: 20m
install_script:
- pkg update -f
- pkg install -y gettext
build_script:
- NPROC=$(getconf _NPROCESSORS_ONLN)
@@ -25,22 +21,3 @@ freebsd_task:
- pw useradd cirrus -m
- chown -R cirrus:cirrus .
- sudo -u cirrus make test
macos_task:
name: macOS m1
macos_instance:
image: ghcr.io/cirruslabs/macos-ventura-xcode:latest
env:
# only run with clang, gcc is not real, it is a link to clang
CC: clang
timeout_in: 20m
install_script:
- brew update
- brew install gettext libtool diffutils
build_script:
- NPROC=$(getconf _NPROCESSORS_ONLN)
- ./configure --with-features=${FEATURES}
- make -j${NPROC}
test_script:
- src/vim --version
- make test

View File

@@ -5,6 +5,8 @@ coverage:
default:
threshold: 0.05%
comment: false
# Files not run by tests
ignore:
- "src/dosinst.c"

View File

@@ -1 +0,0 @@
service_name: github-actions

31
.github/CODEOWNERS vendored
View File

@@ -18,6 +18,7 @@ runtime/autoload/netrwFileHandlers.vim @cecamp
runtime/autoload/netrwSettings.vim @cecamp
runtime/autoload/php.vim @david-szabo97
runtime/autoload/rubycomplete.vim @segfault @dkearns
runtime/autoload/rust.vim @lilyball
runtime/autoload/tar.vim @cecamp
runtime/autoload/vimball.vim @cecamp
runtime/autoload/xmlformat.vim @chrisbra
@@ -132,6 +133,7 @@ runtime/ftplugin/eruby.vim @tpope @dkearns
runtime/ftplugin/expect.vim @dkearns
runtime/ftplugin/fennel.vim @gpanders
runtime/ftplugin/fetchmail.vim @dkearns
runtime/ftplugin/forth.vim @jkotlinski
runtime/ftplugin/fpcmake.vim @dkearns
runtime/ftplugin/freebasic.vim @dkearns
runtime/ftplugin/fstab.vim @rid9
@@ -150,17 +152,21 @@ runtime/ftplugin/go.vim @dbarnett
runtime/ftplugin/gprof.vim @dpelle
runtime/ftplugin/haml.vim @tpope
runtime/ftplugin/hare.vim @rsaihe
runtime/ftplugin/heex.vim @cvincent
runtime/ftplugin/hgcommit.vim @k-takata
runtime/ftplugin/hog.vim @wtfbbqhax
runtime/ftplugin/html.vim @dkearns
runtime/ftplugin/i3config.vim @hiqua
runtime/ftplugin/icon.vim @dkearns
runtime/ftplugin/indent.vim @dkearns
runtime/ftplugin/ishd.vim @dkearns
runtime/ftplugin/j.vim @glts
runtime/ftplugin/javascript.vim @dkearns
runtime/ftplugin/javascriptreact.vim @dkearns
runtime/ftplugin/jsonc.vim @izhakjakov
runtime/ftplugin/julia.vim @carlobaldassi
runtime/ftplugin/kconfig.vim @chrisbra
runtime/ftplugin/kotlin.vim @udalov
runtime/ftplugin/less.vim @genoma
runtime/ftplugin/liquid.vim @tpope
runtime/ftplugin/lua.vim @dkearns
@@ -180,13 +186,16 @@ runtime/ftplugin/pascal.vim @dkearns
runtime/ftplugin/pbtxt.vim @lakshayg
runtime/ftplugin/pdf.vim @tpope
runtime/ftplugin/perl.vim @petdance @dkearns
runtime/ftplugin/php.vim @dkearns
runtime/ftplugin/pod.vim @petdance @dkearns
runtime/ftplugin/poefilter.vim @ObserverOfTime
runtime/ftplugin/postscr.vim @mrdubya
runtime/ftplugin/ps1.vim @heaths
runtime/ftplugin/ps1xml.vim @heaths
runtime/ftplugin/pymanifest.vim @ObserverOfTime
runtime/ftplugin/python.vim @tpict
runtime/ftplugin/qb64.vim @dkearns
runtime/ftplugin/qml.vim @ChaseKnowlden
runtime/ftplugin/r.vim @jalvesaq
runtime/ftplugin/racket.vim @benknoble
runtime/ftplugin/readline.vim @dkearns
@@ -197,11 +206,14 @@ runtime/ftplugin/routeros.vim @zainin
runtime/ftplugin/rrst.vim @jalvesaq
runtime/ftplugin/rst.vim @marshallward
runtime/ftplugin/ruby.vim @tpope @dkearns
runtime/ftplugin/rust.vim @lilyball
runtime/ftplugin/sass.vim @tpope
runtime/ftplugin/scala.vim @derekwyatt
runtime/ftplugin/scss.vim @tpope
runtime/ftplugin/sdoc.vim @gpanders
runtime/ftplugin/sed.vim @dkearns
runtime/ftplugin/sh.vim @dkearns
runtime/ftplugin/solidity.vim @cothi
runtime/ftplugin/solution.vim @dkearns
runtime/ftplugin/spec.vim @ignatenkobrain
runtime/ftplugin/ssa.vim @ObserverOfTime
@@ -215,6 +227,7 @@ runtime/ftplugin/toml.vim @averms
runtime/ftplugin/tt2html.vim @petdance
runtime/ftplugin/typescript.vim @dkearns
runtime/ftplugin/typescriptreact.vim @dkearns
runtime/ftplugin/unison.vim @chuwy
runtime/ftplugin/vdf.vim @ObserverOfTime
runtime/ftplugin/wast.vim @rhysd
runtime/ftplugin/wget.vim @dkearns
@@ -251,6 +264,7 @@ runtime/indent/go.vim @dbarnett
runtime/indent/gyp.vim @ObserverOfTime
runtime/indent/haml.vim @tpope
runtime/indent/hare.vim @rsaihe
runtime/indent/hog.vim @wtfbbqhax
runtime/indent/idlang.vim @dkearns
runtime/indent/j.vim @glts
runtime/indent/java.vim @xuhdev
@@ -258,6 +272,8 @@ runtime/indent/javascript.vim @bounceme
runtime/indent/json.vim @elzr
runtime/indent/jsonc.vim @izhakjakov
runtime/indent/julia.vim @carlobaldassi
runtime/indent/kotlin.vim @udalov
runtime/indent/krl.vim @KnoP-01
runtime/indent/ld.vim @dkearns
runtime/indent/less.vim @genoma
runtime/indent/liquid.vim @tpope
@@ -274,8 +290,10 @@ runtime/indent/postscr.vim @mrdubya
runtime/indent/prolog.vim @dkearns
runtime/indent/ps1.vim @heaths
runtime/indent/qb64.vim @dkearns
runtime/indent/qml.vim @ChaseKnowlden
runtime/indent/r.vim @jalvesaq
runtime/indent/racket.vim @benknoble
runtime/indent/rapid.vim @KnoP-01
runtime/indent/readline.vim @dkearns
runtime/indent/rhelp.vim @jalvesaq
runtime/indent/rmd.vim @jalvesaq
@@ -286,6 +304,7 @@ runtime/indent/sass.vim @tpope
runtime/indent/scala.vim @derekwyatt
runtime/indent/scss.vim @tpope
runtime/indent/sh.vim @chrisbra
runtime/indent/solidity.vim @cothi
runtime/indent/systemverilog.vim @Kocha
runtime/indent/tcl.vim @dkearns
runtime/indent/tcsh.vim @dkearns
@@ -308,7 +327,7 @@ runtime/plugin/tarPlugin.vim @cecamp
runtime/plugin/vimballPlugin.vim @cecamp
runtime/plugin/zipPlugin.vim @cecamp
runtime/plugin/manpager.vim @Konfekt
runtime/syntax/shared/hgcommitDiff.vim @vegerot
runtime/syntax/shared/hgcommitDiff.vim @vegerot
runtime/syntax/abaqus.vim @costerwi
runtime/syntax/aidl.vim @dpelle
runtime/syntax/amiga.vim @cecamp
@@ -369,6 +388,7 @@ runtime/syntax/gitolite.vim @sitaramc
runtime/syntax/gitrebase.vim @tpope
runtime/syntax/go.vim @bhcleek
runtime/syntax/godoc.vim @dbarnett
runtime/syntax/gp.vim @KBelabas
runtime/syntax/gprof.vim @dpelle
runtime/syntax/groff.vim @jmarshall
runtime/syntax/gyp.vim @ObserverOfTime
@@ -377,6 +397,7 @@ runtime/syntax/hare.vim @rsaihe
runtime/syntax/haskell.vim @coot
runtime/syntax/hgcommit.vim @k-takata
runtime/syntax/hitest.vim @lacygoill
runtime/syntax/hog.vim @wtfbbqhax
runtime/syntax/hollywood.vim @sodero
runtime/syntax/html.vim @dkearns
runtime/syntax/i3config.vim @hiqua
@@ -389,6 +410,8 @@ runtime/syntax/javascript.vim @fleiner
runtime/syntax/jsonc.vim @izhakjakov
runtime/syntax/julia.vim @carlobaldassi
runtime/syntax/kconfig.vim @chrisbra
runtime/syntax/kotlin.vim @udalov
runtime/syntax/krl.vim @KnoP-01
runtime/syntax/less.vim @genoma
runtime/syntax/lex.vim @cecamp
runtime/syntax/liquid.vim @tpope
@@ -428,10 +451,13 @@ runtime/syntax/prolog.vim @XVilka
runtime/syntax/ps1.vim @heaths
runtime/syntax/ps1xml.vim @heaths
runtime/syntax/psl.vim @danielkho
runtime/syntax/pymanifest.vim @ObserverOfTime
runtime/syntax/qb64.vim @dkearns
runtime/syntax/qml.vim @ChaseKnowlden
runtime/syntax/r.vim @jalvesaq
runtime/syntax/racket.vim @benknoble
runtime/syntax/raml.vim @in3d
runtime/syntax/rapid.vim @KnoP-01
runtime/syntax/ratpoison.vim @trapd00r
runtime/syntax/rc.vim @chrisbra
runtime/syntax/rcs.vim @hdima
@@ -452,6 +478,7 @@ runtime/syntax/sdoc.vim @gpanders
runtime/syntax/sed.vim @dkearns
runtime/syntax/sh.vim @cecamp
runtime/syntax/sm.vim @cecamp
runtime/syntax/solidity.vim @cothi
runtime/syntax/spec.vim @ignatenkobrain
runtime/syntax/sqloracle.vim @chrisbra
runtime/syntax/squirrel.vim @zenmatic
@@ -477,6 +504,7 @@ runtime/syntax/tt2js.vim @petdance
runtime/syntax/typescript.vim @HerringtonDarkholme
runtime/syntax/typescriptcommon.vim @HerringtonDarkholme
runtime/syntax/typescriptreact.vim @HerringtonDarkholme
runtime/syntax/unison.vim @chuwy
runtime/syntax/vdf.vim @ObserverOfTime
runtime/syntax/vim.vim @cecamp
runtime/syntax/vroom.vim @dbarnett
@@ -491,6 +519,7 @@ runtime/syntax/xs.vim @petdance
runtime/syntax/xslt.vim @Boobies
runtime/syntax/xxd.vim @cecamp
runtime/syntax/yacc.vim @cecamp
runtime/syntax/zserio.vim @dpelle
runtime/syntax/zsh.vim @chrisbra
runtime/tutor/tutor.eo @dpelle
runtime/tutor/tutor.eo.utf-8 @dpelle

60
.github/labeler.yml vendored Normal file
View File

@@ -0,0 +1,60 @@
# list of labels and minimatch globs to match to apply the label.
CI:
- any: ['.cirrus.yml']
- any: ['.github/dependabot.yml']
- any: ['.github/labeler.yml']
- any: ['.github/workflows/*']
- any: ['.appveyor.yml']
- any: ['.codecov.yml']
translation:
- any: ['src/po/*.po']
if_lua:
- any: ['src/if_lua.c']
- any: ['src/proto/if_lua.pro']
- any: ['runtime/doc/if_lua.txt']
if_mzscheme:
- any: ['src/if_mzsch.c']
- any: ['src/if_mzsch.h']
- any: ['src/proto/if_mzsch.pro']
- any: ['runtime/doc/if_mzsch.txt']
if_perl:
- any: ['src/if_perl.xs']
- any: ['src/if_perlsfio.c']
- any: ['src/proto/if_perl.pro']
- any: ['src/proto/if_perlsfio.pro']
- any: ['runtime/doc/if_perl.txt']
if_python:
- any: ['src/if_py_both.h']
- any: ['runtime/doc/if_pyth.txt']
- any: ['src/if_python.c']
- any: ['src/if_python3.c']
- any: ['src/proto/if_python.pro']
- any: ['src/proto/if_python3.pro']
if_ruby:
- any: ['src/if_ruby.c']
- any: ['src/proto/if_ruby.pro']
- any: ['runtime/doc/if_ruby.txt']
if_tcl:
- any: ['src/if_tcl.c']
- any: ['src/proto/if_tcl.pro']
- any: ['runtime/doc/if_tcl.txt']
runtime:
- any: ['runtime/ftplugin']
- any: ['runtime/syntax']
- any: ['runtime/indent']
- any: ['runtime/pack/dist/opt/termdebug/plugin/termdebug.vim']
termdebug: runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
plugin-netrw:
- any: ['runtime/plugin/netrwPlugin.vim']
- any: ['runtime/autoload/netrw*']

View File

@@ -22,11 +22,10 @@ jobs:
env:
CC: ${{ matrix.compiler }}
GCC_VER: 13
CLANG_VER: 16
CLANG_VER: 17
TEST: test
SRCDIR: ./src
LEAK_CFLAGS: -DEXITFREE
CFLAGS: -Wno-deprecated-declarations
LOG_DIR: ${{ github.workspace }}/logs
TERM: xterm
DISPLAY: ':99'
@@ -37,60 +36,82 @@ jobs:
matrix:
features: [tiny, normal, huge]
compiler: [clang, gcc]
extra: [none]
extra: [[]]
# Only use non-native architecture when features != huge.
# features=huge tries to install python3-dev, which fails to install
# for the non-native architecture.
architecture: [native]
include:
- features: tiny
compiler: clang
extra: nogui
extra: [nogui]
- features: tiny
compiler: gcc
extra: nogui
extra: [nogui]
- features: normal
shadow: ./src/shadow
- features: huge
coverage: true
- features: huge
compiler: gcc
architecture: i386
- features: huge
coverage: true
extra: testgui
uchar: true
- features: huge
compiler: clang
extra: asan
interface: dynamic
python3: stable-abi
- features: huge
compiler: gcc
coverage: true
extra: unittests
interface: dynamic
extra: [uchar, testgui]
- features: huge
compiler: clang
# Lua5.1 is the most widely used version (since it's what LuaJIT is
# compatible with), so ensure it works
lua_ver: '5.1'
extra: [asan]
- features: huge
compiler: gcc
coverage: true
extra: [unittests]
- features: normal
compiler: gcc
extra: vimtags
extra: [vimtags]
steps:
- name: Checkout repository from github
uses: actions/checkout@v3
uses: actions/checkout@v4
- run: sudo dpkg --add-architecture i386
if: matrix.architecture == 'i386'
- name: Install packages
run: |
PKGS=( \
gettext \
libgtk2.0-dev \
libgtk2.0-dev:${{ matrix.architecture }} \
desktop-file-utils \
libtool-bin \
libncurses-dev:${{ matrix.architecture }} \
libxt-dev:${{ matrix.architecture }} \
)
if ${{ matrix.features == 'huge' }}; then
LUA_VER=${{ matrix.lua_ver || '5.4' }}
PKGS+=( \
autoconf \
gdb \
lcov \
libcanberra-dev \
libperl-dev \
python2-dev \
python3-dev \
liblua5.4-dev \
lua5.4 \
liblua${LUA_VER}-dev \
lua${LUA_VER} \
ruby-dev \
tcl-dev \
cscope \
libsodium-dev \
attr \
libattr1-dev
)
fi
sudo apt-get update && sudo apt-get install -y "${PKGS[@]}"
@@ -98,7 +119,7 @@ jobs:
- name: Install gcc-${{ env.GCC_VER }}
if: matrix.compiler == 'gcc'
run: |
sudo apt-get install -y gcc-${{ env.GCC_VER }}
sudo apt-get install -y gcc-${{ env.GCC_VER }}:${{ matrix.architecture }}
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ env.GCC_VER }} 100
sudo update-alternatives --set gcc /usr/bin/gcc-${{ env.GCC_VER }}
@@ -135,16 +156,20 @@ jobs:
;;
huge)
echo "TEST=scripttests test_libvterm"
echo "CONFOPT=--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
INTERFACE=${{ matrix.interface || 'yes' }}
if ${{ matrix.python3 == 'stable-abi' }}; then
PYTHON3_CONFOPT="--with-python3-stable-abi=3.8"
fi
echo "CONFOPT=--enable-perlinterp=${INTERFACE} --enable-pythoninterp=${INTERFACE} --enable-python3interp=${INTERFACE} --enable-rubyinterp=${INTERFACE} --enable-luainterp=${INTERFACE} --enable-tclinterp=${INTERFACE} ${PYTHON3_CONFOPT}"
;;
esac
if ${{ matrix.coverage == true }}; then
CFLAGS="$CFLAGS --coverage -DUSE_GCOV_FLUSH"
CFLAGS="${CFLAGS} --coverage -DUSE_GCOV_FLUSH"
echo "LDFLAGS=--coverage"
fi
if ${{ matrix.uchar == true }}; then
CFLAGS="$CFLAGS -funsigned-char"
if ${{ contains(matrix.extra, 'uchar') }}; then
CFLAGS="${CFLAGS} -funsigned-char"
fi
if ${{ contains(matrix.extra, 'testgui') }}; then
echo "TEST=-C src testgui"
@@ -161,7 +186,7 @@ jobs:
if ${{ contains(matrix.extra, 'vimtags') }}; then
echo "TEST=-C runtime/doc vimtags VIMEXE=../../${SRCDIR}/vim"
fi
echo "CFLAGS=$CFLAGS"
echo "CFLAGS=${CFLAGS}"
) >> $GITHUB_ENV
- name: Set up system
@@ -178,17 +203,16 @@ jobs:
if: (!(contains(matrix.extra, 'unittests') || contains(matrix.extra, 'vimtags')))
env:
DEST_DIR: ${{ env.TMPDIR }}/linux-modules-extra-${{ env.LINUX_VERSION }}
uses: tecolicom/actions-use-apt-tools@main
with:
tools: linux-modules-extra-${{ env.LINUX_VERSION }}
path: "${DEST_DIR}"
- name: modprobe snd-dummy
if: (!(contains(matrix.extra, 'unittests') || contains(matrix.extra, 'vimtags')))
run: |
cd /lib/modules/${{ env.LINUX_VERSION }}
if apt-cache show linux-modules-extra-${{ env.LINUX_VERSION }} >/dev/null 2>&1 ; then
sudo apt-get install -d -y linux-modules-extra-${{ env.LINUX_VERSION }}
sudo dpkg -x /var/cache/apt/archives/linux-modules-extra-${{ env.LINUX_VERSION }}*.deb "${DEST_DIR}"
tar -cvC "${DEST_DIR}"/lib/modules/${{ env.LINUX_VERSION }} kernel/sound | sudo tar -x
sudo depmod --verbose
sudo modprobe --verbose snd-dummy
else
echo "Module " linux-modules-extra-${{ env.LINUX_VERSION }} "doesn't seem to exist, continue anyway"; exit 0
fi
sudo modprobe --verbose snd-dummy || true
- name: Check autoconf
if: contains(matrix.extra, 'unittests')
@@ -226,11 +250,17 @@ jobs:
"${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
- name: Test
timeout-minutes: 20
timeout-minutes: 25
run: |
do_test() { sg audio "sg $(id -gn) '$*'"; }
do_test make ${SHADOWOPT} ${TEST}
- name: Vim tags
if: contains(matrix.extra, 'vimtags')
run: |
# This will exit with an error code if the generated vim tags differs from source.
git diff --exit-code -- runtime/doc/tags
- name: Generate gcov files
if: matrix.coverage
run: |
@@ -238,6 +268,7 @@ jobs:
find . -type f -name '*.gcno' -exec gcov -pb {} + || true
- name: Codecov
timeout-minutes: 20
if: matrix.coverage
uses: codecov/codecov-action@v3
with:
@@ -268,14 +299,13 @@ jobs:
steps:
- name: Checkout repository from github
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install packages
if: matrix.features == 'huge'
run: |
brew install lua
echo "LUA_PREFIX=/usr/local" >> $GITHUB_ENV
brew uninstall perl
- name: Set up environment
run: |
@@ -364,8 +394,8 @@ jobs:
fail-fast: false
matrix:
include:
- { features: HUGE, toolchain: msvc, VIMDLL: no, GUI: no, arch: x64 }
- { features: HUGE, toolchain: mingw, VIMDLL: yes, GUI: yes, arch: x86, coverage: yes }
- { features: HUGE, toolchain: msvc, VIMDLL: no, GUI: no, arch: x64, python3: stable }
- { features: HUGE, toolchain: mingw, VIMDLL: yes, GUI: yes, arch: x86, python3: stable, coverage: yes }
- { features: HUGE, toolchain: msvc, VIMDLL: no, GUI: yes, arch: x86 }
- { features: HUGE, toolchain: mingw, VIMDLL: yes, GUI: no, arch: x64, coverage: yes }
- { features: NORMAL, toolchain: msvc, VIMDLL: yes, GUI: no, arch: x86 }
@@ -430,7 +460,7 @@ jobs:
release: false
- name: Checkout repository from github
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Create a list of download URLs
shell: cmd
@@ -496,6 +526,11 @@ jobs:
) else (
set GUI=${{ matrix.GUI }}
)
if "${{ matrix.python3 }}"=="stable" (
set PYTHON3_STABLE=yes
) else (
set PYTHON3_STABLE=no
)
if "${{ matrix.features }}"=="HUGE" (
nmake -nologo -f Make_mvc.mak ^
FEATURES=${{ matrix.features }} ^
@@ -503,6 +538,7 @@ jobs:
DYNAMIC_LUA=yes LUA=%LUA_DIR% ^
DYNAMIC_PYTHON=yes PYTHON=%PYTHON_DIR% ^
DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR% ^
DYNAMIC_PYTHON3_STABLE_ABI=%PYTHON3_STABLE% ^
DYNAMIC_SODIUM=yes SODIUM=%SODIUM_DIR%
) else (
nmake -nologo -f Make_mvc.mak ^
@@ -520,6 +556,11 @@ jobs:
else
GUI=${{ matrix.GUI }}
fi
if [ "${{ matrix.python3 }}" = "stable" ]; then
PYTHON3_STABLE=yes
else
PYTHON3_STABLE=no
fi
if [ "${{ matrix.features }}" = "HUGE" ]; then
mingw32-make -f Make_ming.mak -j2 \
FEATURES=${{ matrix.features }} \
@@ -527,6 +568,7 @@ jobs:
DYNAMIC_LUA=yes LUA=${LUA_DIR_SLASH} \
DYNAMIC_PYTHON=yes PYTHON=${PYTHON_DIR} \
DYNAMIC_PYTHON3=yes PYTHON3=${PYTHON3_DIR} \
DYNAMIC_PYTHON3_STABLE_ABI=${PYTHON3_STABLE} \
DYNAMIC_SODIUM=yes SODIUM=${SODIUM_DIR} \
STATIC_STDCPLUS=yes COVERAGE=${{ matrix.coverage }}
else
@@ -610,6 +652,7 @@ jobs:
find . -type f -name '*.gcno' -exec gcov -pb {} + || true
- name: Codecov
timeout-minutes: 20
if: matrix.coverage
uses: codecov/codecov-action@v3
with:

View File

@@ -44,7 +44,7 @@ jobs:
steps:
- name: Checkout repository from github
uses: actions/checkout@v3
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL

View File

@@ -13,14 +13,13 @@ jobs:
env:
CC: gcc
CFLAGS: -Wno-deprecated-declarations
DEBIAN_FRONTEND: noninteractive
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
steps:
- name: Checkout repository from github
if: env.TOKEN
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Download Coverity
if: env.TOKEN

24
.github/workflows/label.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration. For more information, see:
# https://github.com/actions/labeler
name: Labeler
on: [pull_request_target]
jobs:
label:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler.yml
sync-labels: ''

View File

@@ -217,6 +217,7 @@ SRC_ALL = \
src/testdir/color_ramp.vim \
src/testdir/silent.wav \
src/testdir/popupbounce.vim \
src/testdir/crash/* \
src/proto.h \
src/protodef.h \
src/proto/alloc.pro \
@@ -805,6 +806,11 @@ RT_SCRIPTS = \
runtime/syntax/README.txt \
runtime/syntax/shared/*.vim \
runtime/syntax/shared/README.txt \
runtime/syntax/Makefile \
runtime/syntax/testdir/README.txt \
runtime/syntax/testdir/runtest.vim \
runtime/syntax/testdir/input/*.* \
runtime/syntax/testdir/dumps/*.dump \
# Unix runtime
RT_UNIX = \

View File

@@ -21,8 +21,8 @@ II) It is allowed to distribute a modified (or extended) version of Vim,
maintainer will do with your changes and under what license they
will be distributed is negotiable. If there has been no negotiation
then this license, or a later version, also applies to your changes.
The current maintainer is Bram Moolenaar <Bram@vim.org>. If this
changes it will be announced in appropriate places (most likely
The current maintainers are listed here: https://github.com/orgs/vim/people.
If this changes it will be announced in appropriate places (most likely
vim.sf.net, www.vim.org and/or comp.editors). When it is completely
impossible to contact the maintainer, the obligation to send him
your changes ceases. Once the maintainer has confirmed that he has

View File

@@ -39,14 +39,15 @@ all install uninstall tools config configure reconfig proto depend lint tags typ
@echo "Starting make in the src directory."
@echo "If there are problems, cd to the src directory and run make there"
cd src && $(MAKE) $@
@# When the target is "test" also run the indent tests.
@if test "$@" = "test"; then \
@# When the target is "test" also run the indent and syntax tests.
@if test "$@" = "test" -o "$@" = "testtiny"; then \
$(MAKE) indenttest; \
$(MAKE) syntaxtest; \
fi
@# When the target is "clean" also clean for the indent tests.
@# When the target is "clean" also clean for the indent and syntax tests.
@if test "$@" = "clean" -o "$@" = "distclean" -o "$@" = "testclean"; then \
cd runtime/indent && \
$(MAKE) clean; \
(cd runtime/indent && $(MAKE) clean); \
(cd runtime/syntax && $(MAKE) clean); \
fi
# Executable used for running the indent tests.
@@ -57,6 +58,14 @@ indenttest:
$(MAKE) clean && \
$(MAKE) test VIM="$(VIM_FOR_INDENTTEST)"
# Executable used for running the syntax tests.
VIM_FOR_SYNTAXTEST = ../../src/vim
syntaxtest:
cd runtime/syntax && \
$(MAKE) clean && \
$(MAKE) test VIMPROG="$(VIM_FOR_SYNTAXTEST)"
#########################################################################
# 2. Creating the various distribution files.

View File

@@ -1,17 +1,21 @@
[![Vim Logo](https://github.com/vim/vim/raw/master/runtime/vimlogo.gif)](https://www.vim.org)
# [![Vim The editor](https://github.com/vim/vim/raw/master/runtime/vimlogo.gif)](https://www.vim.org)
[![Github Build status](https://github.com/vim/vim/workflows/GitHub%20CI/badge.svg)](https://github.com/vim/vim/actions?query=workflow%3A%22GitHub+CI%22) [![Appveyor Build status](https://ci.appveyor.com/api/projects/status/o2qht2kjm02sgghk?svg=true)](https://ci.appveyor.com/project/chrisbra/vim) [![Cirrus Build Status](https://api.cirrus-ci.com/github/vim/vim.svg)](https://cirrus-ci.com/github/vim/vim) [![Coverage Status](https://codecov.io/gh/vim/vim/coverage.svg?branch=master)](https://codecov.io/gh/vim/vim?branch=master) [![Coverity Scan](https://scan.coverity.com/projects/241/badge.svg)](https://scan.coverity.com/projects/vim) [![Debian CI](https://badges.debian.net/badges/debian/testing/vim/version.svg)](https://buildd.debian.org/vim) [![Packages](https://repology.org/badge/tiny-repos/vim.svg)](https://repology.org/metapackage/vim) [![Fossies codespell report](https://fossies.org/linux/test/vim-master.tar.gz/codespell.svg)](https://fossies.org/linux/test/vim-master.tar.gz/codespell.html)
<sub>For translations of this README see the end.</sub>
[![Github Build status](https://github.com/vim/vim/workflows/GitHub%20CI/badge.svg)](https://github.com/vim/vim/actions?query=workflow%3A%22GitHub+CI%22)
[![Appveyor Build status](https://ci.appveyor.com/api/projects/status/o2qht2kjm02sgghk?svg=true)](https://ci.appveyor.com/project/chrisbra/vim)
[![Cirrus Build Status](https://api.cirrus-ci.com/github/vim/vim.svg)](https://cirrus-ci.com/github/vim/vim)
[![Coverage Status](https://codecov.io/gh/vim/vim/coverage.svg?branch=master)](https://codecov.io/gh/vim/vim?branch=master)
[![Coverity Scan](https://scan.coverity.com/projects/241/badge.svg)](https://scan.coverity.com/projects/vim)
[![Debian CI](https://badges.debian.net/badges/debian/testing/vim/version.svg)](https://buildd.debian.org/vim)
[![Packages](https://repology.org/badge/tiny-repos/vim.svg)](https://repology.org/metapackage/vim)
[![Fossies codespell report](https://fossies.org/linux/test/vim-master.tar.gz/codespell.svg)](https://fossies.org/linux/test/vim-master.tar.gz/codespell.html)
If you find a bug or want to discuss the best way to add a new feature, please
open an [issue](https://github.com/vim/vim/issues).
[open an issue](https://github.com/vim/vim/issues/new/choose).
If you have a question or want to discuss the best way to do something with
Vim, you can use [StackExchange](https://vi.stackexchange.com/)
or one of the [Maillists](https://www.vim.org/community.php).
## What is Vim? ##
## What is Vim?
Vim is a greatly improved version of the good old UNIX editor
[Vi](https://en.wikipedia.org/wiki/Vi). Many new
@@ -35,7 +39,7 @@ Amiga DOS, Atari MiNT, BeOS, RISC OS and OS/2. These are no longer maintained.
For Vim9 script see [README_VIM9](README_VIM9.md).
## Distribution ##
## Distribution
You can often use your favorite package manager to install Vim. On Mac and
Linux a small version of Vim is pre-installed, you still need to install Vim
@@ -55,48 +59,45 @@ Some popular places to get the latest Vim:
* Get a Windows executable from the
[vim-win32-installer](https://github.com/vim/vim-win32-installer/releases) repository.
## Compiling ##
## Compiling
If you obtained a binary distribution you don't need to compile Vim. If you
obtained a source distribution, all the stuff for compiling Vim is in the
[`src`](/src) directory. See [`src/INSTALL`](src/INSTALL) for instructions.
[`src`](./src/) directory. See [`src/INSTALL`](./src/INSTALL) for instructions.
## Installation ##
## Installation
See one of these files for system-specific instructions. Either in the
[READMEdir directory](./READMEdir/) (in the repository) or
the top directory (if you unpack an archive):
README_ami.txt Amiga
README_unix.txt Unix
README_dos.txt MS-DOS and MS-Windows
README_mac.txt Macintosh
README_haiku.txt Haiku
README_vms.txt VMS
```
README_ami.txt Amiga
README_unix.txt Unix
README_dos.txt MS-DOS and MS-Windows
README_mac.txt Macintosh
README_haiku.txt Haiku
README_vms.txt VMS
```
There are other `README_*.txt` files, depending on the distribution you used.
## Documentation ##
## Documentation
The Vim tutor is a one hour training course for beginners. Often it can be
started as `vimtutor`. See `:help tutor` for more information.
The best is to use `:help` in Vim. If you don't have an executable yet, read
[`runtime/doc/help.txt`](/runtime/doc/help.txt).
[`runtime/doc/help.txt`](./runtime/doc/help.txt).
It contains pointers to the other documentation files.
The User Manual reads like a book and is recommended to learn to use
Vim. See `:help user-manual`.
## Copying ##
## Copying
Vim is Charityware. You can use and copy it as much as you like, but you are
encouraged to make a donation to help orphans in Uganda. Please read the file
[`runtime/doc/uganda.txt`](runtime/doc/uganda.txt)
[`runtime/doc/uganda.txt`](./runtime/doc/uganda.txt)
for details (do `:help uganda` inside Vim).
Summary of the license: There are no restrictions on using or distributing an
@@ -105,28 +106,25 @@ text must always be included. For modified versions, a few restrictions apply.
The license is GPL compatible, you may compile Vim with GPL libraries and
distribute it.
## Sponsoring ##
## Sponsoring
Fixing bugs and adding new features takes a lot of time and effort. To show
your appreciation for the work and motivate Bram and others to continue
working on Vim please send a donation.
Since Bram is back to a paid job the money will now be used to help children
in Uganda. See [`runtime/doc/uganda.txt`](runtime/doc/uganda.txt). But
in Uganda. See [`runtime/doc/uganda.txt`](./runtime/doc/uganda.txt). But
at the same time donations increase Bram's motivation to keep working on Vim!
For the most recent information about sponsoring look on the Vim web site:
https://www.vim.org/sponsor/
## Contributing ##
## Contributing
If you would like to help make Vim better, see the
[CONTRIBUTING.md](/CONTRIBUTING.md) file.
[CONTRIBUTING.md](./CONTRIBUTING.md) file.
## Information ##
## Information
If you are on macOS, you can use [Macvim](https://macvim-dev.github.io/macvim/).
@@ -141,14 +139,15 @@ If you still have problems or any other questions, use one of the mailing
lists to discuss them with Vim users and developers:
https://www.vim.org/maillist.php
If nothing else works, report bugs directly:
Bram Moolenaar <Bram@vim.org>
If nothing else works, report bugs directly to the vim-dev mailing list:
`<vim-dev@vim.org>`
## Main author
## Main author ##
Send any other comments, patches, flowers and suggestions to:
Bram Moolenaar <Bram@vim.org>
Most of Vim was created by Bram Moolenaar `<Bram@vim.org>`
[Bram-Moolenaar](https://vimhelp.org/version9.txt.html#Bram-Moolenaar)
Send any other comments, patches, flowers and suggestions to the vim-dev mailing list:
`<vim-dev@vim.org>`
This is `README.md` for version 9.0 of Vim: Vi IMproved.

View File

@@ -122,12 +122,14 @@ If you still have problems or any other questions, use one of the mailing
lists to discuss them with Vim users and developers:
https://www.vim.org/maillist.php
If nothing else works, report bugs directly:
Bram Moolenaar <Bram@vim.org>
If nothing else works, report bugs directly to the vim-dev mailing list:
<vim-dev@vim.org>
MAIN AUTHOR
Send any other comments, patches, flowers and suggestions to:
Most of Vim was created by Bram Moolenaar <Bram@vim.org> |Bram-Moolenaar|
Bram Moolenaar E-mail: Bram@vim.org
Send any other comments, patches, flowers and suggestions to the vim-dev mailing list:
<vim-dev@vim.org>

View File

@@ -46,7 +46,7 @@ Change to the vim directory and do:
$ export CC=cc
$ export _CC_CCMODE=1
$./configure --with-features=big --without-x --enable-gui=no
$./configure --with-features=normal --without-x --enable-gui=no
$ cd src
$ make

8
SECURITY.md Normal file
View File

@@ -0,0 +1,8 @@
# Security Policy
## Reporting a vulnerability
If you want to report a security issue, please use [huntr.dev](https://huntr.dev/bounties/disclose?target=https%3A%2F%2Fgithub.com%2Fvim%2Fvim) to privately disclose the issue to us.
They also have rewards in the form of money, swag and CVEs.
**Please don't publicly disclose the issue until it has been addressed by us.**

View File

@@ -1,3 +1,3 @@
# Clang 12 (or Apple clang 13) and later makes a warning '-Wcompound-token-split-by-macro' enable by default.
/^PERL_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=compound-token-split-by-macro/
/^PERL_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=compound-token-split-by-macro -Wno-compound-token-split-by-macro/
/^RUBY_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=compound-token-split-by-macro/

View File

@@ -1,3 +1,3 @@
/^CFLAGS[[:blank:]]*=/s/$/ -Wall -Wextra -Wshadow -Werror/
/^PERL_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=unused-function/
/^RUBY_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=unused-parameter/
/^CFLAGS[[:blank:]]*=/s/$/ -Wall -Wextra -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Werror -Wno-deprecated-declarations/
/^PERL_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=unused-function -Wno-shadow/
/^RUBY_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=unused-parameter -Wno-strict-prototypes/

149
runtime/autoload/cargo.vim Normal file
View File

@@ -0,0 +1,149 @@
" Last Modified: 2023-09-11
function! cargo#Load()
" Utility call to get this script loaded, for debugging
endfunction
function! cargo#cmd(args) abort
" Trim trailing spaces. This is necessary since :terminal command parses
" trailing spaces as an empty argument.
let args = substitute(a:args, '\s\+$', '', '')
if exists('g:cargo_shell_command_runner')
let cmd = g:cargo_shell_command_runner
elseif has('terminal')
let cmd = 'terminal'
elseif has('nvim')
let cmd = 'noautocmd new | terminal'
else
let cmd = '!'
endif
execute cmd 'cargo' args
endfunction
function! s:nearest_cargo(...) abort
" If the second argument is not specified, the first argument determines
" whether we will start from the current directory or the directory of the
" current buffer, otherwise, we start with the provided path on the
" second argument.
let l:is_getcwd = get(a:, 1, 0)
if l:is_getcwd
let l:starting_path = get(a:, 2, getcwd())
else
let l:starting_path = get(a:, 2, expand('%:p:h'))
endif
return findfile('Cargo.toml', l:starting_path . ';')
endfunction
function! cargo#nearestCargo(is_getcwd) abort
return s:nearest_cargo(a:is_getcwd)
endfunction
function! cargo#nearestWorkspaceCargo(is_getcwd) abort
let l:nearest = s:nearest_cargo(a:is_getcwd)
while l:nearest !=# ''
for l:line in readfile(l:nearest, '', 0x100)
if l:line =~# '\V[workspace]'
return l:nearest
endif
endfor
let l:next = fnamemodify(l:nearest, ':p:h:h')
let l:nearest = s:nearest_cargo(0, l:next)
endwhile
return ''
endfunction
function! cargo#nearestRootCargo(is_getcwd) abort
" Try to find a workspace Cargo.toml, and if not found, take the nearest
" regular Cargo.toml
let l:workspace_cargo = cargo#nearestWorkspaceCargo(a:is_getcwd)
if l:workspace_cargo !=# ''
return l:workspace_cargo
endif
return s:nearest_cargo(a:is_getcwd)
endfunction
function! cargo#build(args)
call cargo#cmd("build " . a:args)
endfunction
function! cargo#check(args)
call cargo#cmd("check " . a:args)
endfunction
function! cargo#clean(args)
call cargo#cmd("clean " . a:args)
endfunction
function! cargo#doc(args)
call cargo#cmd("doc " . a:args)
endfunction
function! cargo#new(args)
call cargo#cmd("new " . a:args)
cd `=a:args`
endfunction
function! cargo#init(args)
call cargo#cmd("init " . a:args)
endfunction
function! cargo#run(args)
call cargo#cmd("run " . a:args)
endfunction
function! cargo#test(args)
call cargo#cmd("test " . a:args)
endfunction
function! cargo#bench(args)
call cargo#cmd("bench " . a:args)
endfunction
function! cargo#update(args)
call cargo#cmd("update " . a:args)
endfunction
function! cargo#search(args)
call cargo#cmd("search " . a:args)
endfunction
function! cargo#publish(args)
call cargo#cmd("publish " . a:args)
endfunction
function! cargo#install(args)
call cargo#cmd("install " . a:args)
endfunction
function! cargo#runtarget(args)
let l:filename = expand('%:p')
let l:read_manifest = system('cargo read-manifest')
let l:metadata = json_decode(l:read_manifest)
let l:targets = get(l:metadata, 'targets', [])
let l:did_run = 0
for l:target in l:targets
let l:src_path = get(l:target, 'src_path', '')
let l:kinds = get(l:target, 'kind', [])
let l:name = get(l:target, 'name', '')
if l:src_path == l:filename
if index(l:kinds, 'example') != -1
let l:did_run = 1
call cargo#run("--example " . shellescape(l:name) . " " . a:args)
return
elseif index(l:kinds, 'bin') != -1
let l:did_run = 1
call cargo#run("--bin " . shellescape(l:name) . " " . a:args)
return
endif
endif
endfor
if l:did_run != 1
call cargo#run(a:args)
return
endif
endfunction
" vim: set et sw=4 sts=4 ts=8:

View File

@@ -0,0 +1,29 @@
" Last Modified: 2023-09-11
function! cargo#quickfix#CmdPre() abort
if &filetype ==# 'rust' && get(b:, 'current_compiler', '') ==# 'cargo' &&
\ &makeprg =~ '\V\^cargo\ \.\*'
" Preserve the current directory, and 'lcd' to the nearest Cargo file.
let b:rust_compiler_cargo_qf_has_lcd = haslocaldir()
let b:rust_compiler_cargo_qf_prev_cd = getcwd()
let b:rust_compiler_cargo_qf_prev_cd_saved = 1
let l:nearest = fnamemodify(cargo#nearestRootCargo(0), ':h')
execute 'lchdir! '.l:nearest
else
let b:rust_compiler_cargo_qf_prev_cd_saved = 0
endif
endfunction
function! cargo#quickfix#CmdPost() abort
if exists("b:rust_compiler_cargo_qf_prev_cd_saved") && b:rust_compiler_cargo_qf_prev_cd_saved
" Restore the current directory.
if b:rust_compiler_cargo_qf_has_lcd
execute 'lchdir! '.b:rust_compiler_cargo_qf_prev_cd
else
execute 'chdir! '.b:rust_compiler_cargo_qf_prev_cd
endif
let b:rust_compiler_cargo_qf_prev_cd_saved = 0
endif
endfunction
" vim: set et sw=4 sts=4 ts=8:

View File

@@ -1,10 +1,11 @@
vim9script noclear
# Vim completion script
# Language: C
# Maintainer: Bram Moolenaar <Bram@vim.org>
# Language: C
# Maintainer: The Vim Project <https://github.com/vim/vim>
# Last Change: 2023 Aug 10
# Rewritten in Vim9 script by github user lacygoill
# Last Change: 2022 Jan 31
# Former Maintainer: Bram Moolenaar <Bram@vim.org>
var prepended: string
var grepCache: dict<list<dict<any>>>

View File

@@ -2,8 +2,9 @@ vim9script
# Vim functions for file type detection
#
# Maintainer: Bram Moolenaar <Bram@vim.org>
# Last Change: 2023 Apr 22
# Maintainer: The Vim Project <https://github.com/vim/vim>
# Last Change: 2023 Aug 10
# Former Maintainer: Bram Moolenaar <Bram@vim.org>
# These functions are moved here from runtime/filetype.vim to make startup
# faster.
@@ -61,7 +62,7 @@ export def FTasmsyntax()
endif
enddef
var ft_visual_basic_content = '\cVB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)'
var ft_visual_basic_content = '\c^\s*\%(Attribute\s\+VB_Name\|Begin\s\+\%(VB\.\|{\%(\x\+-\)\+\x\+}\)\)'
# See FTfrm() for Visual Basic form file detection
export def FTbas()
@@ -145,12 +146,20 @@ export def FTcls()
return
endif
if getline(1) =~ '^\v%(\%|\\)'
setf tex
elseif getline(1)[0] == '#' && getline(1) =~ 'rexx'
var line1 = getline(1)
if line1 =~ '^#!.*\<\%(rexx\|regina\)\>'
setf rexx
elseif getline(1) == 'VERSION 1.0 CLASS'
return
elseif line1 == 'VERSION 1.0 CLASS'
setf vb
return
endif
var nonblank1 = getline(nextnonblank(1))
if nonblank1 =~ '^\v%(\%|\\)'
setf tex
elseif nonblank1 =~ '^\s*\%(/\*\|::\w\)'
setf rexx
else
setf st
endif
@@ -286,12 +295,48 @@ export def FTe()
endif
enddef
def IsForth(): bool
var first_line = nextnonblank(1)
# SwiftForth block comment (line is usually filled with '-' or '=') or
# OPTIONAL (sometimes precedes the header comment)
if getline(first_line) =~? '^\%({\%(\s\|$\)\|OPTIONAL\s\)'
return true
endif
var n = first_line
while n < 100 && n <= line("$")
# Forth comments and colon definitions
if getline(n) =~ '^[:(\\] '
return true
endif
n += 1
endwhile
return false
enddef
# Distinguish between Forth and Fortran
export def FTf()
if exists("g:filetype_f")
exe "setf " .. g:filetype_f
elseif IsForth()
setf forth
else
setf fortran
endif
enddef
export def FTfrm()
if exists("g:filetype_frm")
exe "setf " .. g:filetype_frm
return
endif
if getline(1) == "VERSION 5.00"
setf vb
return
endif
var lines = getline(1, min([line("$"), 5]))
if match(lines, ft_visual_basic_content) > -1
@@ -301,21 +346,13 @@ export def FTfrm()
endif
enddef
# Distinguish between Forth and F#.
# Provided by Doug Kearns.
# Distinguish between Forth and F#
export def FTfs()
if exists("g:filetype_fs")
exe "setf " .. g:filetype_fs
elseif IsForth()
setf forth
else
var n = 1
while n < 100 && n <= line("$")
# Forth comments and colon definitions
if getline(n) =~ "^[:(\\\\] "
setf forth
return
endif
n += 1
endwhile
setf fsharp
endif
enddef
@@ -362,8 +399,8 @@ export def ProtoCheck(default: string)
else
# recognize Prolog by specific text in the first non-empty line
# require a blank after the '%' because Perl uses "%list" and "%translate"
var l = getline(nextnonblank(1))
if l =~ '\<prolog\>' || l =~ '^\s*\(%\+\(\s\|$\)\|/\*\)' || l =~ ':-'
var lnum = getline(nextnonblank(1))
if lnum =~ '\<prolog\>' || lnum =~ '^\s*\(%\+\(\s\|$\)\|/\*\)' || lnum =~ ':-'
setf prolog
else
exe 'setf ' .. default
@@ -472,26 +509,26 @@ enddef
def IsLProlog(): bool
# skip apparent comments and blank lines, what looks like
# LambdaProlog comment may be RAPID header
var l: number = nextnonblank(1)
while l > 0 && l < line('$') && getline(l) =~ '^\s*%' # LambdaProlog comment
l = nextnonblank(l + 1)
var lnum: number = nextnonblank(1)
while lnum > 0 && lnum < line('$') && getline(lnum) =~ '^\s*%' # LambdaProlog comment
lnum = nextnonblank(lnum + 1)
endwhile
# this pattern must not catch a go.mod file
return getline(l) =~ '\<module\s\+\w\+\s*\.\s*\(%\|$\)'
return getline(lnum) =~ '\<module\s\+\w\+\s*\.\s*\(%\|$\)'
enddef
# Determine if *.mod is ABB RAPID, LambdaProlog, Modula-2, Modsim III or go.mod
export def FTmod()
if exists("g:filetype_mod")
exe "setf " .. g:filetype_mod
elseif expand("<afile>") =~ '\<go.mod$'
setf gomod
elseif IsLProlog()
setf lprolog
elseif getline(nextnonblank(1)) =~ '\%(\<MODULE\s\+\w\+\s*;\|^\s*(\*\)'
setf modula2
elseif IsRapid()
setf rapid
elseif expand("<afile>") =~ '\<go.mod$'
setf gomod
else
# Nothing recognized, assume modsim3
setf modsim3
@@ -504,8 +541,8 @@ export def FTpl()
else
# recognize Prolog by specific text in the first non-empty line
# require a blank after the '%' because Perl uses "%list" and "%translate"
var l = getline(nextnonblank(1))
if l =~ '\<prolog\>' || l =~ '^\s*\(%\+\(\s\|$\)\|/\*\)' || l =~ ':-'
var line = getline(nextnonblank(1))
if line =~ '\<prolog\>' || line =~ '^\s*\(%\+\(\s\|$\)\|/\*\)' || line =~ ':-'
setf prolog
else
setf perl
@@ -678,26 +715,24 @@ export def McSetf()
enddef
# Called from filetype.vim and scripts.vim.
export def SetFileTypeSH(name: string)
if did_filetype()
# When "setft" is passed and false then the 'filetype' option is not set.
export def SetFileTypeSH(name: string, setft = true): string
if setft && did_filetype()
# Filetype was already detected
return
return ''
endif
if expand("<amatch>") =~ g:ft_ignore_pat
return
if setft && expand("<amatch>") =~ g:ft_ignore_pat
return ''
endif
if name =~ '\<csh\>'
# Some .sh scripts contain #!/bin/csh.
SetFileTypeShell("csh")
return
return SetFileTypeShell("csh", setft)
elseif name =~ '\<tcsh\>'
# Some .sh scripts contain #!/bin/tcsh.
SetFileTypeShell("tcsh")
return
return SetFileTypeShell("tcsh", setft)
elseif name =~ '\<zsh\>'
# Some .sh scripts contain #!/bin/zsh.
SetFileTypeShell("zsh")
return
return SetFileTypeShell("zsh", setft)
elseif name =~ '\<ksh\>'
b:is_kornshell = 1
if exists("b:is_bash")
@@ -724,34 +759,43 @@ export def SetFileTypeSH(name: string)
unlet b:is_bash
endif
endif
SetFileTypeShell("sh")
return SetFileTypeShell("sh", setft)
enddef
# For shell-like file types, check for an "exec" command hidden in a comment,
# as used for Tcl.
# When "setft" is passed and false then the 'filetype' option is not set.
# Also called from scripts.vim, thus can't be local to this script.
export def SetFileTypeShell(name: string)
if did_filetype()
export def SetFileTypeShell(name: string, setft = true): string
if setft && did_filetype()
# Filetype was already detected
return
return ''
endif
if expand("<amatch>") =~ g:ft_ignore_pat
return
if setft && expand("<amatch>") =~ g:ft_ignore_pat
return ''
endif
var l = 2
while l < 20 && l < line("$") && getline(l) =~ '^\s*\(#\|$\)'
var lnum = 2
while lnum < 20 && lnum < line("$") && getline(lnum) =~ '^\s*\(#\|$\)'
# Skip empty and comment lines.
l += 1
lnum += 1
endwhile
if l < line("$") && getline(l) =~ '\s*exec\s' && getline(l - 1) =~ '^\s*#.*\\$'
if lnum < line("$") && getline(lnum) =~ '\s*exec\s' && getline(lnum - 1) =~ '^\s*#.*\\$'
# Found an "exec" line after a comment with continuation
var n = substitute(getline(l), '\s*exec\s\+\([^ ]*/\)\=', '', '')
var n = substitute(getline(lnum), '\s*exec\s\+\([^ ]*/\)\=', '', '')
if n =~ '\<tclsh\|\<wish'
setf tcl
return
if setft
setf tcl
endif
return 'tcl'
endif
endif
exe "setf " .. name
if setft
exe "setf " .. name
endif
return name
enddef
export def CSH()
@@ -1166,5 +1210,13 @@ export def FTv()
setf v
enddef
export def FTvba()
if getline(1) =~ '^["#] Vimball Archiver'
setf vim
else
setf vb
endif
enddef
# Uncomment this line to check for compilation errors early
# defcompile

View File

@@ -1,9 +1,9 @@
" Vim filetype plugin autoload file
" Language: man
" Maintainer: Jason Franklin <vim@justemail.net>
" Maintainer: Jason Franklin <jason@oneway.dev>
" Maintainer: SungHyun Nam <goweol@gmail.com>
" Autoload Split: Bram Moolenaar
" Last Change: 2022 Jun 18
" Last Change: 2023 Jun 28
let s:cpo_save = &cpo
set cpo-=C
@@ -21,31 +21,65 @@ catch /E145:/
" Ignore the error in restricted mode
endtry
func s:ParseIntoPageAndSection()
" Accommodate a reference that terminates in a hyphen.
"
" See init_charset_table() at
" https://git.savannah.gnu.org/cgit/groff.git/tree/src/roff/troff/input.cpp?h=1.22.4#n6794
"
" See can_break_after() at
" https://git.savannah.gnu.org/cgit/groff.git/tree/src/roff/troff/charinfo.h?h=1.22.4#n140
"
" Assumptions and limitations:
" 1) Manual-page references (in consequence of command-related filenames)
" do not contain non-ASCII HYPHENs (0x2010), any terminating HYPHEN
" must have been introduced to mark division of a word at the end of
" a line and can be discarded; whereas similar references may contain
" ASCII HYPHEN-MINUSes (0x002d) and any terminating HYPHEN-MINUS forms
" a compound word in addition to marking word division.
" 2) Well-formed manual-page references always have a section suffix, e.g.
" "git-commit(1)", therefore suspended hyphenated compounds are not
" determined, e.g. [V] (With cursor at _git-merge-_ below...)
" ".................... git-merge- and git-merge-base. (See git-cherry-
" pick(1) and git-cherry(1).)" (... look up "git-merge-pick(1)".)
"
" Note that EM DASH (0x2014), a third stooge from init_charset_table(),
" neither connects nor divides parts of a word.
let str = expand("<cWORD>")
if str =~ '\%u2010$' " HYPHEN (-1).
let str = strpart(str, 0, strridx(str, "\u2010"))
" Append the leftmost WORD (or an empty string) from the line below.
let str .= get(split(get(getbufline(bufnr('%'), line('.') + 1), 0, '')), 0, '')
elseif str =~ '-$' " HYPHEN-MINUS.
" Append the leftmost WORD (or an empty string) from the line below.
let str .= get(split(get(getbufline(bufnr('%'), line('.') + 1), 0, '')), 0, '')
endif
" According to man(1), section name formats vary (MANSECT):
" 1 n l 8 3 2 3posix 3pm 3perl 3am 5 4 9 6 7
let parts = matchlist(str, '\(\k\+\)(\(\k\+\))')
return (len(parts) > 2)
\ ? {'page': parts[1], 'section': parts[2]}
\ : {'page': matchstr(str, '\k\+'), 'section': ''}
endfunc
func dist#man#PreGetPage(cnt)
if a:cnt == 0
let old_isk = &iskeyword
if &ft == 'man'
setl iskeyword+=(,)
endif
let str = expand("<cword>")
let &l:iskeyword = old_isk
let page = substitute(str, '(*\(\k\+\).*', '\1', '')
let sect = substitute(str, '\(\k\+\)(\([^()]*\)).*', '\2', '')
if match(sect, '^[0-9 ]\+$') == -1
let sect = ""
endif
if sect == page
let sect = ""
endif
let what = s:ParseIntoPageAndSection()
let sect = what.section
let page = what.page
else
let what = s:ParseIntoPageAndSection()
let sect = a:cnt
let page = expand("<cword>")
let page = what.page
endif
call dist#man#GetPage('', sect, page)
endfunc
func s:GetCmdArg(sect, page)
if empty(a:sect)
return shellescape(a:page)
endif
@@ -75,9 +109,11 @@ func dist#man#GetPage(cmdmods, ...)
return
endif
" To support: nmap K :Man <cword>
if page == '<cword>'
let page = expand('<cword>')
" To support: nmap K :Man <cWORD><CR>
if page ==? '<cword>'
let what = s:ParseIntoPageAndSection()
let sect = what.section
let page = what.page
endif
if !exists('g:ft_man_no_sect_fallback') || (g:ft_man_no_sect_fallback == 0)
@@ -154,9 +190,14 @@ func dist#man#GetPage(cmdmods, ...)
endif
let env_cmd = s:env_has_u ? 'env -u MANPAGER' : 'env MANPAGER=cat'
let env_cmd .= ' GROFF_NO_SGR=1'
let man_cmd = env_cmd . ' man ' . s:GetCmdArg(sect, page) . ' | col -b'
let man_cmd = env_cmd . ' man ' . s:GetCmdArg(sect, page)
silent exec "r !" . man_cmd
" Emulate piping the buffer through the "col -b" command.
" Ref: https://github.com/vim/vim/issues/12301
exe 'silent! keepjumps keeppatterns %s/\v(.)\b\ze\1?//e' .. (&gdefault ? '' : 'g')
if unsetwidth
let $MANWIDTH = ''
endif
@@ -180,9 +221,10 @@ func dist#man#PopPage()
exec "let s:man_tag_buf=s:man_tag_buf_".s:man_tag_depth
exec "let s:man_tag_lin=s:man_tag_lin_".s:man_tag_depth
exec "let s:man_tag_col=s:man_tag_col_".s:man_tag_depth
exec s:man_tag_buf."b"
exec s:man_tag_lin
exec "norm! ".s:man_tag_col."|"
call cursor(s:man_tag_lin, s:man_tag_col)
exec "unlet s:man_tag_buf_".s:man_tag_depth
exec "unlet s:man_tag_lin_".s:man_tag_depth
exec "unlet s:man_tag_col_".s:man_tag_depth

View File

@@ -3,8 +3,9 @@ vim9script
# Vim function for detecting a filetype from the file contents.
# Invoked from "scripts.vim" in 'runtimepath'
#
# Maintainer: Bram Moolenaar <Bram@vim.org>
# Last Change: 2023 May 06
# Maintainer: The Vim Project <https://github.com/vim/vim>
# Last Change: 2023 Aug 10
# Former Maintainer: Bram Moolenaar <Bram@vim.org>
export def DetectFiletype()
var line1 = getline(1)
@@ -44,7 +45,7 @@ def DetectFromHashBang(firstline: string)
elseif line1 =~ '^#!\s*[^/\\ ]*\>\([^/\\]\|$\)'
name = substitute(line1, '^#!\s*\([^/\\ ]*\>\).*', '\1', '')
else
name = substitute(line1, '^#!\s*\S*[/\\]\(\i\+\).*', '\1', '')
name = substitute(line1, '^#!\s*\S*[/\\]\(\f\+\).*', '\1', '')
endif
# tcl scripts may have #!/bin/sh in the first line and "exec wish" in the
@@ -53,151 +54,172 @@ def DetectFromHashBang(firstline: string)
name = 'wish'
endif
var ft = Exe2filetype(name, line1)
if ft != ''
exe 'setl ft=' .. ft
endif
enddef
# Returns the filetype name associated with program "name".
# "line1" is the #! line at the top of the file. Use the same as "name" if
# not available.
# Returns an empty string when not recognized.
export def Exe2filetype(name: string, line1: string): string
# Bourne-like shell scripts: bash bash2 dash ksh ksh93 sh
if name =~ '^\(bash\d*\|dash\|ksh\d*\|sh\)\>'
call dist#ft#SetFileTypeSH(line1)
return dist#ft#SetFileTypeSH(line1, false)
# csh scripts
elseif name =~ '^csh\>'
if exists("g:filetype_csh")
call dist#ft#SetFileTypeShell(g:filetype_csh)
else
call dist#ft#SetFileTypeShell("csh")
endif
return dist#ft#SetFileTypeShell(exists("g:filetype_csh") ? g:filetype_csh : 'csh', false)
# tcsh scripts
elseif name =~ '^tcsh\>'
call dist#ft#SetFileTypeShell("tcsh")
return dist#ft#SetFileTypeShell("tcsh", false)
# Z shell scripts
elseif name =~ '^zsh\>'
setl ft=zsh
return 'zsh'
# TCL scripts
elseif name =~ '^\(tclsh\|wish\|expectk\|itclsh\|itkwish\)\>'
setl ft=tcl
return 'tcl'
# Expect scripts
elseif name =~ '^expect\>'
setl ft=expect
return 'expect'
# Gnuplot scripts
elseif name =~ '^gnuplot\>'
setl ft=gnuplot
return 'gnuplot'
# Makefiles
elseif name =~ 'make\>'
setl ft=make
return 'make'
# Pike
elseif name =~ '^pike\%(\>\|[0-9]\)'
setl ft=pike
return 'pike'
# Lua
elseif name =~ 'lua'
setl ft=lua
return 'lua'
# Perl
elseif name =~ 'perl'
setl ft=perl
return 'perl'
# PHP
elseif name =~ 'php'
setl ft=php
return 'php'
# Python
elseif name =~ 'python'
setl ft=python
return 'python'
# Groovy
elseif name =~ '^groovy\>'
setl ft=groovy
return 'groovy'
# Raku
elseif name =~ 'raku'
setl ft=raku
return 'raku'
# Ruby
elseif name =~ 'ruby'
setl ft=ruby
return 'ruby'
# JavaScript
elseif name =~ 'node\(js\)\=\>\|js\>' || name =~ 'rhino\>'
setl ft=javascript
return 'javascript'
# BC calculator
elseif name =~ '^bc\>'
setl ft=bc
return 'bc'
# sed
elseif name =~ 'sed\>'
setl ft=sed
return 'sed'
# OCaml-scripts
elseif name =~ 'ocaml'
setl ft=ocaml
return 'ocaml'
# Awk scripts; also finds "gawk"
elseif name =~ 'awk\>'
setl ft=awk
return 'awk'
# Website MetaLanguage
elseif name =~ 'wml'
setl ft=wml
return 'wml'
# Scheme scripts
elseif name =~ 'scheme'
setl ft=scheme
return 'scheme'
# CFEngine scripts
elseif name =~ 'cfengine'
setl ft=cfengine
return 'cfengine'
# Erlang scripts
elseif name =~ 'escript'
setl ft=erlang
return 'erlang'
# Haskell
elseif name =~ 'haskell'
setl ft=haskell
return 'haskell'
# Scala
elseif name =~ 'scala\>'
setl ft=scala
return 'scala'
# Clojure
elseif name =~ 'clojure'
setl ft=clojure
return 'clojure'
# Free Pascal
elseif name =~ 'instantfpc\>'
setl ft=pascal
return 'pascal'
# Fennel
elseif name =~ 'fennel\>'
setl ft=fennel
return 'fennel'
# MikroTik RouterOS script
elseif name =~ 'rsc\>'
setl ft=routeros
return 'routeros'
# Fish shell
elseif name =~ 'fish\>'
setl ft=fish
return 'fish'
# Gforth
elseif name =~ 'gforth\>'
setl ft=forth
return 'forth'
# Icon
elseif name =~ 'icon\>'
setl ft=icon
return 'icon'
# Guile
elseif name =~ 'guile'
setl ft=scheme
return 'scheme'
# Nix
elseif name =~ 'nix-shell'
return 'nix'
# Crystal
elseif name =~ '^crystal\>'
return 'crystal'
# Rexx
elseif name =~ '^\%(rexx\|regina\)\>'
return 'rexx'
endif
return ''
enddef

View File

@@ -2,7 +2,7 @@ vim9script
# Language: Vim script
# Maintainer: github user lacygoill
# Last Change: 2023 Feb 01
# Last Change: 2023 Jun 29
# NOTE: Whenever you change the code, make sure the tests are still passing:
#
@@ -112,10 +112,6 @@ const DICT_KEY: string = '^\s*\%('
.. '\)'
.. ':\%(\s\|$\)'
# NOT_A_DICT_KEY {{{3
const NOT_A_DICT_KEY: string = ':\@!'
# END_OF_COMMAND {{{3
const END_OF_COMMAND: string = $'\s*\%($\|||\@!\|{INLINE_COMMENT}\)'
@@ -197,13 +193,13 @@ patterns =<< trim eval END
ldo\=\>!\=
tabdo\=\>
windo\>
au\%[tocmd]\>.*
com\%[mand]\>.*
au\%[tocmd]\>!\=.*
com\%[mand]\>!\=.*
g\%[lobal]!\={PATTERN_DELIMITER}.*
v\%[global]!\={PATTERN_DELIMITER}.*
END
const HIGHER_ORDER_COMMAND: string = $'\%(^\|{BAR_SEPARATION}\)\s*\<\%({patterns->join('\|')}\){NOT_A_DICT_KEY}'
const HIGHER_ORDER_COMMAND: string = $'\%(^\|{BAR_SEPARATION}\)\s*\<\%({patterns->join('\|')}\)\%(\s\|$\)\@='
# START_MIDDLE_END {{{3
@@ -254,7 +250,7 @@ START_MIDDLE_END = START_MIDDLE_END
kwds->map((_, kwd: string) => kwd == ''
? ''
: $'\%(^\|{BAR_SEPARATION}\|\<sil\%[ent]\|{HIGHER_ORDER_COMMAND}\)\s*'
.. $'\<\%({kwd}\)\>\%(\s*{OPERATOR}\)\@!'))
.. $'\<\%({kwd}\)\>\%(\s\|$\|!\)\@=\%(\s*{OPERATOR}\)\@!'))
lockvar! START_MIDDLE_END
@@ -279,7 +275,7 @@ patterns = BLOCKS
const ENDS_BLOCK_OR_CLAUSE: string = '^\s*\%(' .. patterns->join('\|') .. $'\){END_OF_COMMAND}'
.. $'\|^\s*cat\%[ch]\%(\s\+\({PATTERN_DELIMITER}\).*\1\)\={END_OF_COMMAND}'
.. $'\|^\s*elseif\=\>\%({OPERATOR}\)\@!'
.. $'\|^\s*elseif\=\>\%(\s\|$\)\@=\%(\s*{OPERATOR}\)\@!'
# STARTS_NAMED_BLOCK {{{3
@@ -296,7 +292,7 @@ patterns = []
endfor
}
const STARTS_NAMED_BLOCK: string = $'^\s*\%(sil\%[ent]\s\+\)\=\%({patterns->join('\|')}\)\>{NOT_A_DICT_KEY}'
const STARTS_NAMED_BLOCK: string = $'^\s*\%(sil\%[ent]\s\+\)\=\%({patterns->join('\|')}\)\>\%(\s\|$\|!\)\@='
# STARTS_CURLY_BLOCK {{{3
@@ -312,7 +308,7 @@ const STARTS_CURLY_BLOCK: string = '\%('
# STARTS_FUNCTION {{{3
const STARTS_FUNCTION: string = $'^\s*\%({MODIFIERS.def}\)\=def\>{NOT_A_DICT_KEY}'
const STARTS_FUNCTION: string = $'^\s*\%({MODIFIERS.def}\)\=def\>!\=\s\@='
# ENDS_FUNCTION {{{3

View File

@@ -1,6 +1,7 @@
" Vim autoload file for editing compressed files.
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2016 Sep 28
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last Change: 2023 Aug 10
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" These functions are used by the gzip plugin.
@@ -9,12 +10,20 @@
fun s:check(cmd)
let name = substitute(a:cmd, '\(\S*\).*', '\1', '')
if !exists("s:have_" . name)
" safety check, don't execute anything from the current directory
let s:tmp_cwd = getcwd()
let f = (fnamemodify(exepath(name), ":p:h") !=# s:tmp_cwd
\ || (index(split($PATH,has("win32")? ';' : ':'), s:tmp_cwd) != -1 && s:tmp_cwd != '.'))
unlet s:tmp_cwd
if !f
echoerr "Warning: NOT executing " .. name .. " from current directory!"
endif
let e = executable(name)
if e < 0
let r = system(name . " --version")
let e = (r !~ "not found" && r != "")
endif
exe "let s:have_" . name . "=" . e
exe "let s:have_" . name . "=" . (e && f)
endif
exe "return s:have_" . name
endfun

View File

@@ -156,8 +156,8 @@ function! javascriptcomplete#CompleteJS(findstart, base)
\ 'text', 'vLink']
let bodys = bodyprop
" Document - document.
let docuprop = ['anchors', 'body', 'characterSet', 'doctype',
\ 'documentElement', 'documentURI', 'embeds', 'fonts', 'forms',
let docuprop = ['anchors', 'applets', 'body', 'characterSet', 'childNodes',
\ 'doctype', 'documentElement', 'documentURI', 'embeds', 'fonts', 'forms',
\ 'head', 'hidden', 'images', 'implementation', 'lastStyleSheetSet',
\ 'links', 'plugins', 'preferredStyleSheetSet', 'scripts',
\ 'scrollingElement', 'selectedStyleSheetSet', 'styleSheetSets',
@@ -171,7 +171,7 @@ function! javascriptcomplete#CompleteJS(findstart, base)
\ 'createEvent', 'createExpression', 'createNSResolver',
\ 'createNodeIterator', 'createProcessingInstruction', 'createRange',
\ 'createTextNode', 'createTouchList', 'createTreeWalker',
\ 'enableStyleSheetsForSet', 'evaluate', 'focus', 'getElementById',
\ 'enableStyleSheetsForSet', 'evaluate', 'focus',
\ 'getElementById', 'getElementsByClassName', 'getElementsByName',
\ 'getElementsByTagName', 'getElementsByTagNameNS',
\ 'hasStorageAccess', 'importNode', 'onClick', 'onDblClick',

View File

@@ -2998,7 +2998,7 @@ fun! s:NetrwGetFile(readcmd, tfile, method)
" to process this detection correctly.
" call Decho("detect filetype of local version of remote file<".rfile.">",'~'.expand("<slnum>"))
" call Decho("..did_filetype()=".did_filetype())
setl ft=
" setl ft=
" call Decho("..initial filetype<".&ft."> for buf#".bufnr()."<".bufname().">")
let iskkeep= &isk
setl isk-=/
@@ -3516,6 +3516,11 @@ fun! s:NetrwBookHistHandler(chg,curdir)
echo "bookmarked the current directory"
endif
try
call s:NetrwBookHistSave()
catch
endtry
elseif a:chg == 1
" change to the bookmarked directory
" call Decho("(user: <".v:count."gb>) change to the bookmarked directory",'~'.expand("<slnum>"))
@@ -3660,6 +3665,11 @@ fun! s:NetrwBookHistHandler(chg,curdir)
" call Decho("g:netrw_bookmarklist=".string(g:netrw_bookmarklist),'~'.expand("<slnum>"))
endif
" call Decho("resulting g:netrw_bookmarklist=".string(g:netrw_bookmarklist),'~'.expand("<slnum>"))
try
call s:NetrwBookHistSave()
catch
endtry
endif
call s:NetrwBookmarkMenu()
call s:NetrwTgtMenu()
@@ -7382,8 +7392,7 @@ fun! s:NetrwMarkFileDiff(islocal)
exe "NetrwKeepj e ".fnameescape(fname)
diffthis
elseif cnt == 2 || cnt == 3
vsplit
wincmd l
below vsplit
" call Decho("diffthis: ".fname,'~'.expand("<slnum>"))
exe "NetrwKeepj e ".fnameescape(fname)
diffthis
@@ -12044,9 +12053,9 @@ fun! s:NetrwBufRemover(bufid)
" call Decho("buf#".a:bufid." has name <".bufname(a:bufid).">","~".expand("<slnum>"))
" call Decho("buf#".a:bufid." has winid#".bufwinid(a:bufid),"~".expand("<slnum>"))
if a:bufid > 1 && !buflisted(a:bufid) && bufname(a:bufid) == "" && bufwinid(a:bufid) == -1
if a:bufid > 1 && !buflisted(a:bufid) && bufloaded(a:bufid) && bufname(a:bufid) == "" && bufwinid(a:bufid) == -1
" call Decho("(s:NetrwBufRemover) removing buffer#".a:bufid,"~".expand("<slnum>"))
exe "bd! ".a:bufid
exe "sil! bd! ".a:bufid
endif
" call Dret("s:NetrwBufRemover")

View File

@@ -1,6 +1,7 @@
" Vim support file to help with paste mappings and menus
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2019 Jan 27
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last Change: 2023 Aug 10
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" Define the string to use for items that are present both in Edit, Popup and
" Toolbar menu. Also used in mswin.vim and macmap.vim.

View File

@@ -1,207 +1,258 @@
" Author: Kevin Ballard
" Description: Helper functions for Rust commands/mappings
" Last Modified: May 27, 2014
" Last Modified: 2023-09-11
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
function! rust#Load()
" Utility call to get this script loaded, for debugging
endfunction
function! rust#GetConfigVar(name, default)
" Local buffer variable with same name takes predeence over global
if has_key(b:, a:name)
return get(b:, a:name)
endif
if has_key(g:, a:name)
return get(g:, a:name)
endif
return a:default
endfunction
" Include expression {{{1
function! rust#IncludeExpr(fname) abort
" Remove leading 'crate::' to deal with 2018 edition style 'use'
" statements
let l:fname = substitute(a:fname, '^crate::', '', '')
" Remove trailing colons arising from lines like
"
" use foo::{Bar, Baz};
let l:fname = substitute(l:fname, ':\+$', '', '')
" Replace '::' with '/'
let l:fname = substitute(l:fname, '::', '/', 'g')
" When we have
"
" use foo::bar::baz;
"
" we can't tell whether baz is a module or a function; and we can't tell
" which modules correspond to files.
"
" So we work our way up, trying
"
" foo/bar/baz.rs
" foo/bar.rs
" foo.rs
while l:fname !=# '.'
let l:path = findfile(l:fname)
if !empty(l:path)
return l:fname
endif
let l:fname = fnamemodify(l:fname, ':h')
endwhile
return l:fname
endfunction
" Jump {{{1
function! rust#Jump(mode, function) range
let cnt = v:count1
normal! m'
if a:mode ==# 'v'
norm! gv
endif
let foldenable = &foldenable
set nofoldenable
while cnt > 0
execute "call <SID>Jump_" . a:function . "()"
let cnt = cnt - 1
endwhile
let &foldenable = foldenable
let cnt = v:count1
normal! m'
if a:mode ==# 'v'
norm! gv
endif
let foldenable = &foldenable
set nofoldenable
while cnt > 0
execute "call <SID>Jump_" . a:function . "()"
let cnt = cnt - 1
endwhile
let &foldenable = foldenable
endfunction
function! s:Jump_Back()
call search('{', 'b')
keepjumps normal! w99[{
call search('{', 'b')
keepjumps normal! w99[{
endfunction
function! s:Jump_Forward()
normal! j0
call search('{', 'b')
keepjumps normal! w99[{%
call search('{')
normal! j0
call search('{', 'b')
keepjumps normal! w99[{%
call search('{')
endfunction
" Run {{{1
function! rust#Run(bang, args)
let args = s:ShellTokenize(a:args)
if a:bang
let idx = index(l:args, '--')
if idx != -1
let rustc_args = idx == 0 ? [] : l:args[:idx-1]
let args = l:args[idx+1:]
else
let rustc_args = l:args
let args = []
endif
else
let rustc_args = []
endif
let args = s:ShellTokenize(a:args)
if a:bang
let idx = index(l:args, '--')
if idx != -1
let rustc_args = idx == 0 ? [] : l:args[:idx-1]
let args = l:args[idx+1:]
else
let rustc_args = l:args
let args = []
endif
else
let rustc_args = []
endif
let b:rust_last_rustc_args = l:rustc_args
let b:rust_last_args = l:args
let b:rust_last_rustc_args = l:rustc_args
let b:rust_last_args = l:args
call s:WithPath(function("s:Run"), rustc_args, args)
call s:WithPath(function("s:Run"), rustc_args, args)
endfunction
function! s:Run(dict, rustc_args, args)
let exepath = a:dict.tmpdir.'/'.fnamemodify(a:dict.path, ':t:r')
if has('win32')
let exepath .= '.exe'
endif
let exepath = a:dict.tmpdir.'/'.fnamemodify(a:dict.path, ':t:r')
if has('win32')
let exepath .= '.exe'
endif
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
let rustc_args = [relpath, '-o', exepath] + a:rustc_args
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
let rustc_args = [relpath, '-o', exepath] + a:rustc_args
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
let output = s:system(pwd, shellescape(rustc) . " " . join(map(rustc_args, 'shellescape(v:val)')))
if output != ''
echohl WarningMsg
echo output
echohl None
endif
if !v:shell_error
exe '!' . shellescape(exepath) . " " . join(map(a:args, 'shellescape(v:val)'))
endif
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
let output = s:system(pwd, shellescape(rustc) . " " . join(map(rustc_args, 'shellescape(v:val)')))
if output !=# ''
echohl WarningMsg
echo output
echohl None
endif
if !v:shell_error
exe '!' . shellescape(exepath) . " " . join(map(a:args, 'shellescape(v:val)'))
endif
endfunction
" Expand {{{1
function! rust#Expand(bang, args)
let args = s:ShellTokenize(a:args)
if a:bang && !empty(l:args)
let pretty = remove(l:args, 0)
else
let pretty = "expanded"
endif
call s:WithPath(function("s:Expand"), pretty, args)
let args = s:ShellTokenize(a:args)
if a:bang && !empty(l:args)
let pretty = remove(l:args, 0)
else
let pretty = "expanded"
endif
call s:WithPath(function("s:Expand"), pretty, args)
endfunction
function! s:Expand(dict, pretty, args)
try
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
try
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
if a:pretty =~? '^\%(everybody_loops$\|flowgraph=\)'
let flag = '--xpretty'
else
let flag = '--pretty'
endif
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
let args = [relpath, '-Z', 'unstable-options', l:flag, a:pretty] + a:args
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)')))
if v:shell_error
echohl WarningMsg
echo output
echohl None
else
new
silent put =output
1
d
setl filetype=rust
setl buftype=nofile
setl bufhidden=hide
setl noswapfile
" give the buffer a nice name
let suffix = 1
let basename = fnamemodify(a:dict.path, ':t:r')
while 1
let bufname = basename
if suffix > 1 | let bufname .= ' ('.suffix.')' | endif
let bufname .= '.pretty.rs'
if bufexists(bufname)
let suffix += 1
continue
endif
exe 'silent noautocmd keepalt file' fnameescape(bufname)
break
endwhile
endif
endtry
if a:pretty =~? '^\%(everybody_loops$\|flowgraph=\)'
let flag = '--xpretty'
else
let flag = '--pretty'
endif
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
let args = [relpath, '-Z', 'unstable-options', l:flag, a:pretty] + a:args
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)')))
if v:shell_error
echohl WarningMsg
echo output
echohl None
else
new
silent put =output
1
d
setl filetype=rust
setl buftype=nofile
setl bufhidden=hide
setl noswapfile
" give the buffer a nice name
let suffix = 1
let basename = fnamemodify(a:dict.path, ':t:r')
while 1
let bufname = basename
if suffix > 1 | let bufname .= ' ('.suffix.')' | endif
let bufname .= '.pretty.rs'
if bufexists(bufname)
let suffix += 1
continue
endif
exe 'silent noautocmd keepalt file' fnameescape(bufname)
break
endwhile
endif
endtry
endfunction
function! rust#CompleteExpand(lead, line, pos)
if a:line[: a:pos-1] =~ '^RustExpand!\s*\S*$'
" first argument and it has a !
let list = ["normal", "expanded", "typed", "expanded,identified", "flowgraph=", "everybody_loops"]
if !empty(a:lead)
call filter(list, "v:val[:len(a:lead)-1] == a:lead")
endif
return list
endif
if a:line[: a:pos-1] =~# '^RustExpand!\s*\S*$'
" first argument and it has a !
let list = ["normal", "expanded", "typed", "expanded,identified", "flowgraph=", "everybody_loops"]
if !empty(a:lead)
call filter(list, "v:val[:len(a:lead)-1] == a:lead")
endif
return list
endif
return glob(escape(a:lead, "*?[") . '*', 0, 1)
return glob(escape(a:lead, "*?[") . '*', 0, 1)
endfunction
" Emit {{{1
function! rust#Emit(type, args)
let args = s:ShellTokenize(a:args)
call s:WithPath(function("s:Emit"), a:type, args)
let args = s:ShellTokenize(a:args)
call s:WithPath(function("s:Emit"), a:type, args)
endfunction
function! s:Emit(dict, type, args)
try
let output_path = a:dict.tmpdir.'/output'
try
let output_path = a:dict.tmpdir.'/output'
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
let args = [relpath, '--emit', a:type, '-o', output_path] + a:args
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)')))
if output != ''
echohl WarningMsg
echo output
echohl None
endif
if !v:shell_error
new
exe 'silent keepalt read' fnameescape(output_path)
1
d
if a:type == "llvm-ir"
setl filetype=llvm
let extension = 'll'
elseif a:type == "asm"
setl filetype=asm
let extension = 's'
endif
setl buftype=nofile
setl bufhidden=hide
setl noswapfile
if exists('l:extension')
" give the buffer a nice name
let suffix = 1
let basename = fnamemodify(a:dict.path, ':t:r')
while 1
let bufname = basename
if suffix > 1 | let bufname .= ' ('.suffix.')' | endif
let bufname .= '.'.extension
if bufexists(bufname)
let suffix += 1
continue
endif
exe 'silent noautocmd keepalt file' fnameescape(bufname)
break
endwhile
endif
endif
endtry
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
let args = [relpath, '--emit', a:type, '-o', output_path] + a:args
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)')))
if output !=# ''
echohl WarningMsg
echo output
echohl None
endif
if !v:shell_error
new
exe 'silent keepalt read' fnameescape(output_path)
1
d
if a:type ==# "llvm-ir"
setl filetype=llvm
let extension = 'll'
elseif a:type ==# "asm"
setl filetype=asm
let extension = 's'
endif
setl buftype=nofile
setl bufhidden=hide
setl noswapfile
if exists('l:extension')
" give the buffer a nice name
let suffix = 1
let basename = fnamemodify(a:dict.path, ':t:r')
while 1
let bufname = basename
if suffix > 1 | let bufname .= ' ('.suffix.')' | endif
let bufname .= '.'.extension
if bufexists(bufname)
let suffix += 1
continue
endif
exe 'silent noautocmd keepalt file' fnameescape(bufname)
break
endwhile
endif
endif
endtry
endfunction
" Utility functions {{{1
@@ -219,145 +270,154 @@ endfunction
" existing path of the current buffer. If the path is inside of {dict.tmpdir}
" then it is guaranteed to have a '.rs' extension.
function! s:WithPath(func, ...)
let buf = bufnr('')
let saved = {}
let dict = {}
try
let saved.write = &write
set write
let dict.path = expand('%')
let pathisempty = empty(dict.path)
let buf = bufnr('')
let saved = {}
let dict = {}
try
let saved.write = &write
set write
let dict.path = expand('%')
let pathisempty = empty(dict.path)
" Always create a tmpdir in case the wrapped command wants it
let dict.tmpdir = tempname()
call mkdir(dict.tmpdir)
" Always create a tmpdir in case the wrapped command wants it
let dict.tmpdir = tempname()
call mkdir(dict.tmpdir)
if pathisempty || !saved.write
let dict.istemp = 1
" if we're doing this because of nowrite, preserve the filename
if !pathisempty
let filename = expand('%:t:r').".rs"
else
let filename = 'unnamed.rs'
endif
let dict.tmpdir_relpath = filename
let dict.path = dict.tmpdir.'/'.filename
if pathisempty || !saved.write
let dict.istemp = 1
" if we're doing this because of nowrite, preserve the filename
if !pathisempty
let filename = expand('%:t:r').".rs"
else
let filename = 'unnamed.rs'
endif
let dict.tmpdir_relpath = filename
let dict.path = dict.tmpdir.'/'.filename
let saved.mod = &mod
set nomod
let saved.mod = &modified
set nomodified
silent exe 'keepalt write! ' . fnameescape(dict.path)
if pathisempty
silent keepalt 0file
endif
else
let dict.istemp = 0
update
endif
silent exe 'keepalt write! ' . fnameescape(dict.path)
if pathisempty
silent keepalt 0file
endif
else
let dict.istemp = 0
update
endif
call call(a:func, [dict] + a:000)
finally
if bufexists(buf)
for [opt, value] in items(saved)
silent call setbufvar(buf, '&'.opt, value)
unlet value " avoid variable type mismatches
endfor
endif
if has_key(dict, 'tmpdir') | silent call s:RmDir(dict.tmpdir) | endif
endtry
call call(a:func, [dict] + a:000)
finally
if bufexists(buf)
for [opt, value] in items(saved)
silent call setbufvar(buf, '&'.opt, value)
unlet value " avoid variable type mismatches
endfor
endif
if has_key(dict, 'tmpdir') | silent call s:RmDir(dict.tmpdir) | endif
endtry
endfunction
function! rust#AppendCmdLine(text)
call setcmdpos(getcmdpos())
let cmd = getcmdline() . a:text
return cmd
call setcmdpos(getcmdpos())
let cmd = getcmdline() . a:text
return cmd
endfunction
" Tokenize the string according to sh parsing rules
function! s:ShellTokenize(text)
" states:
" 0: start of word
" 1: unquoted
" 2: unquoted backslash
" 3: double-quote
" 4: double-quoted backslash
" 5: single-quote
let l:state = 0
let l:current = ''
let l:args = []
for c in split(a:text, '\zs')
if l:state == 0 || l:state == 1 " unquoted
if l:c ==# ' '
if l:state == 0 | continue | endif
call add(l:args, l:current)
let l:current = ''
let l:state = 0
elseif l:c ==# '\'
let l:state = 2
elseif l:c ==# '"'
let l:state = 3
elseif l:c ==# "'"
let l:state = 5
else
let l:current .= l:c
let l:state = 1
endif
elseif l:state == 2 " unquoted backslash
if l:c !=# "\n" " can it even be \n?
let l:current .= l:c
endif
let l:state = 1
elseif l:state == 3 " double-quote
if l:c ==# '\'
let l:state = 4
elseif l:c ==# '"'
let l:state = 1
else
let l:current .= l:c
endif
elseif l:state == 4 " double-quoted backslash
if stridx('$`"\', l:c) >= 0
let l:current .= l:c
elseif l:c ==# "\n" " is this even possible?
" skip it
else
let l:current .= '\'.l:c
endif
let l:state = 3
elseif l:state == 5 " single-quoted
if l:c == "'"
let l:state = 1
else
let l:current .= l:c
endif
endif
endfor
if l:state != 0
call add(l:args, l:current)
endif
return l:args
" states:
" 0: start of word
" 1: unquoted
" 2: unquoted backslash
" 3: double-quote
" 4: double-quoted backslash
" 5: single-quote
let l:state = 0
let l:current = ''
let l:args = []
for c in split(a:text, '\zs')
if l:state == 0 || l:state == 1 " unquoted
if l:c ==# ' '
if l:state == 0 | continue | endif
call add(l:args, l:current)
let l:current = ''
let l:state = 0
elseif l:c ==# '\'
let l:state = 2
elseif l:c ==# '"'
let l:state = 3
elseif l:c ==# "'"
let l:state = 5
else
let l:current .= l:c
let l:state = 1
endif
elseif l:state == 2 " unquoted backslash
if l:c !=# "\n" " can it even be \n?
let l:current .= l:c
endif
let l:state = 1
elseif l:state == 3 " double-quote
if l:c ==# '\'
let l:state = 4
elseif l:c ==# '"'
let l:state = 1
else
let l:current .= l:c
endif
elseif l:state == 4 " double-quoted backslash
if stridx('$`"\', l:c) >= 0
let l:current .= l:c
elseif l:c ==# "\n" " is this even possible?
" skip it
else
let l:current .= '\'.l:c
endif
let l:state = 3
elseif l:state == 5 " single-quoted
if l:c ==# "'"
let l:state = 1
else
let l:current .= l:c
endif
endif
endfor
if l:state != 0
call add(l:args, l:current)
endif
return l:args
endfunction
function! s:RmDir(path)
" sanity check; make sure it's not empty, /, or $HOME
if empty(a:path)
echoerr 'Attempted to delete empty path'
return 0
elseif a:path == '/' || a:path == $HOME
echoerr 'Attempted to delete protected path: ' . a:path
return 0
endif
return system("rm -rf " . shellescape(a:path))
" sanity check; make sure it's not empty, /, or $HOME
if empty(a:path)
echoerr 'Attempted to delete empty path'
return 0
elseif a:path ==# '/' || a:path ==# $HOME
let l:path = expand(a:path)
if l:path ==# '/' || l:path ==# $HOME
echoerr 'Attempted to delete protected path: ' . a:path
return 0
endif
endif
if !isdirectory(a:path)
return 0
endif
" delete() returns 0 when removing file successfully
return delete(a:path, 'rf') == 0
endfunction
" Executes {cmd} with the cwd set to {pwd}, without changing Vim's cwd.
" If {pwd} is the empty string then it doesn't change the cwd.
function! s:system(pwd, cmd)
let cmd = a:cmd
if !empty(a:pwd)
let cmd = 'cd ' . shellescape(a:pwd) . ' && ' . cmd
endif
return system(cmd)
let cmd = a:cmd
if !empty(a:pwd)
let cmd = 'cd ' . shellescape(a:pwd) . ' && ' . cmd
endif
return system(cmd)
endfunction
" Playpen Support {{{1
@@ -366,10 +426,10 @@ endfunction
" http://github.com/mattn/gist-vim
function! s:has_webapi()
if !exists("*webapi#http#post")
try
call webapi#http#post()
catch
endtry
try
call webapi#http#post()
catch
endtry
endif
return exists("*webapi#http#post")
endfunction
@@ -381,35 +441,130 @@ function! rust#Play(count, line1, line2, ...) abort
let l:rust_shortener_url = get(g:, 'rust_shortener_url', 'https://is.gd/')
if !s:has_webapi()
echohl ErrorMsg | echomsg ':RustPlay depends on webapi.vim (https://github.com/mattn/webapi-vim)' | echohl None
return
echohl ErrorMsg | echomsg ':RustPlay depends on webapi.vim (https://github.com/mattn/webapi-vim)' | echohl None
return
endif
let bufname = bufname('%')
if a:count < 1
let content = join(getline(a:line1, a:line2), "\n")
let content = join(getline(a:line1, a:line2), "\n")
else
let save_regcont = @"
let save_regtype = getregtype('"')
silent! normal! gvy
let content = @"
call setreg('"', save_regcont, save_regtype)
let save_regcont = @"
let save_regtype = getregtype('"')
silent! normal! gvy
let content = @"
call setreg('"', save_regcont, save_regtype)
endif
let body = l:rust_playpen_url."?code=".webapi#http#encodeURI(content)
let url = l:rust_playpen_url."?code=".webapi#http#encodeURI(content)
if strlen(body) > 5000
echohl ErrorMsg | echomsg 'Buffer too large, max 5000 encoded characters ('.strlen(body).')' | echohl None
return
if strlen(url) > 5000
echohl ErrorMsg | echomsg 'Buffer too large, max 5000 encoded characters ('.strlen(url).')' | echohl None
return
endif
let payload = "format=simple&url=".webapi#http#encodeURI(body)
let payload = "format=simple&url=".webapi#http#encodeURI(url)
let res = webapi#http#post(l:rust_shortener_url.'create.php', payload, {})
let url = res.content
if res.status[0] ==# '2'
let url = res.content
endif
redraw | echomsg 'Done: '.url
let footer = ''
if exists('g:rust_clip_command')
call system(g:rust_clip_command, url)
if !v:shell_error
let footer = ' (copied to clipboard)'
endif
endif
redraw | echomsg 'Done: '.url.footer
endfunction
" Run a test under the cursor or all tests {{{1
" Finds a test function name under the cursor. Returns empty string when a
" test function is not found.
function! s:SearchTestFunctionNameUnderCursor() abort
let cursor_line = line('.')
" Find #[test] attribute
if search('\m\C#\[test\]', 'bcW') is 0
return ''
endif
" Move to an opening brace of the test function
let test_func_line = search('\m\C^\s*fn\s\+\h\w*\s*(.\+{$', 'eW')
if test_func_line is 0
return ''
endif
" Search the end of test function (closing brace) to ensure that the
" cursor position is within function definition
if maparg('<Plug>(MatchitNormalForward)') ==# ''
keepjumps normal! %
else
" Prefer matchit.vim official plugin to native % since the plugin
" provides better behavior than original % (#391)
" To load the plugin, run:
" :packadd matchit
execute 'keepjumps' 'normal' "\<Plug>(MatchitNormalForward)"
endif
if line('.') < cursor_line
return ''
endif
return matchstr(getline(test_func_line), '\m\C^\s*fn\s\+\zs\h\w*')
endfunction
function! rust#Test(mods, winsize, all, options) abort
let manifest = findfile('Cargo.toml', expand('%:p:h') . ';')
if manifest ==# ''
return rust#Run(1, '--test ' . a:options)
endif
" <count> defaults to 0, but we prefer an empty string
let winsize = a:winsize ? a:winsize : ''
if has('terminal')
if has('patch-8.0.910')
let cmd = printf('%s noautocmd %snew | terminal ++curwin ', a:mods, winsize)
else
let cmd = printf('%s terminal ', a:mods)
endif
elseif has('nvim')
let cmd = printf('%s noautocmd %snew | terminal ', a:mods, winsize)
else
let cmd = '!'
let manifest = shellescape(manifest)
endif
if a:all
if a:options ==# ''
execute cmd . 'cargo test --manifest-path' manifest
else
execute cmd . 'cargo test --manifest-path' manifest a:options
endif
return
endif
let saved = getpos('.')
try
let func_name = s:SearchTestFunctionNameUnderCursor()
finally
call setpos('.', saved)
endtry
if func_name ==# ''
echohl ErrorMsg
echomsg 'No test function was found under the cursor. Please add ! to command if you want to run all tests'
echohl None
return
endif
if a:options ==# ''
execute cmd . 'cargo test --manifest-path' manifest func_name
else
execute cmd . 'cargo test --manifest-path' manifest func_name a:options
endif
endfunction
" }}}1
" vim: set noet sw=8 ts=8:
" vim: set et sw=4 sts=4 ts=8:

View File

@@ -0,0 +1,105 @@
" Last Modified: 2023-09-11
" For debugging, inspired by https://github.com/w0rp/rust/blob/master/autoload/rust/debugging.vim
let s:global_variable_list = [
\ '_rustfmt_autosave_because_of_config',
\ 'ftplugin_rust_source_path',
\ 'loaded_syntastic_rust_cargo_checker',
\ 'loaded_syntastic_rust_filetype',
\ 'loaded_syntastic_rust_rustc_checker',
\ 'rust_bang_comment_leader',
\ 'rust_cargo_avoid_whole_workspace',
\ 'rust_clip_command',
\ 'rust_conceal',
\ 'rust_conceal_mod_path',
\ 'rust_conceal_pub',
\ 'rust_fold',
\ 'rust_last_args',
\ 'rust_last_rustc_args',
\ 'rust_original_delimitMate_excluded_regions',
\ 'rust_playpen_url',
\ 'rust_prev_delimitMate_quotes',
\ 'rust_recent_nearest_cargo_tol',
\ 'rust_recent_root_cargo_toml',
\ 'rust_recommended_style',
\ 'rust_set_conceallevel',
\ 'rust_set_conceallevel=1',
\ 'rust_set_foldmethod',
\ 'rust_set_foldmethod=1',
\ 'rust_shortener_url',
\ 'rustc_makeprg_no_percent',
\ 'rustc_path',
\ 'rustfmt_autosave',
\ 'rustfmt_autosave_if_config_present',
\ 'rustfmt_command',
\ 'rustfmt_emit_files',
\ 'rustfmt_fail_silently',
\ 'rustfmt_options',
\ 'syntastic_extra_filetypes',
\ 'syntastic_rust_cargo_fname',
\]
function! s:Echo(message) abort
execute 'echo a:message'
endfunction
function! s:EchoGlobalVariables() abort
for l:key in s:global_variable_list
if l:key !~# '^_'
call s:Echo('let g:' . l:key . ' = ' . string(get(g:, l:key, v:null)))
endif
if has_key(b:, l:key)
call s:Echo('let b:' . l:key . ' = ' . string(b:[l:key]))
endif
endfor
endfunction
function! rust#debugging#Info() abort
call cargo#Load()
call rust#Load()
call rustfmt#Load()
call s:Echo('rust.vim Global Variables:')
call s:Echo('')
call s:EchoGlobalVariables()
silent let l:output = system(g:rustfmt_command . ' --version')
echo l:output
let l:rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
silent let l:output = system(l:rustc . ' --version')
echo l:output
silent let l:output = system('cargo --version')
echo l:output
version
if exists(":SyntasticInfo")
echo "----"
echo "Info from Syntastic:"
execute "SyntasticInfo"
endif
endfunction
function! rust#debugging#InfoToClipboard() abort
redir @"
silent call rust#debugging#Info()
redir END
call s:Echo('RustInfo copied to your clipboard')
endfunction
function! rust#debugging#InfoToFile(filename) abort
let l:expanded_filename = expand(a:filename)
redir => l:output
silent call rust#debugging#Info()
redir END
call writefile(split(l:output, "\n"), l:expanded_filename)
call s:Echo('RustInfo written to ' . l:expanded_filename)
endfunction
" vim: set et sw=4 sts=4 ts=8:

View File

@@ -1,107 +1,261 @@
" Author: Stephen Sugden <stephen@stephensugden.com>
" Last Modified: 2023-09-11
"
" Adapted from https://github.com/fatih/vim-go
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
if !exists("g:rustfmt_autosave")
let g:rustfmt_autosave = 0
let g:rustfmt_autosave = 0
endif
if !exists("g:rustfmt_command")
let g:rustfmt_command = "rustfmt"
let g:rustfmt_command = "rustfmt"
endif
if !exists("g:rustfmt_options")
let g:rustfmt_options = ""
let g:rustfmt_options = ""
endif
if !exists("g:rustfmt_fail_silently")
let g:rustfmt_fail_silently = 0
let g:rustfmt_fail_silently = 0
endif
function! rustfmt#DetectVersion()
" Save rustfmt '--help' for feature inspection
silent let s:rustfmt_help = system(g:rustfmt_command . " --help")
let s:rustfmt_unstable_features = s:rustfmt_help =~# "--unstable-features"
" Build a comparable rustfmt version varible out of its `--version` output:
silent let l:rustfmt_version_full = system(g:rustfmt_command . " --version")
let l:rustfmt_version_list = matchlist(l:rustfmt_version_full,
\ '\vrustfmt ([0-9]+[.][0-9]+[.][0-9]+)')
if len(l:rustfmt_version_list) < 3
let s:rustfmt_version = "0"
else
let s:rustfmt_version = l:rustfmt_version_list[1]
endif
return s:rustfmt_version
endfunction
call rustfmt#DetectVersion()
if !exists("g:rustfmt_emit_files")
let g:rustfmt_emit_files = s:rustfmt_version >= "0.8.2"
endif
if !exists("g:rustfmt_file_lines")
let g:rustfmt_file_lines = s:rustfmt_help =~# "--file-lines JSON"
endif
let s:got_fmt_error = 0
function! rustfmt#Load()
" Utility call to get this script loaded, for debugging
endfunction
function! s:RustfmtWriteMode()
if g:rustfmt_emit_files
return "--emit=files"
else
return "--write-mode=overwrite"
endif
endfunction
function! s:RustfmtConfigOptions()
let l:rustfmt_toml = findfile('rustfmt.toml', expand('%:p:h') . ';')
if l:rustfmt_toml !=# ''
return '--config-path '.shellescape(fnamemodify(l:rustfmt_toml, ":p"))
endif
let l:_rustfmt_toml = findfile('.rustfmt.toml', expand('%:p:h') . ';')
if l:_rustfmt_toml !=# ''
return '--config-path '.shellescape(fnamemodify(l:_rustfmt_toml, ":p"))
endif
" Default to edition 2018 in case no rustfmt.toml was found.
return '--edition 2018'
endfunction
function! s:RustfmtCommandRange(filename, line1, line2)
let l:arg = {"file": shellescape(a:filename), "range": [a:line1, a:line2]}
return printf("%s %s --write-mode=overwrite --file-lines '[%s]'", g:rustfmt_command, g:rustfmt_options, json_encode(l:arg))
if g:rustfmt_file_lines == 0
echo "--file-lines is not supported in the installed `rustfmt` executable"
return
endif
let l:arg = {"file": shellescape(a:filename), "range": [a:line1, a:line2]}
let l:write_mode = s:RustfmtWriteMode()
let l:rustfmt_config = s:RustfmtConfigOptions()
" FIXME: When --file-lines gets to be stable, add version range checking
" accordingly.
let l:unstable_features = s:rustfmt_unstable_features ? '--unstable-features' : ''
let l:cmd = printf("%s %s %s %s %s --file-lines '[%s]' %s", g:rustfmt_command,
\ l:write_mode, g:rustfmt_options,
\ l:unstable_features, l:rustfmt_config,
\ json_encode(l:arg), shellescape(a:filename))
return l:cmd
endfunction
function! s:RustfmtCommand(filename)
return g:rustfmt_command . " --write-mode=overwrite " . g:rustfmt_options . " " . shellescape(a:filename)
function! s:RustfmtCommand()
let write_mode = g:rustfmt_emit_files ? '--emit=stdout' : '--write-mode=display'
let config = s:RustfmtConfigOptions()
return join([g:rustfmt_command, write_mode, config, g:rustfmt_options])
endfunction
function! s:RunRustfmt(command, curw, tmpname)
if exists("*systemlist")
let out = systemlist(a:command)
else
let out = split(system(a:command), '\r\?\n')
endif
function! s:DeleteLines(start, end) abort
silent! execute a:start . ',' . a:end . 'delete _'
endfunction
if v:shell_error == 0 || v:shell_error == 3
" remove undo point caused via BufWritePre
try | silent undojoin | catch | endtry
function! s:RunRustfmt(command, tmpname, from_writepre)
let l:view = winsaveview()
" Replace current file with temp file, then reload buffer
call rename(a:tmpname, expand('%'))
silent edit!
let &syntax = &syntax
let l:stderr_tmpname = tempname()
call writefile([], l:stderr_tmpname)
" only clear location list if it was previously filled to prevent
" clobbering other additions
if s:got_fmt_error
let s:got_fmt_error = 0
call setloclist(0, [])
lwindow
endif
elseif g:rustfmt_fail_silently == 0
" otherwise get the errors and put them in the location list
let errors = []
let l:command = a:command . ' 2> ' . l:stderr_tmpname
for line in out
" src/lib.rs:13:5: 13:10 error: expected `,`, or `}`, found `value`
let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\):\s*\(\d\+:\d\+\s*\)\?\s*error: \(.*\)')
if !empty(tokens)
call add(errors, {"filename": @%,
\"lnum": tokens[2],
\"col": tokens[3],
\"text": tokens[5]})
endif
endfor
if a:tmpname ==# ''
" Rustfmt in stdin/stdout mode
if empty(errors)
% | " Couldn't detect rustfmt error format, output errors
endif
" chdir to the directory of the file
let l:has_lcd = haslocaldir()
let l:prev_cd = getcwd()
execute 'lchdir! '.expand('%:h')
if !empty(errors)
call setloclist(0, errors, 'r')
echohl Error | echomsg "rustfmt returned error" | echohl None
endif
let l:buffer = getline(1, '$')
if exists("*systemlist")
silent let out = systemlist(l:command, l:buffer)
else
silent let out = split(system(l:command,
\ join(l:buffer, "\n")), '\r\?\n')
endif
else
if exists("*systemlist")
silent let out = systemlist(l:command)
else
silent let out = split(system(l:command), '\r\?\n')
endif
endif
let s:got_fmt_error = 1
lwindow
" We didn't use the temp file, so clean up
call delete(a:tmpname)
endif
let l:stderr = readfile(l:stderr_tmpname)
call winrestview(a:curw)
call delete(l:stderr_tmpname)
let l:open_lwindow = 0
if v:shell_error == 0
if a:from_writepre
" remove undo point caused via BufWritePre
try | silent undojoin | catch | endtry
endif
if a:tmpname ==# ''
let l:content = l:out
else
" take the tmpfile's content, this is better than rename
" because it preserves file modes.
let l:content = readfile(a:tmpname)
endif
call s:DeleteLines(len(l:content), line('$'))
call setline(1, l:content)
" only clear location list if it was previously filled to prevent
" clobbering other additions
if s:got_fmt_error
let s:got_fmt_error = 0
call setloclist(0, [])
let l:open_lwindow = 1
endif
elseif g:rustfmt_fail_silently == 0 && !a:from_writepre
" otherwise get the errors and put them in the location list
let l:errors = []
let l:prev_line = ""
for l:line in l:stderr
" error: expected one of `;` or `as`, found `extern`
" --> src/main.rs:2:1
let tokens = matchlist(l:line, '^\s\+-->\s\(.\{-}\):\(\d\+\):\(\d\+\)$')
if !empty(tokens)
call add(l:errors, {"filename": @%,
\"lnum": tokens[2],
\"col": tokens[3],
\"text": l:prev_line})
endif
let l:prev_line = l:line
endfor
if !empty(l:errors)
call setloclist(0, l:errors, 'r')
echohl Error | echomsg "rustfmt returned error" | echohl None
else
echo "rust.vim: was not able to parse rustfmt messages. Here is the raw output:"
echo "\n"
for l:line in l:stderr
echo l:line
endfor
endif
let s:got_fmt_error = 1
let l:open_lwindow = 1
endif
" Restore the current directory if needed
if a:tmpname ==# ''
if l:has_lcd
execute 'lchdir! '.l:prev_cd
else
execute 'chdir! '.l:prev_cd
endif
endif
" Open lwindow after we have changed back to the previous directory
if l:open_lwindow == 1
lwindow
endif
call winrestview(l:view)
endfunction
function! rustfmt#FormatRange(line1, line2)
let l:curw = winsaveview()
let l:tmpname = expand("%:p:h") . "/." . expand("%:p:t") . ".rustfmt"
call writefile(getline(1, '$'), l:tmpname)
let command = s:RustfmtCommandRange(l:tmpname, a:line1, a:line2)
call s:RunRustfmt(command, l:curw, l:tmpname)
let l:tmpname = tempname()
call writefile(getline(1, '$'), l:tmpname)
let command = s:RustfmtCommandRange(l:tmpname, a:line1, a:line2)
call s:RunRustfmt(command, l:tmpname, v:false)
call delete(l:tmpname)
endfunction
function! rustfmt#Format()
let l:curw = winsaveview()
let l:tmpname = expand("%:p:h") . "/." . expand("%:p:t") . ".rustfmt"
call writefile(getline(1, '$'), l:tmpname)
let command = s:RustfmtCommand(l:tmpname)
call s:RunRustfmt(command, l:curw, l:tmpname)
call s:RunRustfmt(s:RustfmtCommand(), '', v:false)
endfunction
function! rustfmt#Cmd()
" Mainly for debugging
return s:RustfmtCommand()
endfunction
function! rustfmt#PreWrite()
if !filereadable(expand("%@"))
return
endif
if rust#GetConfigVar('rustfmt_autosave_if_config_present', 0)
if findfile('rustfmt.toml', '.;') !=# '' || findfile('.rustfmt.toml', '.;') !=# ''
let b:rustfmt_autosave = 1
let b:_rustfmt_autosave_because_of_config = 1
endif
else
if has_key(b:, '_rustfmt_autosave_because_of_config')
unlet b:_rustfmt_autosave_because_of_config
unlet b:rustfmt_autosave
endif
endif
if !rust#GetConfigVar("rustfmt_autosave", 0)
return
endif
call s:RunRustfmt(s:RustfmtCommand(), '', v:true)
endfunction
" vim: set et sw=4 sts=4 ts=8:

View File

@@ -1,6 +1,7 @@
" Vim script to download a missing spell file
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2020 Jul 10
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last Change: 2023 Aug 10
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
if !exists('g:spellfile_URL')
" Always use https:// because it's secure. The certificate is for nluug.nl,

View File

@@ -1,6 +1,6 @@
" Vim autoload file for the tohtml plugin.
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
" Last Change: 2023 Jan 01
" Last Change: 2023 Sep 03
"
" Additional contributors:
"
@@ -307,7 +307,7 @@ func! tohtml#Convert2HTML(line1, line2) "{{{
let g:html_diff_win_num = 0
for window in win_list
" switch to the next buffer to convert
exe ":" . bufwinnr(window) . "wincmd w"
exe ":" .. bufwinnr(window) .. "wincmd w"
" figure out whether current charset and encoding will work, if not
" default to UTF-8
@@ -355,7 +355,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
if !s:settings.no_doc
if s:settings.use_xhtml
if s:settings.encoding != ""
let xml_line = "<?xml version=\"1.0\" encoding=\"" . s:settings.encoding . "\"?>"
let xml_line = "<?xml version=\"1.0\" encoding=\"" .. s:settings.encoding .. "\"?>"
else
let xml_line = "<?xml version=\"1.0\"?>"
endif
@@ -387,34 +387,34 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
" contained in XML information
if s:settings.encoding != "" && !s:settings.use_xhtml
if s:html5
call add(html, '<meta charset="' . s:settings.encoding . '"' . tag_close)
call add(html, '<meta charset="' .. s:settings.encoding .. '"' .. tag_close)
else
call add(html, "<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:settings.encoding . '"' . tag_close)
call add(html, "<meta http-equiv=\"content-type\" content=\"text/html; charset=" .. s:settings.encoding .. '"' .. tag_close)
endif
endif
call add(html, '<title>diff</title>')
call add(html, '<meta name="Generator" content="Vim/'.v:version/100.'.'.v:version%100.'"'.tag_close)
call add(html, '<meta name="plugin-version" content="'.g:loaded_2html_plugin.'"'.tag_close)
call add(html, '<meta name="Generator" content="Vim/'..v:version/100..'.'..v:version%100..'"'..tag_close)
call add(html, '<meta name="plugin-version" content="'..g:loaded_2html_plugin..'"'..tag_close)
call add(html, '<meta name="settings" content="'.
\ join(filter(keys(s:settings),'s:settings[v:val]'),',').
\ ',prevent_copy='.s:settings.prevent_copy.
\ ',use_input_for_pc='.s:settings.use_input_for_pc.
\ '"'.tag_close)
\ ',prevent_copy='..s:settings.prevent_copy.
\ ',use_input_for_pc='..s:settings.use_input_for_pc.
\ '"'..tag_close)
call add(html, '<meta name="colorscheme" content="'.
\ (exists('g:colors_name')
\ ? g:colors_name
\ : 'none'). '"'.tag_close)
\ : 'none').. '"'..tag_close)
call add(html, '</head>')
let body_line_num = len(html)
call add(html, '<body'.(s:settings.line_ids ? ' onload="JumpToLine();"' : '').'>')
call add(html, '<body'..(s:settings.line_ids ? ' onload="JumpToLine();"' : '')..'>')
endif
call add(html, "<table ".(s:settings.use_css? "" : "border='1' width='100%' ")."id='vimCodeElement".s:settings.id_suffix."'>")
call add(html, "<table "..(s:settings.use_css? "" : "border='1' width='100%' ").."id='vimCodeElement"..s:settings.id_suffix.."'>")
call add(html, '<tr>')
for buf in a:win_list
call add(html, '<th>'.bufname(buf).'</th>')
call add(html, '<th>'..bufname(buf)..'</th>')
endfor
call add(html, '</tr><tr>')
@@ -423,7 +423,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
for buf in a:buf_list
let temp = []
exe bufwinnr(buf) . 'wincmd w'
exe bufwinnr(buf) .. 'wincmd w'
" If text is folded because of user foldmethod settings, etc. we don't want
" to act on everything in a fold by mistake.
@@ -526,16 +526,16 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
endif
let i = 1
let name = "Diff" . (s:settings.use_xhtml ? ".xhtml" : ".html")
let name = "Diff" .. (s:settings.use_xhtml ? ".xhtml" : ".html")
" Find an unused file name if current file name is already in use
while filereadable(name)
let name = substitute(name, '\d*\.x\?html$', '', '') . i . '.' . fnamemodify(copy(name), ":t:e")
let name = substitute(name, '\d*\.x\?html$', '', '') .. i .. '.' .. fnamemodify(copy(name), ":t:e")
let i += 1
endwhile
let s:ei_sav = &eventignore
set eventignore+=FileType
exe "topleft new " . name
exe "topleft new " .. name
let &eventignore=s:ei_sav
unlet s:ei_sav
@@ -601,7 +601,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
\ "",
\ " /* navigate upwards in the DOM tree to open all folds containing the line */",
\ " var node = lineElem;",
\ " while (node && node.id != 'vimCodeElement".s:settings.id_suffix."')",
\ " while (node && node.id != 'vimCodeElement"..s:settings.id_suffix.."')",
\ " {",
\ " if (node.className == 'closed-fold')",
\ " {",
@@ -640,7 +640,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
call append(style_start, [
\ " function toggleFold(objID)",
\ " {",
\ " for (win_num = 1; win_num <= ".len(a:buf_list)."; win_num++)",
\ " for (win_num = 1; win_num <= "..len(a:buf_list).."; win_num++)",
\ " {",
\ " var fold;",
\ ' fold = document.getElementById("win"+win_num+objID);',
@@ -660,7 +660,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
if s:uses_script
" insert script tag if needed
call append(style_start, [
\ "<script" . (s:html5 ? "" : " type='text/javascript'") . ">",
\ "<script" .. (s:html5 ? "" : " type='text/javascript'") .. ">",
\ s:settings.use_xhtml ? '//<![CDATA[' : "<!--"])
endif
@@ -671,14 +671,14 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
" is pretty useless for really long lines. {{{
if s:settings.use_css
call append(style_start,
\ ['<style' . (s:html5 ? '' : 'type="text/css"') . '>']+
\ ['<style' .. (s:html5 ? '' : 'type="text/css"') .. '>']+
\ style+
\ [ s:settings.use_xhtml ? '' : '<!--',
\ 'table { table-layout: fixed; }',
\ 'html, body, table, tbody { width: 100%; margin: 0; padding: 0; }',
\ 'table, td, th { border: 1px solid; }',
\ 'td { vertical-align: top; }',
\ 'th, td { width: '.printf("%.1f",100.0/len(a:win_list)).'%; }',
\ 'th, td { width: '..printf("%.1f",100.0/len(a:win_list))..'%; }',
\ 'td div { overflow: auto; }',
\ s:settings.use_xhtml ? '' : '-->',
\ '</style>'
@@ -694,7 +694,7 @@ endfunc "}}}
" Gets a single user option and sets it in the passed-in Dict, or gives it the
" default value if the option doesn't actually exist.
func! tohtml#GetOption(settings, option, default) "{{{
if exists('g:html_'.a:option)
if exists('g:html_'..a:option)
let a:settings[a:option] = g:html_{a:option}
else
let a:settings[a:option] = a:default
@@ -713,10 +713,11 @@ func! tohtml#GetUserSettings() "{{{
let user_settings = {}
" Define the correct option if the old option name exists and we haven't
" already defined the correct one. Maybe I'll put out a warning message about
" this sometime and remove the old option entirely at some even later time,
" but for now just silently accept the old option.
" already defined the correct one.
if exists('g:use_xhtml') && !exists("g:html_use_xhtml")
echohl WarningMsg
echomsg "Warning: g:use_xhtml is deprecated, use g:html_use_xhtml"
echohl None
let g:html_use_xhtml = g:use_xhtml
endif
@@ -739,7 +740,7 @@ func! tohtml#GetUserSettings() "{{{
call tohtml#GetOption(user_settings, 'whole_filler', 0 )
call tohtml#GetOption(user_settings, 'use_xhtml', 0 )
call tohtml#GetOption(user_settings, 'line_ids', user_settings.number_lines )
call tohtml#GetOption(user_settings, 'use_input_for_pc', 'fallback')
call tohtml#GetOption(user_settings, 'use_input_for_pc', 'none')
" }}}
" override those settings that need it {{{
@@ -854,16 +855,16 @@ func! tohtml#GetUserSettings() "{{{
if user_settings.use_css
if exists("g:html_prevent_copy")
if user_settings.dynamic_folds && !user_settings.no_foldcolumn && g:html_prevent_copy =~# 'f'
let user_settings.prevent_copy .= 'f'
let user_settings.prevent_copy ..= 'f'
endif
if user_settings.number_lines && g:html_prevent_copy =~# 'n'
let user_settings.prevent_copy .= 'n'
let user_settings.prevent_copy ..= 'n'
endif
if &diff && g:html_prevent_copy =~# 'd'
let user_settings.prevent_copy .= 'd'
let user_settings.prevent_copy ..= 'd'
endif
if !user_settings.ignore_folding && g:html_prevent_copy =~# 't'
let user_settings.prevent_copy .= 't'
let user_settings.prevent_copy ..= 't'
endif
else
let user_settings.prevent_copy = ""
@@ -875,10 +876,10 @@ func! tohtml#GetUserSettings() "{{{
" enforce valid values for use_input_for_pc
if user_settings.use_input_for_pc !~# 'fallback\|none\|all'
let user_settings.use_input_for_pc = 'fallback'
let user_settings.use_input_for_pc = 'none'
echohl WarningMsg
echomsg '2html: "' . g:html_use_input_for_pc . '" is not valid for g:html_use_input_for_pc'
echomsg '2html: defaulting to "' . user_settings.use_input_for_pc . '"'
echomsg '2html: "' .. g:html_use_input_for_pc .. '" is not valid for g:html_use_input_for_pc'
echomsg '2html: defaulting to "' .. user_settings.use_input_for_pc .. '"'
echohl None
sleep 3
endif

View File

@@ -57,6 +57,15 @@ if !exists("g:zip_extractcmd")
let g:zip_extractcmd= g:zip_unzipcmd
endif
let s:tmp_cwd = getcwd()
if (fnamemodify(exepath(g:zip_unzipcmd), ":p:h") ==# getcwd()
\ && (index(split($PATH,has("win32")? ';' : ':'), s:tmp_cwd) == -1 || s:tmp_cwd == '.'))
unlet s:tmp_cwd
echoerr "Warning: NOT executing " .. g:zip_unzipcmd .. " from current directory!"
finish
endif
unlet s:tmp_cwd
" ----------------
" Functions: {{{1
" ----------------

View File

@@ -1,8 +1,9 @@
:" Use this script to create the file "bugreport.txt", which contains
:" information about the environment of a possible bug in Vim.
:"
:" Maintainer: Bram Moolenaar <Bram@vim.org>
:" Last change: 2019 Jan 27
:" Maintainer: The Vim Project <https://github.com/vim/vim>
:" Last change: 2023 Aug 10
:" Former Maintainer: Bram Moolenaar <Bram@vim.org>
:"
:" To use inside Vim:
:" :so $VIMRUNTIME/bugreport.vim

View File

@@ -1,6 +1,7 @@
" Vim color file
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2001 Jul 23
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last Change: 2023 Aug 10
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" This is the default color scheme. It doesn't define the Normal
" highlighting, it uses whatever the colors used to be.

View File

@@ -8,4 +8,4 @@ If you want to write your own compiler plugin, have a look at the other files
for how to do it, the format is simple.
If you think a compiler plugin you have written is useful for others, please
send it to Bram@vim.org.
send it to the vim-dev mailing list: <vim-dev@vim.org>

View File

@@ -1,35 +1,51 @@
" Vim compiler file
" Compiler: Cargo Compiler
" Maintainer: Damien Radtke <damienradtke@gmail.com>
" Latest Revision: 2014 Sep 24
" Latest Revision: 2023-09-11
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
if exists('current_compiler')
finish
finish
endif
runtime compiler/rustc.vim
let current_compiler = "cargo"
" vint: -ProhibitAbbreviationOption
let s:save_cpo = &cpo
set cpo&vim
" vint: +ProhibitAbbreviationOption
if exists(':CompilerSet') != 2
command -nargs=* CompilerSet setlocal <args>
command -nargs=* CompilerSet setlocal <args>
endif
if exists('g:cargo_makeprg_params')
execute 'CompilerSet makeprg=cargo\ '.escape(g:cargo_makeprg_params, ' \|"').'\ $*'
execute 'CompilerSet makeprg=cargo\ '.escape(g:cargo_makeprg_params, ' \|"').'\ $*'
else
CompilerSet makeprg=cargo\ $*
CompilerSet makeprg=cargo\ $*
endif
augroup RustCargoQuickFixHooks
autocmd!
autocmd QuickFixCmdPre make call cargo#quickfix#CmdPre()
autocmd QuickFixCmdPost make call cargo#quickfix#CmdPost()
augroup END
" Ignore general cargo progress messages
CompilerSet errorformat+=
\%-G%\\s%#Downloading%.%#,
\%-G%\\s%#Compiling%.%#,
\%-G%\\s%#Finished%.%#,
\%-G%\\s%#error:\ Could\ not\ compile\ %.%#,
\%-G%\\s%#To\ learn\ more\\,%.%#
\%-G%\\s%#Downloading%.%#,
\%-G%\\s%#Checking%.%#,
\%-G%\\s%#Compiling%.%#,
\%-G%\\s%#Finished%.%#,
\%-G%\\s%#error:\ Could\ not\ compile\ %.%#,
\%-G%\\s%#To\ learn\ more\\,%.%#,
\%-G%\\s%#For\ more\ information\ about\ this\ error\\,%.%#,
\%-Gnote:\ Run\ with\ \`RUST_BACKTRACE=%.%#,
\%.%#panicked\ at\ \\'%m\\'\\,\ %f:%l:%c
" vint: -ProhibitAbbreviationOption
let &cpo = s:save_cpo
unlet s:save_cpo
" vint: +ProhibitAbbreviationOption
" vim: set et sw=4 sts=4 ts=8:

View File

@@ -1,7 +1,8 @@
" Vim compiler file
" Compiler: Microsoft Visual C
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2014 Sep 20
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last Change: 2023 Aug 10
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
if exists("current_compiler")
finish

View File

@@ -1,46 +1,57 @@
" Vim compiler file
" Compiler: Rust Compiler
" Maintainer: Chris Morgan <me@chrismorgan.info>
" Latest Revision: 2013 Jul 12
" Latest Revision: 2023-09-11
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
if exists("current_compiler")
finish
finish
endif
let current_compiler = "rustc"
let s:cpo_save = &cpo
" vint: -ProhibitAbbreviationOption
let s:save_cpo = &cpo
set cpo&vim
" vint: +ProhibitAbbreviationOption
if exists(":CompilerSet") != 2
command -nargs=* CompilerSet setlocal <args>
command -nargs=* CompilerSet setlocal <args>
endif
if exists("g:rustc_makeprg_no_percent") && g:rustc_makeprg_no_percent != 0
CompilerSet makeprg=rustc
if get(g:, 'rustc_makeprg_no_percent', 0)
CompilerSet makeprg=rustc
else
CompilerSet makeprg=rustc\ \%:S
if has('patch-7.4.191')
CompilerSet makeprg=rustc\ \%:S
else
CompilerSet makeprg=rustc\ \"%\"
endif
endif
" Old errorformat (before nightly 2016/08/10)
CompilerSet errorformat=
\%f:%l:%c:\ %t%*[^:]:\ %m,
\%f:%l:%c:\ %*\\d:%*\\d\ %t%*[^:]:\ %m,
\%-G%f:%l\ %s,
\%-G%*[\ ]^,
\%-G%*[\ ]^%*[~],
\%-G%*[\ ]...
" New errorformat (after nightly 2016/08/10)
CompilerSet errorformat+=
\%-G,
\%-Gerror:\ aborting\ %.%#,
\%-Gerror:\ Could\ not\ compile\ %.%#,
\%Eerror:\ %m,
\%Eerror[E%n]:\ %m,
\%Wwarning:\ %m,
\%Inote:\ %m,
\%C\ %#-->\ %f:%l:%c
CompilerSet errorformat=
\%-G,
\%-Gerror:\ aborting\ %.%#,
\%-Gerror:\ Could\ not\ compile\ %.%#,
\%Eerror:\ %m,
\%Eerror[E%n]:\ %m,
\%Wwarning:\ %m,
\%Inote:\ %m,
\%C\ %#-->\ %f:%l:%c,
\%E\ \ left:%m,%C\ right:%m\ %f:%l:%c,%Z
let &cpo = s:cpo_save
unlet s:cpo_save
" Old errorformat (before nightly 2016/08/10)
CompilerSet errorformat+=
\%f:%l:%c:\ %t%*[^:]:\ %m,
\%f:%l:%c:\ %*\\d:%*\\d\ %t%*[^:]:\ %m,
\%-G%f:%l\ %s,
\%-G%*[\ ]^,
\%-G%*[\ ]^%*[~],
\%-G%*[\ ]...
" vint: -ProhibitAbbreviationOption
let &cpo = s:save_cpo
unlet s:save_cpo
" vint: +ProhibitAbbreviationOption
" vim: set et sw=4 sts=4 ts=8:

View File

@@ -1,7 +1,8 @@
" The default vimrc file.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2023 May 10
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last change: 2023 Aug 10
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
"
" This is loaded if no vimrc file was found.
" Except when Vim is run with "-u NONE" or "-C".
@@ -97,17 +98,21 @@ if 1
filetype plugin indent on
" Put these in an autocmd group, so that you can revert them with:
" ":augroup vimStartup | exe 'au!' | augroup END"
" ":autocmd! vimStartup"
augroup vimStartup
au!
autocmd!
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid, when inside an event handler
" (happens when dropping a file on gvim) and for a commit message (it's
" likely a different one than last time).
" (happens when dropping a file on gvim), for a commit or rebase message
" (likely a different one than last time), and when using xxd(1) to filter
" and edit binary files (it transforms input files back and forth, causing
" them to have dual nature, so to speak)
autocmd BufReadPost *
\ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit'
\ | exe "normal! g`\""
\ let line = line("'\"")
\ | if line >= 1 && line <= line("$") && &filetype !~# 'commit'
\ && index(['xxd', 'gitrebase'], &filetype) == -1
\ | execute "normal! g`\""
\ | endif
augroup END
@@ -115,11 +120,11 @@ if 1
" Quite a few people accidentally type "q:" instead of ":q" and get confused
" by the command line window. Give a hint about how to get out.
" If you don't like this you can put this in your vimrc:
" ":augroup vimHints | exe 'au!' | augroup END"
" ":autocmd! vimHints"
augroup vimHints
au!
autocmd CmdwinEnter *
\ echohl Todo |
\ echohl Todo |
\ echo gettext('You discovered the command-line window! You can close it with ":q".') |
\ echohl None
augroup END

View File

@@ -1,8 +1,9 @@
" This Vim script deletes all the menus, so that they can be redefined.
" Warning: This also deletes all menus defined by the user!
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2019 Dec 10
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last Change: 2023 Aug 10
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
aunmenu *
tlunmenu *

View File

@@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 9.0. Last change: 2023 Feb 18
*autocmd.txt* For Vim version 9.0. Last change: 2023 May 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1017,6 +1017,9 @@ OptionSet After setting an option. The pattern is
the option. Similarly |v:option_oldglobal| is
only set when |:set| or |:setglobal| was used.
This does not set |<abuf>|, you could use
|bufnr()|.
Note that when setting a |global-local| string
option with |:set|, then |v:option_old| is the
old global value. However, for all other kinds

View File

@@ -1,4 +1,4 @@
*builtin.txt* For Vim version 9.0. Last change: 2023 May 12
*builtin.txt* For Vim version 9.0. Last change: 2023 Sep 27
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -156,6 +156,7 @@ digraph_setlist({digraphlist}) Boolean register multiple |digraph|s
echoraw({expr}) none output {expr} as-is
empty({expr}) Number |TRUE| if {expr} is empty
environ() Dict return environment variables
err_teapot([{expr}]) none give E418, or E503 if {expr} is |TRUE|
escape({string}, {chars}) String escape {chars} in {string} with '\'
eval({string}) any evaluate {string} into its value
eventhandler() Number |TRUE| if inside an event handler
@@ -309,6 +310,7 @@ inputrestore() Number restore typeahead
inputsave() Number save and clear typeahead
inputsecret({prompt} [, {text}]) String like input() but hiding the text
insert({object}, {item} [, {idx}]) List insert {item} in {object} [before {idx}]
instanceof({object}, {class}) Number |TRUE| if {object} is an instance of {class}
interrupt() none interrupt script execution
invert({expr}) Number bitwise invert
isabsolutepath({path}) Number |TRUE| if {path} is an absolute path
@@ -706,13 +708,14 @@ trunc({expr}) Float truncate Float {expr}
type({expr}) Number type of value {expr}
typename({expr}) String representation of the type of {expr}
undofile({name}) String undo file name for {name}
undotree() List undo file tree
undotree([{buf}]) List undo file tree for buffer {buf}
uniq({list} [, {func} [, {dict}]])
List remove adjacent duplicates from a list
utf16idx({string}, {idx} [, {countcc} [, {charidx}]])
Number UTF-16 index of byte {idx} in {string}
values({dict}) List values in {dict}
virtcol({expr} [, {list}]) Number or List
virtcol({expr} [, {list} [, {winid}])
Number or List
screen column of cursor or mark
virtcol2col({winid}, {lnum}, {col})
Number byte index of a character on screen
@@ -1248,7 +1251,7 @@ bufload({buf}) *bufload()*
refers to an existing file then the file is read. Otherwise
the buffer will be empty. If the buffer was already loaded
then there is no change. If the buffer is not related to a
file the no file is read (e.g., when 'buftype' is "nofile").
file then no file is read (e.g., when 'buftype' is "nofile").
If there is an existing swap file for the file of the buffer,
there will be no dialog, the buffer will be loaded anyway.
The {buf} argument is used like with |bufexists()|.
@@ -1528,11 +1531,13 @@ charidx({string}, {idx} [, {countcc} [, {utf16}]])
When {utf16} is present and TRUE, {idx} is used as the UTF-16
index in the String {expr} instead of as the byte index.
Returns -1 if the arguments are invalid or if {idx} is greater
than the index of the last byte in {string}. An error is
given if the first argument is not a string, the second
argument is not a number or when the third argument is present
and is not zero or one.
Returns -1 if the arguments are invalid or if there are less
than {idx} bytes. If there are exactly {idx} bytes the length
of the string in characters is returned.
An error is given and -1 is returned if the first argument is
not a string, the second argument is not a number or when the
third argument is present and is not zero or one.
See |byteidx()| and |byteidxcomp()| for getting the byte index
from the character index and |utf16idx()| for getting the
@@ -1592,7 +1597,7 @@ clearmatches([{win}]) *clearmatches()*
Can also be used as a |method|: >
GetWin()->clearmatches()
<
col({expr} [, {winid}) *col()*
col({expr} [, {winid}]) *col()*
The result is a Number, which is the byte index of the column
position given with {expr}. The accepted positions are:
. the cursor position
@@ -1655,7 +1660,7 @@ complete({startcol}, {matches}) *complete()* *E785*
Example: >
inoremap <F5> <C-R>=ListMonths()<CR>
func! ListMonths()
func ListMonths()
call complete(col('.'), ['January', 'February', 'March',
\ 'April', 'May', 'June', 'July', 'August', 'September',
\ 'October', 'November', 'December'])
@@ -1850,7 +1855,7 @@ cosh({expr}) *cosh()*
Compute()->cosh()
count({comp}, {expr} [, {ic} [, {start}]]) *count()*
count({comp}, {expr} [, {ic} [, {start}]]) *count()* *E706*
Return the number of times an item with value {expr} appears
in |String|, |List| or |Dictionary| {comp}.
@@ -1920,7 +1925,7 @@ cursor({list})
This is like the return value of |getpos()| or |getcurpos()|,
but without the first item.
To position the cursor using the character count, use
To position the cursor using {col} as the character count, use
|setcursorcharpos()|.
Does not change the jumplist.
@@ -2199,6 +2204,15 @@ environ() *environ()*
use this: >
:echo index(keys(environ()), 'HOME', 0, 1) != -1
err_teapot([{expr}]) *err_teapot()*
Produce an error with number 418, needed for implementation of
RFC 2324.
If {expr} is present and it is TRUE error 503 is given,
indicating that coffee is temporarily not available.
If {expr} is present it must be a String.
escape({string}, {chars}) *escape()*
Escape the characters in {chars} that occur in {string} with a
backslash. Example: >
@@ -3538,6 +3552,8 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
cmdline |cmdline-completion| result
compiler compilers
cscope |:cscope| suboptions
custom,{func} custom completion, defined via {func}
customlist,{func} custom completion, defined via {func}
diff_buffer |:diffget| and |:diffput| completion
dir directory names
environment environment variable names
@@ -3990,6 +4006,9 @@ getqflist([{what}]) *getqflist()*
text description of the error
type type of the error, 'E', '1', etc.
valid |TRUE|: recognized error message
user_data
custom data associated with the item, can be
any type.
When there is no error list or it's empty, an empty list is
returned. Quickfix list entries with a non-existing buffer
@@ -5033,6 +5052,19 @@ insert({object}, {item} [, {idx}]) *insert()*
Can also be used as a |method|: >
mylist->insert(item)
<
*instanceof()* *E614* *E616* *E693*
instanceof({object}, {class})
The result is a Number, which is |TRUE| when the {object}
argument is a direct or indirect instance of a |Class|
specified by {class}.
When {class} is a |List| the function returns |TRUE| when
{object} is an instance of any of the specified classes.
Example: >
instanceof(animal, [Dog, Cat])
< Can also be used as a |method|: >
myobj->instanceof(mytype)
interrupt() *interrupt()*
Interrupt script execution. It works more or less like the
@@ -6378,6 +6410,7 @@ mode([expr]) Return a string that indicates the current mode.
Rvc Virtual Replace mode completion |compl-generic|
Rvx Virtual Replace mode |i_CTRL-X| completion
c Command-line editing
ct Command-line editing via Terminal-Job mode
cv Vim Ex mode |gQ|
ce Normal Ex mode |Q|
r Hit-enter prompt
@@ -6575,7 +6608,11 @@ printf({fmt}, {expr1} ...) *printf()*
The "%" starts a conversion specification. The following
arguments appear in sequence:
% [flags] [field-width] [.precision] type
% [pos-argument] [flags] [field-width] [.precision] type
pos-argument
At most one positional argument specifier. These
take the form {n$}, where n is >= 1.
flags
Zero or more of the following flags:
@@ -6647,6 +6684,12 @@ printf({fmt}, {expr1} ...) *printf()*
< This limits the length of the text used from "line" to
"width" bytes.
If the argument to be formatted is specified using a posional
argument specifier, and a '*' is used to indicate that a
number argument is to be used to specify the width or
precision, the argument(s) to be used must also be specified
using a {n$} positional argument specifier. See |printf-$|.
The conversion specifiers and their meanings are:
*printf-d* *printf-b* *printf-B* *printf-o*
@@ -6665,8 +6708,13 @@ printf({fmt}, {expr1} ...) *printf()*
a conversion is wider than the field width, the field
is expanded to contain the conversion result.
The 'h' modifier indicates the argument is 16 bits.
The 'l' modifier indicates the argument is 32 bits.
The 'L' modifier indicates the argument is 64 bits.
The 'l' modifier indicates the argument is a long
integer. The size will be 32 bits or 64 bits
depending on your platform.
The "ll" modifier indicates the argument is 64 bits.
The b and B conversion specifiers never take a width
modifier and always assume their argument is a 64 bit
integer.
Generally, these modifiers are not useful. They are
ignored when type is known from the argument.
@@ -6736,6 +6784,111 @@ printf({fmt}, {expr1} ...) *printf()*
of "%" items. If there are not sufficient or too many
arguments an error is given. Up to 18 arguments can be used.
*printf-$*
In certain languages, error and informative messages are
more readable when the order of words is different from the
corresponding message in English. To accommodate translations
having a different word order, positional arguments may be
used to indicate this. For instance: >
#, c-format
msgid "%s returning %s"
msgstr "waarde %2$s komt terug van %1$s"
<
In this example, the sentence has its 2 string arguments reversed
in the output. >
echo printf(
"In The Netherlands, vim's creator's name is: %1$s %2$s",
"Bram", "Moolenaar")
< In The Netherlands, vim's creator's name is: Bram Moolenaar >
echo printf(
"In Belgium, vim's creator's name is: %2$s %1$s",
"Bram", "Moolenaar")
< In Belgium, vim's creator's name is: Moolenaar Bram
Width (and precision) can be specified using the '*' specifier.
In this case, you must specify the field width position in the
argument list. >
echo printf("%1$*2$.*3$d", 1, 2, 3)
< 001 >
echo printf("%2$*3$.*1$d", 1, 2, 3)
< 2 >
echo printf("%3$*1$.*2$d", 1, 2, 3)
< 03 >
echo printf("%1$*2$.*3$g", 1.4142, 2, 3)
< 1.414
You can mix specifying the width and/or precision directly
and via positional arguments: >
echo printf("%1$4.*2$f", 1.4142135, 6)
< 1.414214 >
echo printf("%1$*2$.4f", 1.4142135, 6)
< 1.4142 >
echo printf("%1$*2$.*3$f", 1.4142135, 6, 2)
< 1.41
*E1500*
You cannot mix positional and non-positional arguments: >
echo printf("%s%1$s", "One", "Two")
< E1500: Cannot mix positional and non-positional
arguments: %s%1$s
*E1501*
You cannot skip a positional argument in a format string: >
echo printf("%3$s%1$s", "One", "Two", "Three")
< E1501: format argument 2 unused in $-style
format: %3$s%1$s
*E1502*
You can re-use a [field-width] (or [precision]) argument: >
echo printf("%1$d at width %2$d is: %01$*2$d", 1, 2)
< 1 at width 2 is: 01
However, you can't use it as a different type: >
echo printf("%1$d at width %2$ld is: %01$*2$d", 1, 2)
< E1502: Positional argument 2 used as field
width reused as different type: long int/int
*E1503*
When a positional argument is used, but not the correct number
or arguments is given, an error is raised: >
echo printf("%1$d at width %2$d is: %01$*2$.*3$d", 1, 2)
< E1503: Positional argument 3 out of bounds:
%1$d at width %2$d is: %01$*2$.*3$d
Only the first error is reported: >
echo printf("%01$*2$.*3$d %4$d", 1, 2)
< E1503: Positional argument 3 out of bounds:
%01$*2$.*3$d %4$d
*E1504*
A positional argument can be used more than once: >
echo printf("%1$s %2$s %1$s", "One", "Two")
< One Two One
However, you can't use a different type the second time: >
echo printf("%1$s %2$s %1$d", "One", "Two")
< E1504: Positional argument 1 type used
inconsistently: int/string
*E1505*
Various other errors that lead to a format string being
wrongly formatted lead to: >
echo printf("%1$d at width %2$d is: %01$*2$.3$d", 1, 2)
< E1505: Invalid format specifier:
%1$d at width %2$d is: %01$*2$.3$d
*E1507*
This internal error indicates that the logic to parse a
positional format argument ran into a problem that couldn't be
otherwise reported. Please file a bug against Vim if you run
into this, copying the exact format string and parameters that
were used.
prompt_getprompt({buf}) *prompt_getprompt()*
Returns the effective prompt text for buffer {buf}. {buf} can
@@ -8286,6 +8439,8 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()*
text description of the error
type single-character error type, 'E', 'W', etc.
valid recognized error message
user_data custom data associated with the item, can be
any type.
The "col", "vcol", "nr", "type" and "text" entries are
optional. Either "lnum" or "pattern" entry can be used to
@@ -9297,7 +9452,7 @@ strutf16len({string} [, {countcc}]) *strutf16len()*
echo strutf16len('😊') returns 2
echo strutf16len('ą́') returns 1
echo strutf16len('ą́', v:true) returns 3
<
Can also be used as a |method|: >
GetText()->strutf16len()
<
@@ -10061,9 +10216,10 @@ undofile({name}) *undofile()*
Can also be used as a |method|: >
GetFilename()->undofile()
undotree() *undotree()*
Return the current state of the undo tree in a dictionary with
the following items:
undotree([{buf}]) *undotree()*
Return the current state of the undo tree for the current
buffer, or for a specific buffer if {buf} is given. The
result is a dictionary with the following items:
"seq_last" The highest undo sequence number used.
"seq_cur" The sequence number of the current position in
the undo tree. This differs from "seq_last"
@@ -10119,14 +10275,18 @@ uniq({list} [, {func} [, {dict}]]) *uniq()* *E882*
<
*utf16idx()*
utf16idx({string}, {idx} [, {countcc} [, {charidx}]])
Same as |charidx()| but returns the UTF-16 index of the byte
at {idx} in {string} (after converting it to UTF-16).
Same as |charidx()| but returns the UTF-16 code unit index of
the byte at {idx} in {string} (after converting it to UTF-16).
When {charidx} is present and TRUE, {idx} is used as the
character index in the String {string} instead of as the byte
index.
An {idx} in the middle of a UTF-8 sequence is rounded upwards
to the end of that sequence.
An {idx} in the middle of a UTF-8 sequence is rounded
downwards to the beginning of that sequence.
Returns -1 if the arguments are invalid or if there are less
than {idx} bytes in {string}. If there are exactly {idx} bytes
the length of the string in UTF-16 code units is returned.
See |byteidx()| and |byteidxcomp()| for getting the byte index
from the UTF-16 index and |charidx()| for getting the
@@ -10153,7 +10313,7 @@ values({dict}) *values()*
Can also be used as a |method|: >
mydict->values()
virtcol({expr} [, {list}]) *virtcol()*
virtcol({expr} [, {list} [, {winid}]]) *virtcol()*
The result is a Number, which is the screen column of the file
position given with {expr}. That is, the last screen position
occupied by the character at that position, when the screen
@@ -10185,10 +10345,13 @@ virtcol({expr} [, {list}]) *virtcol()*
returns the cursor position. Differs from |'<| in
that it's updated right away.
If {list} is present and non-zero then virtcol() returns a List
with the first and last screen position occupied by the
If {list} is present and non-zero then virtcol() returns a
List with the first and last screen position occupied by the
character.
With the optional {winid} argument the values are obtained for
that window instead of the current window.
Note that only marks in the current file can be used.
Examples: >
" With text "foo^Lbar" and cursor on the "^L":
@@ -10200,7 +10363,7 @@ virtcol({expr} [, {list}]) *virtcol()*
" With text " there", with 't at 'h':
virtcol("'t") " returns 6
< The first column is 1. 0 is returned for an error.
< The first column is 1. 0 or [0, 0] is returned for an error.
A more advanced example that echoes the maximum length of
all lines: >
echo max(map(range(1, line('$')), "virtcol([v:val, '$'])"))
@@ -10217,6 +10380,9 @@ virtcol2col({winid}, {lnum}, {col}) *virtcol2col()*
{lnum}, then the byte index of the character at the last
virtual column is returned.
For a multi-byte character, the column number of the first
byte in the character is returned.
The {winid} argument can be the window number or the
|window-ID|. If this is zero, then the current window is used.
@@ -10847,6 +11013,7 @@ python_dynamic Python 2.x interface is dynamically loaded. |has-python|
python3 Python 3.x interface available. |has-python|
python3_compiled Compiled with Python 3.x interface. |has-python|
python3_dynamic Python 3.x interface is dynamically loaded. |has-python|
python3_stable Python 3.x interface is using Python Stable ABI. |has-python|
pythonx Python 2.x and/or 3.x interface available. |python_x|
qnx QNX version of Vim.
quickfix Compiled with |quickfix| support.
@@ -10924,6 +11091,8 @@ winaltkeys Compiled with 'winaltkeys' option.
windows Compiled with support for more than one window.
(always true)
writebackup Compiled with 'writebackup' default on.
xattr Compiled with extended attributes support |xattr|
(currently only supported on Linux).
xfontset Compiled with X fontset support |xfontset|.
xim Compiled with X input method support |xim|.
xpm Compiled with pixmap support.

View File

@@ -1,4 +1,4 @@
*change.txt* For Vim version 9.0. Last change: 2023 Mar 07
*change.txt* For Vim version 9.0. Last change: 2023 Sep 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -210,6 +210,7 @@ gR Enter Virtual Replace mode: Each character you type
*v_r*
{Visual}r{char} Replace all selected characters by {char}.
CTRL-C will be inserted literally.
*v_C*
{Visual}["x]C Delete the highlighted lines [into register x] and

View File

@@ -1,4 +1,4 @@
*channel.txt* For Vim version 9.0. Last change: 2022 Dec 01
*channel.txt* For Vim version 9.0. Last change: 2023 Aug 15
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -956,7 +956,7 @@ job_start({command} [, {options}]) *job_start()*
to String. This works best on Unix.
On MS-Windows, job_start() makes a GUI application hidden. If
want to show it, Use |:!start| instead.
you want to show it, use |:!start| instead.
The command is executed directly, not through a shell, the
'shell' option is not used. To use the shell: >

View File

@@ -1,4 +1,4 @@
*cmdline.txt* For Vim version 9.0. Last change: 2023 Feb 08
*cmdline.txt* For Vim version 9.0. Last change: 2023 May 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -517,16 +517,26 @@ example, to match only files that end in ".c": >
:e *.c$
This will not match a file ending in ".cpp". Without the "$" it does match.
The old value of an option can be obtained by hitting 'wildchar' just after
the '='. For example, typing 'wildchar' after ":set dir=" will insert the
current value of 'dir'. This overrules file name completion for the options
that take a file name.
If you would like using <S-Tab> for CTRL-P in an xterm, put this command in
your .cshrc: >
xmodmap -e "keysym Tab = Tab Find"
And this in your .vimrc: >
:cmap <Esc>[1~ <C-P>
< *complete-set-option*
When setting an option using |:set=|, the old value of an option can be
obtained by hitting 'wildchar' just after the '='. For example, typing
'wildchar' after ":set dir=" will insert the current value of 'dir'. This
overrules file name completion for the options that take a file name.
When using |:set=|, |:set+=|, or |:set^=|, string options that have
pre-defined names or syntax (e.g. 'diffopt', 'listchars') or are a list of
single-character flags (e.g. 'shortmess') will also present a list of possible
values for completion when using 'wildchar'.
When using |:set-=|, comma-separated options like 'diffopt' or 'backupdir'
will show each item separately. Flag list options like 'shortmess' will show
both the entire old value and the individual flags. Otherwise completion will
just fill in with the entire old value.
==============================================================================
3. Ex command-lines *cmdline-lines*
@@ -778,7 +788,7 @@ An example for subtracting (which isn't very useful): >
On this text:
1 one ~
2 two ~
3 three FOLDED~
3 three FOLDED ~
4 four FOLDED ~
5 five FOLDED ~
6 six FOLDED ~
@@ -962,9 +972,10 @@ Note: these are typed literally, they are not special keys!
write. *E495*
*:<abuf>* *<abuf>*
<abuf> When executing autocommands, is replaced with the currently
effective buffer number (for ":r file" and ":so file" it is
the current buffer, the file being read/sourced is not in a
buffer). *E496*
effective buffer number. It is not set for all events,
also see |bufnr()|. For ":r file" and ":so file" it is the
current buffer, the file being read/sourced is not in a
buffer. *E496*
*:<amatch>* *<amatch>*
<amatch> When executing autocommands, is replaced with the match for
which this autocommand was executed. *E497*

View File

@@ -1,4 +1,4 @@
*editing.txt* For Vim version 9.0. Last change: 2023 Apr 23
*editing.txt* For Vim version 9.0. Last change: 2023 Sep 27
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -385,7 +385,9 @@ as a wildcard when "[" is in the 'isfname' option. A simple way to avoid this
is to use "path\[[]abc]", this matches the file "path\[abc]".
*starstar-wildcard*
Expanding "**" is possible on Unix, Win32, macOS and a few other systems.
Expanding "**" is possible on Unix, Win32, macOS and a few other systems (but
it may depend on your 'shell' setting on Unix and macOS. It's known to work
correctly for zsh; for bash this requires at least bash version >= 4.X).
This allows searching a directory tree. This goes up to 100 directories deep.
Note there are some commands where this works slightly differently, see
|file-searching|.
@@ -1095,6 +1097,13 @@ will get the ACL info of the original file.
The ACL info is also used to check if a file is read-only (when opening the
file).
*xattr* *E1506* *E1508* *E1509*
xattr stands for Extended Attributes. It is an advanced way to save metadata
alongside the file in the filesystem. It depends on the actual filesystem
being used and Vim supports it only on a Linux system.
Vim attempts to preserve the extended attribute info when writing a file.
The backup file will get the extended attribute of the original file.
*read-only-share*
When MS-Windows shares a drive on the network it can be marked as read-only.
This means that even if the file read-only attribute is absent, and the ACL

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 9.0. Last change: 2023 Apr 24
*eval.txt* For Vim version 9.0. Last change: 2023 Jun 01
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2424,6 +2424,25 @@ v:progpath Contains the command with which Vim was invoked, in a form
".exe" is not added to v:progpath.
Read-only.
*v:python3_version* *python3-version-variable*
v:python3_version
Version of Python 3 that Vim was built against. When
Python is loaded dynamically (|python-dynamic|), this version
should exactly match the Python library up to the minor
version (e.g. 3.10.2 and 3.10.3 are compatible as the minor
version is "10", whereas 3.9.4 and 3.10.3 are not compatible).
When |python-stable-abi| is used, this will be the minimum Python
version that you can use instead. (e.g. if v:python3_version
indicates 3.9, you can use 3.9, 3.10, or anything above).
This number is encoded as a hex number following Python ABI
versioning conventions. Do the following to have a
human-readable full version in hex: >
echo printf("%08X", v:python3_version)
< You can obtain only the minor version by doing: >
echo and(v:python3_version>>16,0xff)
< Read-only.
*v:register* *register-variable*
v:register The name of the register in effect for the current normal mode
command (regardless of whether that command actually used a
@@ -3091,7 +3110,7 @@ text...
let mylist = [1, 2, 3]
lockvar 0 mylist
let mylist[0] = 77 " OK
call add(mylist, 4] " OK
call add(mylist, 4) " OK
let mylist = [7, 8, 9] " Error!
< *E743*
For unlimited depth use [!] and omit [depth].
@@ -3109,6 +3128,10 @@ text...
< You may want to make a copy of a list to avoid this.
See |deepcopy()|.
*E1391* *E1392*
Locking and unlocking object and class variables is
currently NOT supported.
:unlo[ckvar][!] [depth] {name} ... *:unlockvar* *:unlo* *E1246*
Unlock the internal variable {name}. Does the

View File

@@ -1,8 +1,6 @@
.TH EVIM 1 "16 febbraio 2002 "
.SH NOME
evim \- Vim "facile", Vim impostato in modo da poter essere usato
facilmente per modificare file, anche da chi non abbia familiarit<69>
con i comandi.
evim \- Vim "facile", impostato in modo da poter essere usato come editore non-modale
.SH SINTASSI
.br
.B evim
@@ -13,42 +11,39 @@ con i comandi.
.B evim
Inizia
.B Vim
e imposta le opzioni per farlo comportare come un editore "modeless".
State sempre usando Vim, ma come un editore "posizionati-e-clicca".
Simile all'uso di Notepad in MS-Windows.
.B evim
richiede la presenza della GUI, per avere a disposizione men<65> e barra
strumenti.
e imposta le opzioni per farlo comportare come un editore non-modale.
Si tratta sempre di Vim, ma usato nello stile "posizionati-e-clicca".
Rammenta molto l'utilizzo di Notepad in MS-Windows.
.B eVim
necessita della disponibilit<EFBFBD> della GUI, per utilizzare men<65> e barra strumenti.
.PP
Da usarsi soltanto se non si <20> in grado di lavorare con Vim nella
maniera usuale.
La modifica file sar<61> molto meno efficiente.
Va a usato soltanto se non si <20> in grado di lavorare con Vim nella maniera usuale.
L'edit dei file sar<61> molto meno efficiente.
.PP
.B eview
come sopra, ma parte in modalit<69> "Sola Lettura". Funziona come evim \-R.
come sopra, ma si parte in modalit<69> "Sola Lettura". Funziona come evim \-R.
.PP
Vedere vim(1) per dettagli riguardo a Vim, opzioni, etc.
.PP
L'opzione 'insertmode' <20> impostata per poter immettere del testo direttamente.
L'opzione 'insertmode' <20> impostata in modo da consentire l'immissione diretta di testo fin dall'inizio.
.br
Sono definite delle mappature che consentono di usare COPIA e INCOLLA con i
familiari tasti usati sotto MS-Windows.
Sono definite delle mappature che consentono di usare COPIA e INCOLLA con i familiari tasti usati sotto MS-Windows.
CTRL-X taglia testo, CTRL-C copia testo e CTRL-V incolla testo.
Usate CTRL-Q per ottenere quello che si otterrebbe con CTRL-V in Vim nativo.
Occorre usare CTRL-Q per ottenere il comportamenti di CTRL-V in Vim nativo.
.SH OPZIONI
Vedere vim(1).
.SH FILE
.TP 15
/usr/local/lib/vim/evim.vim
Lo script caricato per inizializzare eVim.
.SH NAC [NOTO ANCHE COME]
Noto Anche Come "Vim per semplici".
Quando usate evim si suppone che prendiate un fazzoletto,
facciate un nodo ad ogni angolo e ve lo mettiate in testa.
.SH AKA
[Also Known As] noto anche come "Vim per semplici".
Quando is usa evim si suppone che si prenda un fazzoletto,
si faccia un nodo ad ogni angolo e lo si metta in testa.
.SH VEDERE ANCHE
vim(1)
.SH AUTORE
Buona parte di
.B Vim
<EFBFBD> stato scritto da Bram Moolenaar, con molto aiuto da altri.
<EFBFBD> stato scritto da Bram Moolenaar, con molto aiuto da parte di altri.
Vedere il men<65> "Aiuto/Crediti".

View File

@@ -1,8 +1,6 @@
.TH EVIM 1 "16 febbraio 2002 "
.SH NOME
evim \- Vim "facile", Vim impostato in modo da poter essere usato
facilmente per modificare file, anche da chi non abbia familiarità
con i comandi.
evim \- Vim "facile", impostato in modo da poter essere usato come editore non-modale
.SH SINTASSI
.br
.B evim
@@ -13,42 +11,39 @@ con i comandi.
.B evim
Inizia
.B Vim
e imposta le opzioni per farlo comportare come un editore "modeless".
State sempre usando Vim, ma come un editore "posizionati-e-clicca".
Simile all'uso di Notepad in MS-Windows.
.B evim
richiede la presenza della GUI, per avere a disposizione menù e barra
strumenti.
e imposta le opzioni per farlo comportare come un editore non-modale.
Si tratta sempre di Vim, ma usato nello stile "posizionati-e-clicca".
Rammenta molto l'utilizzo di Notepad in MS-Windows.
.B eVim
necessita della disponibilità della GUI, per utilizzare menù e barra strumenti.
.PP
Da usarsi soltanto se non si è in grado di lavorare con Vim nella
maniera usuale.
La modifica file sarà molto meno efficiente.
Va a usato soltanto se non si è in grado di lavorare con Vim nella maniera usuale.
L'edit dei file sarà molto meno efficiente.
.PP
.B eview
come sopra, ma parte in modalità "Sola Lettura". Funziona come evim \-R.
come sopra, ma si parte in modalità "Sola Lettura". Funziona come evim \-R.
.PP
Vedere vim(1) per dettagli riguardo a Vim, opzioni, etc.
.PP
L'opzione 'insertmode' è impostata per poter immettere del testo direttamente.
L'opzione 'insertmode' è impostata in modo da consentire l'immissione diretta di testo fin dall'inizio.
.br
Sono definite delle mappature che consentono di usare COPIA e INCOLLA con i
familiari tasti usati sotto MS-Windows.
Sono definite delle mappature che consentono di usare COPIA e INCOLLA con i familiari tasti usati sotto MS-Windows.
CTRL-X taglia testo, CTRL-C copia testo e CTRL-V incolla testo.
Usate CTRL-Q per ottenere quello che si otterrebbe con CTRL-V in Vim nativo.
Occorre usare CTRL-Q per ottenere il comportamenti di CTRL-V in Vim nativo.
.SH OPZIONI
Vedere vim(1).
.SH FILE
.TP 15
/usr/local/lib/vim/evim.vim
Lo script caricato per inizializzare eVim.
.SH NAC [NOTO ANCHE COME]
Noto Anche Come "Vim per semplici".
Quando usate evim si suppone che prendiate un fazzoletto,
facciate un nodo ad ogni angolo e ve lo mettiate in testa.
.SH AKA
[Also Known As] noto anche come "Vim per semplici".
Quando is usa evim si suppone che si prenda un fazzoletto,
si faccia un nodo ad ogni angolo e lo si metta in testa.
.SH VEDERE ANCHE
vim(1)
.SH AUTORE
Buona parte di
.B Vim
è stato scritto da Bram Moolenaar, con molto aiuto da altri.
è stato scritto da Bram Moolenaar, con molto aiuto da parte di altri.
Vedere il menù "Aiuto/Crediti".

View File

@@ -1,4 +1,4 @@
*filetype.txt* For Vim version 9.0. Last change: 2023 Apr 29
*filetype.txt* For Vim version 9.0. Last change: 2023 Sep 11
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -138,34 +138,38 @@ what kind of file it is. This doesn't always work. A number of global
variables can be used to overrule the filetype used for certain extensions:
file name variable ~
*.asa g:filetype_asa |ft-aspvbs-syntax| |ft-aspperl-syntax|
*.asm g:asmsyntax |ft-asm-syntax|
*.asp g:filetype_asp |ft-aspvbs-syntax| |ft-aspperl-syntax|
*.bas g:filetype_bas |ft-basic-syntax|
*.asa g:filetype_asa |ft-aspperl-syntax|
|ft-aspvbs-syntax|
*.asm g:asmsyntax |ft-asm-syntax|
*.asp g:filetype_asp |ft-aspperl-syntax|
|ft-aspvbs-syntax|
*.bas g:filetype_bas |ft-basic-syntax|
*.cfg g:filetype_cfg
*.cls g:filetype_cls
*.csh g:filetype_csh |ft-csh-syntax|
*.csh g:filetype_csh |ft-csh-syntax|
*.dat g:filetype_dat
*.frm g:filetype_frm |ft-form-syntax|
*.fs g:filetype_fs |ft-forth-syntax|
*.i g:filetype_i |ft-progress-syntax|
*.f g:filetype_f |ft-forth-syntax|
*.frm g:filetype_frm |ft-form-syntax|
*.fs g:filetype_fs |ft-forth-syntax|
*.h g:c_syntax_for_h |ft-c-syntax|
*.i g:filetype_i |ft-progress-syntax|
*.inc g:filetype_inc
*.lsl g:filetype_lsl
*.m g:filetype_m |ft-mathematica-syntax|
*.m g:filetype_m |ft-mathematica-syntax|
*.mod g:filetype_mod
*.p g:filetype_p |ft-pascal-syntax|
*.p g:filetype_p |ft-pascal-syntax|
*.pl g:filetype_pl
*.pp g:filetype_pp |ft-pascal-syntax|
*.pp g:filetype_pp |ft-pascal-syntax|
*.prg g:filetype_prg
*.r g:filetype_r
*.sig g:filetype_sig
*.sql g:filetype_sql |ft-sql-syntax|
*.sql g:filetype_sql |ft-sql-syntax|
*.src g:filetype_src
*.sys g:filetype_sys
*.sh g:bash_is_sh |ft-sh-syntax|
*.tex g:tex_flavor |ft-tex-plugin|
*.sh g:bash_is_sh |ft-sh-syntax|
*.tex g:tex_flavor |ft-tex-plugin|
*.typ g:filetype_typ
*.w g:filetype_w |ft-cweb-syntax|
*.w g:filetype_w |ft-cweb-syntax|
For a few filetypes the global variable is used only when the filetype could
not be detected:
@@ -394,7 +398,7 @@ ways to change this:
You must create a new filetype plugin in a directory early in
'runtimepath'. For Unix, for example you could use this file: >
vim ~/.vim/ftplugin/fortran.vim
< You can set those settings and mappings that you would like to add. Note
< You can set those settings and mappings that you would like to add. Note
that the global plugin will be loaded after this, it may overrule the
settings that you do here. If this is the case, you need to use one of the
following two methods.
@@ -403,7 +407,7 @@ ways to change this:
You must put the copy in a directory early in 'runtimepath'. For Unix, for
example, you could do this: >
cp $VIMRUNTIME/ftplugin/fortran.vim ~/.vim/ftplugin/fortran.vim
< Then you can edit the copied file to your liking. Since the b:did_ftplugin
< Then you can edit the copied file to your liking. Since the b:did_ftplugin
variable will be set, the global plugin will not be loaded.
A disadvantage of this method is that when the distributed plugin gets
improved, you will have to copy and modify it again.
@@ -412,17 +416,30 @@ ways to change this:
You must create a new filetype plugin in a directory from the end of
'runtimepath'. For Unix, for example, you could use this file: >
vim ~/.vim/after/ftplugin/fortran.vim
< In this file you can change just those settings that you want to change.
< In this file you can change just those settings that you want to change.
==============================================================================
3. Docs for the default filetype plugins. *ftplugin-docs*
*plugin_exec* *g:plugin_exec*
Enable executing of external commands. This was done historically for e.g.
the perl filetype plugin (and a few others) to set the search path.
Disabled by default for security reasons: >
:let g:plugin_exec = 1
It is also possible to enable this only for certain filetypes: >
:let g:<filetype>_exec = 1
So to enable this only for ruby, set the following variable: >
:let g:ruby_exec = 1
If both, the global `plugin_exec` and the `<filetype>_exec` specific variable
are set, the filetype specific variable should have precedent.
AWK *ft-awk-plugin*
Support for features specific to GNU Awk, like @include, can be enabled by
setting: >
let g:awk_is_gawk = 1
:let g:awk_is_gawk = 1
CHANGELOG *ft-changelog-plugin*

View File

@@ -1,70 +1,72 @@
*ft_rust.txt* For Vim version 9.0. Last change: 2022 Oct 17
This is documentation for the Rust filetype plugin.
*ft_rust.txt* Filetype plugin for Rust
==============================================================================
CONTENTS *rust*
CONTENTS *rust*
1. Introduction |rust-intro|
2. Settings |rust-settings|
3. Commands |rust-commands|
4. Mappings |rust-mappings|
1. Introduction |rust-intro|
2. Settings |rust-settings|
3. Commands |rust-commands|
4. Mappings |rust-mappings|
==============================================================================
INTRODUCTION *rust-intro*
INTRODUCTION *rust-intro*
This plugin provides syntax and supporting functionality for the Rust
filetype.
filetype. It requires Vim 8 or higher for full functionality. Some commands
will not work on earlier versions.
==============================================================================
SETTINGS *rust-settings*
SETTINGS *rust-settings*
This plugin has a few variables you can define in your vimrc that change the
behavior of the plugin.
*g:rustc_path*
Some variables can be set buffer local (`:b` prefix), and the buffer local
will take precedence over the global `g:` counterpart.
*g:rustc_path*
g:rustc_path~
Set this option to the path to rustc for use in the |:RustRun| and
|:RustExpand| commands. If unset, "rustc" will be located in $PATH: >
let g:rustc_path = $HOME .. "/bin/rustc"
let g:rustc_path = $HOME."/bin/rustc"
<
*g:rustc_makeprg_no_percent*
*g:rustc_makeprg_no_percent*
g:rustc_makeprg_no_percent~
Set this option to 1 to have 'makeprg' default to "rustc" instead of
"rustc %": >
let g:rustc_makeprg_no_percent = 1
<
*g:rust_conceal*
*g:rust_conceal*
g:rust_conceal~
Set this option to turn on the basic |conceal| support: >
let g:rust_conceal = 1
<
*g:rust_conceal_mod_path*
*g:rust_conceal_mod_path*
g:rust_conceal_mod_path~
Set this option to turn on |conceal| for the path connecting token
"::": >
let g:rust_conceal_mod_path = 1
<
*g:rust_conceal_pub*
*g:rust_conceal_pub*
g:rust_conceal_pub~
Set this option to turn on |conceal| for the "pub" token: >
let g:rust_conceal_pub = 1
<
*g:rust_recommended_style*
*g:rust_recommended_style*
g:rust_recommended_style~
Set this option to enable vim indentation and textwidth settings to
conform to style conventions of the rust standard library (i.e. use 4
spaces for indents and sets 'textwidth' to 99). This option is enabled
Set this option to enable vim indentation and textwidth settings to
conform to style conventions of the rust standard library (i.e. use 4
spaces for indents and sets 'textwidth' to 99). This option is enabled
by default. To disable it: >
let g:rust_recommended_style = 0
<
*g:rust_fold*
*g:rust_fold*
g:rust_fold~
Set this option to turn on |folding|: >
let g:rust_fold = 1
@@ -76,63 +78,303 @@ g:rust_fold~
2 Braced blocks are folded. 'foldlevel' is left at the
global value (all folds are closed by default).
*g:rust_bang_comment_leader*
*g:rust_bang_comment_leader*
g:rust_bang_comment_leader~
Set this option to 1 to preserve the leader on multi-line doc comments
using the /*! syntax: >
let g:rust_bang_comment_leader = 1
<
*g:ftplugin_rust_source_path*
*g:rust_use_custom_ctags_defs*
g:rust_use_custom_ctags_defs~
Set this option to 1 if you have customized ctags definitions for Rust
and do not wish for those included with rust.vim to be used: >
let g:rust_use_custom_ctags_defs = 1
<
NOTE: rust.vim's built-in definitions are only used for the Tagbar Vim
plugin, if you have it installed, AND if Universal Ctags is not
detected. This is because Universal Ctags already has built-in
support for Rust when used with Tagbar.
Also, note that when using ctags other than Universal Ctags, it is not
automatically used when generating |tags| files that Vim can use to
navigate to definitions across different source files. Feel free to
copy `rust.vim/ctags/rust.ctags` into your own `~/.ctags` if you wish
to generate |tags| files.
*g:ftplugin_rust_source_path*
g:ftplugin_rust_source_path~
Set this option to a path that should be prepended to 'path' for Rust
source files: >
let g:ftplugin_rust_source_path = $HOME .. '/dev/rust'
let g:ftplugin_rust_source_path = $HOME.'/dev/rust'
<
*g:rustfmt_command*
*g:rustfmt_command*
g:rustfmt_command~
Set this option to the name of the 'rustfmt' executable in your $PATH. If
not specified it defaults to 'rustfmt' : >
let g:rustfmt_command = 'rustfmt'
<
*g:rustfmt_autosave*
*g:rustfmt_autosave*
g:rustfmt_autosave~
Set this option to 1 to run |:RustFmt| automatically when saving a
buffer. If not specified it defaults to 0 : >
let g:rustfmt_autosave = 0
<
*g:rustfmt_fail_silently*
There is also a buffer-local b:rustfmt_autosave that can be set for
the same purpose, and can override the global setting.
*g:rustfmt_autosave_if_config_present*
g:rustfmt_autosave_if_config_present~
Set this option to 1 to have *b:rustfmt_autosave* be set automatically
if a `rustfmt.toml` file is present in any parent directly leading to
the file being edited. If not set, default to 0: >
let g:rustfmt_autosave_if_config_present = 0
<
This is useful to have `rustfmt` only execute on save, on projects
that have `rustfmt.toml` configuration.
There is also a buffer-local b:rustfmt_autosave_if_config_present
that can be set for the same purpose, which can overrides the global
setting.
*g:rustfmt_fail_silently*
g:rustfmt_fail_silently~
Set this option to 1 to prevent 'rustfmt' from populating the
|location-list| with errors. If not specified it defaults to 0: >
let g:rustfmt_fail_silently = 0
<
*g:rustfmt_options*
*g:rustfmt_options*
g:rustfmt_options~
Set this option to a string of options to pass to 'rustfmt'. The
write-mode is already set to 'overwrite'. If not specified it
defaults to '' : >
let g:rustfmt_options = ''
<
*g:rustfmt_emit_files*
g:rustfmt_emit_files~
If not specified rust.vim tries to detect the right parameter to
pass to rustfmt based on its reported version. Otherwise, it
determines whether to run rustfmt with '--emit=files' (when 1 is
provided) instead of '--write-mode=overwrite'. >
let g:rustfmt_emit_files = 0
*g:rust_playpen_url*
*g:rust_playpen_url*
g:rust_playpen_url~
Set this option to override the URL for the playpen to use: >
Set this option to override the url for the playpen to use: >
let g:rust_playpen_url = 'https://play.rust-lang.org/'
<
*g:rust_shortener_url*
*g:rust_shortener_url*
g:rust_shortener_url~
Set this option to override the URL for the URL shortener: >
Set this option to override the url for the url shortener: >
let g:rust_shortener_url = 'https://is.gd/'
<
*g:rust_clip_command*
g:rust_clip_command~
Set this option to the command used in your OS to copy the Rust Play
url to the clipboard: >
let g:rust_clip_command = 'xclip -selection clipboard'
<
*g:cargo_makeprg_params*
g:cargo_makeprg_params~
Set this option to the string of parameters to pass to cargo. If not
specified it defaults to '$*' : >
let g:cargo_makeprg_params = 'build'
<
*g:cargo_shell_command_runner*
g:cargo_shell_command_runner~
Set this option to change how to run shell commands for cargo commands
|:Cargo|, |:Cbuild|, |:Crun|, ...
By default, |:terminal| is used to run shell command in terminal window
asynchronously. But if you prefer |:!| for running the commands, it can
be specified: >
let g:cargo_shell_command_runner = '!'
<
Integration with Syntastic *rust-syntastic*
--------------------------
This plugin automatically integrates with the Syntastic checker. There are two
checkers provided: 'rustc', and 'cargo'. The latter invokes 'Cargo' in order to
build code, and the former delivers a single edited '.rs' file as a compilation
target directly to the Rust compiler, `rustc`.
Because Cargo is almost exclusively being used for building Rust code these
days, 'cargo' is the default checker. >
let g:syntastic_rust_checkers = ['cargo']
<
If you would like to change it, you can set `g:syntastic_rust_checkers` to a
different value.
*g:rust_cargo_avoid_whole_workspace*
*b:rust_cargo_avoid_whole_workspace*
g:rust_cargo_avoid_whole_workspace~
When editing a crate that is part of a Cargo workspace, and this
option is set to 1 (the default), then 'cargo' will be executed
directly in that crate directory instead of in the workspace
directory. Setting 0 prevents this behavior - however be aware that if
you are working in large workspace, Cargo commands may take more time,
plus the Syntastic error list may include all the crates in the
workspace. >
let g:rust_cargo_avoid_whole_workspace = 0
<
*g:rust_cargo_check_all_targets*
*b:rust_cargo_check_all_targets*
g:rust_cargo_check_all_targets~
When set to 1, the `--all-targets` option will be passed to cargo when
Syntastic executes it, allowing the linting of all targets under the
package.
The default is 0.
*g:rust_cargo_check_all_features*
*b:rust_cargo_check_all_features*
g:rust_cargo_check_all_features~
When set to 1, the `--all-features` option will be passed to cargo when
Syntastic executes it, allowing the linting of all features of the
package.
The default is 0.
*g:rust_cargo_check_examples*
*b:rust_cargo_check_examples*
g:rust_cargo_check_examples~
When set to 1, the `--examples` option will be passed to cargo when
Syntastic executes it, to prevent the exclusion of examples from
linting. The examples are normally under the `examples/` directory of
the crate.
The default is 0.
*g:rust_cargo_check_tests*
*b:rust_cargo_check_tests*
g:rust_cargo_check_tests~
When set to 1, the `--tests` option will be passed to cargo when
Syntastic executes it, to prevent the exclusion of tests from linting.
The tests are normally under the `tests/` directory of the crate.
The default is 0.
*g:rust_cargo_check_benches*
*b:rust_cargo_check_benches*
g:rust_cargo_check_benches~
When set to 1, the `--benches` option will be passed to cargo when
Syntastic executes it. The benches are normally under the `benches/`
directory of the crate.
The default is 0.
Integration with auto-pairs *rust-auto-pairs*
---------------------------
This plugin automatically configures the auto-pairs plugin not to duplicate
single quotes, which are used more often for lifetime annotations than for
single character literals.
*g:rust_keep_autopairs_default*
g:rust_keep_autopairs_default~
Don't override auto-pairs default for the Rust filetype. The default
is 0.
==============================================================================
COMMANDS *rust-commands*
COMMANDS *rust-commands*
:RustRun [args] *:RustRun*
Invoking Cargo
--------------
This plug defines very simple shortcuts for invoking Cargo from with Vim.
:Cargo <args> *:Cargo*
Runs 'cargo' with the provided arguments.
:Cbuild <args> *:Cbuild*
Shortcut for 'cargo build`.
:Cclean <args> *:Cclean*
Shortcut for 'cargo clean`.
:Cdoc <args> *:Cdoc*
Shortcut for 'cargo doc`.
:Cinit <args> *:Cinit*
Shortcut for 'cargo init`.
:Crun <args> *:Crun*
Shortcut for 'cargo run`.
:Ctest <args> *:Ctest*
Shortcut for 'cargo test`.
:Cupdate <args> *:Cupdate*
Shortcut for 'cargo update`.
:Cbench <args> *:Cbench*
Shortcut for 'cargo bench`.
:Csearch <args> *:Csearch*
Shortcut for 'cargo search`.
:Cpublish <args> *:Cpublish*
Shortcut for 'cargo publish`.
:Cinstall <args> *:Cinstall*
Shortcut for 'cargo install`.
:Cruntarget <args> *:Cruntarget*
Shortcut for 'cargo run --bin' or 'cargo run --example',
depending on the currently open buffer.
Formatting
----------
:RustFmt *:RustFmt*
Runs |g:rustfmt_command| on the current buffer. If
|g:rustfmt_options| is set then those will be passed to the
executable.
If |g:rustfmt_fail_silently| is 0 (the default) then it
will populate the |location-list| with the errors from
|g:rustfmt_command|. If |g:rustfmt_fail_silently| is set to 1
then it will not populate the |location-list|.
:RustFmtRange *:RustFmtRange*
Runs |g:rustfmt_command| with selected range. See
|:RustFmt| for any other information.
Playpen integration
-------------------
:RustPlay *:RustPlay*
This command will only work if you have web-api.vim installed
(available at https://github.com/mattn/webapi-vim). It sends the
current selection, or if nothing is selected, the entirety of the
current buffer to the Rust playpen, and emits a message with the
shortened URL to the playpen.
|g:rust_playpen_url| is the base URL to the playpen, by default
"https://play.rust-lang.org/".
|g:rust_shortener_url| is the base url for the shorterner, by
default "https://is.gd/"
|g:rust_clip_command| is the command to run to copy the
playpen url to the clipboard of your system.
Evaluation of a single Rust file
--------------------------------
NOTE: These commands are useful only when working with standalone Rust files,
which is usually not the case for common Rust development. If you wish to
building Rust crates from with Vim can should use Vim's make, Syntastic, or
functionality from other plugins.
:RustRun [args] *:RustRun*
:RustRun! [rustc-args] [--] [args]
Compiles and runs the current file. If it has unsaved changes,
it will be saved first using |:update|. If the current file is
@@ -150,7 +392,7 @@ COMMANDS *rust-commands*
If |g:rustc_path| is defined, it is used as the path to rustc.
Otherwise it is assumed rustc can be found in $PATH.
:RustExpand [args] *:RustExpand*
:RustExpand [args] *:RustExpand*
:RustExpand! [TYPE] [args]
Expands the current file using --pretty and displays the
results in a new split. If the current file has unsaved
@@ -169,7 +411,7 @@ COMMANDS *rust-commands*
If |g:rustc_path| is defined, it is used as the path to rustc.
Otherwise it is assumed rustc can be found in $PATH.
:RustEmitIr [args] *:RustEmitIr*
:RustEmitIr [args] *:RustEmitIr*
Compiles the current file to LLVM IR and displays the results
in a new split. If the current file has unsaved changes, it
will be saved first using |:update|. If the current file is an
@@ -180,7 +422,7 @@ COMMANDS *rust-commands*
If |g:rustc_path| is defined, it is used as the path to rustc.
Otherwise it is assumed rustc can be found in $PATH.
:RustEmitAsm [args] *:RustEmitAsm*
:RustEmitAsm [args] *:RustEmitAsm*
Compiles the current file to assembly and displays the results
in a new split. If the current file has unsaved changes, it
will be saved first using |:update|. If the current file is an
@@ -191,49 +433,54 @@ COMMANDS *rust-commands*
If |g:rustc_path| is defined, it is used as the path to rustc.
Otherwise it is assumed rustc can be found in $PATH.
:RustPlay *:RustPlay*
This command will only work if you have web-api.vim installed
(available at https://github.com/mattn/webapi-vim). It sends the
current selection, or if nothing is selected, the entirety of the
current buffer to the Rust playpen, and emits a message with the
shortened URL to the playpen.
|g:rust_playpen_url| is the base URL to the playpen, by default
"https://play.rust-lang.org/".
Running test(s)
---------------
|g:rust_shortener_url| is the base URL for the shortener, by
default "https://is.gd/"
:[N]RustTest[!] [options] *:RustTest*
Runs a test under the cursor when the current buffer is in a
cargo project with "cargo test" command. If the command did
not find any test function under the cursor, it stops with an
error message.
:RustFmt *:RustFmt*
Runs |g:rustfmt_command| on the current buffer. If
|g:rustfmt_options| is set then those will be passed to the
executable.
When N is given, adjust the size of the new window to N lines
or columns.
If |g:rustfmt_fail_silently| is 0 (the default) then it
will populate the |location-list| with the errors from
|g:rustfmt_command|. If |g:rustfmt_fail_silently| is set to 1
then it will not populate the |location-list|.
When ! is given, runs all tests regardless of current cursor
position.
:RustFmtRange *:RustFmtRange*
Runs |g:rustfmt_command| with selected range. See
|:RustFmt| for any other information.
When [options] is given, it is passed to "cargo" command
arguments.
When the current buffer is outside cargo project, the command
runs "rustc --test" command instead of "cargo test" as
fallback. All tests are run regardless of adding ! since there
is no way to run specific test function with rustc. [options]
is passed to "rustc" command arguments in the case.
Takes optional modifiers (see |<mods>|): >
:tab RustTest
:belowright 16RustTest
:leftabove vert 80RustTest
<
rust.vim Debugging
------------------
:RustInfo *:RustInfo*
Emits debugging info of the Vim Rust plugin.
:RustInfoToClipboard *:RustInfoClipboard*
Saves debugging info of the Vim Rust plugin to the default
register.
:RustInfoToFile [filename] *:RustInfoToFile*
Saves debugging info of the Vim Rust plugin to the given file,
overwriting it.
==============================================================================
MAPPINGS *rust-mappings*
MAPPINGS *rust-mappings*
This plugin defines mappings for |[[| and |]]| to support hanging indents.
It also has a few other mappings:
*rust_<D-r>*
<D-r> Executes |:RustRun| with no arguments.
Note: This binding is only available in MacVim.
*rust_<D-R>*
<D-R> Populates the command line with |:RustRun|! using the
arguments given to the last invocation, but does not
execute it.
Note: This binding is only available in MacVim.
==============================================================================
vim:tw=78:sw=4:ts=8:noet:ft=help:norl:
vim:tw=78:sw=4:noet:ts=8:ft=help:norl:

View File

@@ -297,5 +297,11 @@ instead of DYNAMIC_PERL_DLL file what was specified at compile time. The
version of the shared library must match the Perl version Vim was compiled
with.
Note: If you are building Perl locally, you have to use a version compiled
with threading support for it for Vim to successfully link against it. You can
use the `-Dusethreads` flags when configuring Perl, and check that a Perl
binary has it enabled by running `perl -V` and verify that `USE_ITHREADS` is
under "Compile-time options".
==============================================================================
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@@ -769,7 +769,19 @@ Unix ~
The 'pythondll' or 'pythonthreedll' option can be used to specify the Python
shared library file instead of DYNAMIC_PYTHON_DLL or DYNAMIC_PYTHON3_DLL file
what were specified at compile time. The version of the shared library must
match the Python 2.x or Python 3 version Vim was compiled with.
match the Python 2.x or Python 3 version (|v:python3_version|) Vim was
compiled with unless using |python3-stable-abi|.
Stable ABI and mixing Python versions ~
*python-stable* *python-stable-abi* *python3-stable-abi*
If Vim was not compiled with Stable ABI (only available for Python 3), the
version of the Python shared library must match the version that Vim was
compiled with. Otherwise, mixing versions could result in unexpected crashes
and failures. With Stable ABI, this restriction is relaxed, and any Python 3
library with version of at least |v:python3_version| will work. See
|has-python| for how to check if Stable ABI is supported, or see if version
output includes |+python3/dyn-stable|.
==============================================================================
10. Python 3 *python3*
@@ -881,6 +893,18 @@ python support: >
endif
endif
When loading the library dynamically, Vim can be compiled to support Python 3
Stable ABI (|python3-stable-abi|) which allows you to load a different version
of Python 3 library than the one Vim was compiled with. To check it: >
if has('python3_dynamic')
if has('python3_stable')
echo 'support Python 3 Stable ABI.'
else
echo 'does not support Python 3 Stable ABI.'
echo 'only use Python 3 version ' .. v:python3_version
endif
endif
This also tells you whether Python is dynamically loaded, which will fail if
the runtime library cannot be found.

View File

@@ -127,7 +127,11 @@ CTRL-R {register} *i_CTRL-R*
'/' the last search pattern
':' the last command-line
'.' the last inserted text
*i_CTRL-R_-*
'-' the last small (less than a line) delete
register. This is repeatable using |.| since
it remembers the register to put instead of
the literal text to insert.
*i_CTRL-R_=*
'=' the expression register: you are prompted to
enter an expression (see |expression|)

View File

@@ -1,4 +1,4 @@
*intro.txt* For Vim version 9.0. Last change: 2022 Nov 20
*intro.txt* For Vim version 9.0. Last change: 2023 Aug 15
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -129,8 +129,9 @@ There are three ways to report bugs:
3. Send bug reports to: Vim Developers <vim-dev@vim.org>
This is a maillist, you need to become a member first and many people will
see the message. If you don't want that, e.g. because it is a security
issue, send it to <bugs@vim.org>, this only goes to the Vim maintainer
(that's Bram).
issue, please contact any of the current Vim maintainers
https://github.com/orgs/vim/people (but not Bram or the vim-dev ML).
In the future, a proper process for handling security issues will be setup.
Please be brief; all the time that is spent on answering mail is subtracted
from the time that is spent on improving Vim! Always give a reproducible
@@ -181,9 +182,9 @@ The user may create scripts for Vim that use external commands. These might
introduce Y2K problems, but those are not really part of Vim itself.
==============================================================================
3. Credits *credits* *author* *Bram* *Moolenaar*
3. Credits *credits* *author*
Most of Vim was created by Bram Moolenaar <Bram@vim.org>.
Most of Vim was created by Bram Moolenaar <Bram@vim.org> |Bram-Moolenaar|
Parts of the documentation come from several Vi manuals, written by:
W.N. Joy
@@ -214,9 +215,9 @@ Vim would never have become what it is now, without the help of these people!
Eric Fischer Mac port, 'cindent', and other improvements
Benji Fisher Answering lots of user questions
Bill Foster Athena GUI port (later removed)
Google Lets me work on Vim one day a week
Google Let Bram work on Vim one day a week
Loic Grenie xvim (ideas for multi windows version)
Sven Guckes Vim promoter and previous WWW page maintainer
Sven Guckes Vim promoter and previous WWW page maintainer |Sven-Guckes|
Darren Hiebert Exuberant ctags
Jason Hildebrand GTK+ 2 port
Bruce Hunsaker improvements for VMS port

View File

@@ -1,4 +1,4 @@
*map.txt* For Vim version 9.0. Last change: 2023 May 12
*map.txt* For Vim version 9.0. Last change: 2023 May 28
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -400,7 +400,7 @@ Note:
- The command is not echo'ed, no need for <silent>.
- The {rhs} is not subject to abbreviations nor to other mappings, even if the
mapping is recursive.
- In Visual mode you can use `line('v')` and `col('v')` to get one end of the
- In Visual mode you can use `line('v')` and `col('v')` to get one end of the
Visual area, the cursor is at the other end.
*E1255* *E1136*

View File

@@ -1,4 +1,4 @@
*message.txt* For Vim version 9.0. Last change: 2022 Oct 18
*message.txt* For Vim version 9.0. Last change: 2023 May 24
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -76,9 +76,9 @@ See `:messages` above.
LIST OF MESSAGES
*E222* *E228* *E232* *E293* *E298* *E304* *E317*
*E318* *E356* *E438* *E439* *E440* *E316* *E320* *E322*
*E323* *E341* *E473* *E570* *E685* *E292*
*E222* *E228* *E232* *E292* *E293* *E298* *E304* *E316*
*E317* *E318* *E320* *E322* *E323* *E341* *E356* *E438*
*E439* *E440* *E473* *E570*
Add to read buffer ~
makemap: Illegal mode ~
Cannot create BalloonEval with both message and callback ~
@@ -99,9 +99,9 @@ LIST OF MESSAGES
Internal error in regexp ~
fatal error in cs_manage_matches ~
Invalid count for del_bytes(): {N} ~
*E340* *E685* *internal-error*
This is an internal error. If you can reproduce it, please send in a bug
report. |bugs|
report, see |bugs|.
ATTENTION ~

View File

@@ -1,4 +1,4 @@
*motion.txt* For Vim version 9.0. Last change: 2022 Sep 26
*motion.txt* For Vim version 9.0. Last change: 2023 Sep 28
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -242,8 +242,8 @@ gM Like "g0", but to halfway the text of the line.
Thus "10gM" is near the start of the text and "90gM"
is near the end of the text.
*g$* *g<End>*
g$ or g<End> When lines wrap ('wrap' on): To the last character of
*g$*
g$ When lines wrap ('wrap' on): To the last character of
the screen line and [count - 1] screen lines downward
|inclusive|. Differs from "$" when a line is wider
than the screen.
@@ -256,6 +256,10 @@ g$ or g<End> When lines wrap ('wrap' on): To the last character of
When 'virtualedit' is enabled moves to the end of the
screen line.
*g<End>* *g<kEnd>*
g<End> Like |g$| but to the last non-blank character
instead of the last character.
*bar*
| To screen column [count] in the current line.
|exclusive| motion. Ceci n'est pas une pipe.
@@ -588,14 +592,16 @@ a] *v_a]* *v_a[* *a]* *a[*
a[ "a [] block", select [count] '[' ']' blocks. This
goes backwards to the [count] unclosed '[', and finds
the matching ']'. The enclosed text is selected,
including the '[' and ']'.
including the '[' and ']'. The |cpo-M| option flag
is used to handle escaped brackets.
When used in Visual mode it is made characterwise.
i] *v_i]* *v_i[* *i]* *i[*
i[ "inner [] block", select [count] '[' ']' blocks. This
goes backwards to the [count] unclosed '[', and finds
the matching ']'. The enclosed text is selected,
excluding the '[' and ']'.
excluding the '[' and ']'. The |cpo-M| option flag
is used to handle escaped brackets.
When used in Visual mode it is made characterwise.
a) *v_a)* *a)* *a(*
@@ -603,7 +609,8 @@ a( *vab* *v_ab* *v_a(* *ab*
ab "a block", select [count] blocks, from "[count] [(" to
the matching ')', including the '(' and ')' (see
|[(|). Does not include white space outside of the
parenthesis.
parenthesis. The |cpo-M| option flag is used to
handle escaped parenthesis.
When used in Visual mode it is made characterwise.
i) *v_i)* *i)* *i(*
@@ -611,19 +618,22 @@ i( *vib* *v_ib* *v_i(* *ib*
ib "inner block", select [count] blocks, from "[count] [("
to the matching ')', excluding the '(' and ')' (see
|[(|). If the cursor is not inside a () block, then
find the next "(".
find the next "(". The |cpo-M| option flag
is used to handle escaped parenthesis.
When used in Visual mode it is made characterwise.
a> *v_a>* *v_a<* *a>* *a<*
a< "a <> block", select [count] <> blocks, from the
[count]'th unmatched '<' backwards to the matching
'>', including the '<' and '>'.
'>', including the '<' and '>'. The |cpo-M| option flag
is used to handle escaped '<' and '>'.
When used in Visual mode it is made characterwise.
i> *v_i>* *v_i<* *i>* *i<*
i< "inner <> block", select [count] <> blocks, from
the [count]'th unmatched '<' backwards to the matching
'>', excluding the '<' and '>'.
'>', excluding the '<' and '>'. The |cpo-M| option flag
is used to handle escaped '<' and '>'.
When used in Visual mode it is made characterwise.
*v_at* *at*
@@ -645,14 +655,16 @@ a} *v_a}* *a}* *a{*
a{ *v_aB* *v_a{* *aB*
aB "a Block", select [count] Blocks, from "[count] [{" to
the matching '}', including the '{' and '}' (see
|[{|).
|[{|). The |cpo-M| option flag is used to handle
escaped braces.
When used in Visual mode it is made characterwise.
i} *v_i}* *i}* *i{*
i{ *v_iB* *v_i{* *iB*
iB "inner Block", select [count] Blocks, from "[count] [{"
to the matching '}', excluding the '{' and '}' (see
|[{|).
|[{|). The |cpo-M| option flag is used to handle
escaped braces.
When used in Visual mode it is made characterwise.
a" *v_aquote* *aquote*
@@ -679,6 +691,7 @@ i` *v_i`* *i`*
Special case: With a count of 2 the quotes are
included, but no extra white space as with a"/a'/a`.
*o_object-select*
When used after an operator:
For non-block objects:
For the "a" commands: The operator applies to the object and the white
@@ -694,6 +707,7 @@ For a block object:
the surrounding braces are excluded. For the "a" commands, the braces
are included.
*v_object-select*
When used in Visual mode:
When start and end of the Visual area are the same (just after typing "v"):
One object is selected, the same as for using an operator.
@@ -1065,14 +1079,14 @@ can go to cursor positions before older jumps, and back again. Thus you can
move up and down the list. There is a separate jump list for each window.
The maximum number of entries is fixed at 100.
For example, after three jump commands you have this jump list:
jump line col file/text ~
3 1 0 some text ~
2 70 0 another line ~
1 1154 23 end. ~
> ~
For example, after three jump commands you have this jump list: >
jump line col file/text
3 1 0 some text
2 70 0 another line
1 1154 23 end.
>
<
The "file/text" column shows the file name, or the text at the jump if it is
in the current file (an indent is removed and a long line is truncated to fit
in the window).
@@ -1081,14 +1095,14 @@ The marker ">" indicates the current position in the jumplist. It may not be
shown when filtering the |:jumps| command using |:filter|
You are currently in line 1167. If you then use the CTRL-O command, the
cursor is put in line 1154. This results in:
jump line col file/text ~
2 1 0 some text ~
1 70 0 another line ~
> 0 1154 23 end. ~
1 1167 0 foo bar ~
cursor is put in line 1154. This results in: >
jump line col file/text
2 1 0 some text
1 70 0 another line
> 0 1154 23 end.
1 1167 0 foo bar
<
The pointer will be set at the last used jump position. The next CTRL-O
command will use the entry above it, the next CTRL-I command will use the
entry below it. If the pointer is below the last entry, this indicates that
@@ -1112,15 +1126,15 @@ command. You can explicitly add a jump by setting the ' mark with "m'". Note
that calling setpos() does not do this.
After the CTRL-O command that got you into line 1154 you could give another
jump command (e.g., "G"). The jump list would then become:
jump line col file/text ~
4 1 0 some text ~
3 70 0 another line ~
2 1167 0 foo bar ~
1 1154 23 end. ~
> ~
jump command (e.g., "G"). The jump list would then become: >
jump line col file/text
4 1 0 some text
3 70 0 another line
2 1167 0 foo bar
1 1154 23 end.
>
<
The line numbers will be adjusted for deleted and inserted lines. This fails
if you stop editing a file without writing, like with ":n!".
@@ -1129,7 +1143,45 @@ When you split a window, the jumplist will be copied to the new window.
If you have included the ' item in the 'viminfo' option the jumplist will be
stored in the viminfo file and restored when starting Vim.
*jumplist-stack*
When 'jumpoptions' option includes "stack", the jumplist behaves like the tag
stack. When jumping to a new location from the middle of the jumplist, the
locations after the current position will be discarded. With this option set
you can move through a tree of jump locations. When going back up a branch and
then down another branch, CTRL-O still takes you further up the tree.
Given a jumplist like the following in which CTRL-O has been used to move back
three times to location X: >
jump line col file/text
2 1260 8 mark.c <-- location X-2
1 685 0 eval.c <-- location X-1
> 0 462 36 eval.c <-- location X
1 479 39 eval.c
2 213 2 mark.c
3 181 0 mark.c
<
jumping to (new) location Y results in the locations after the current
locations being removed: >
jump line col file/text
3 1260 8 mark.c <-- location X-2
2 685 0 eval.c <-- location X-1
1 462 36 eval.c <-- location X
>
<
Then, when yet another location Z is jumped to, the new location Y appears
directly after location X in the jumplist and location X remains in the same
position relative to the locations (X-1, X-2, etc., ...) that had been before
it prior to the original jump from X to Y: >
jump line col file/text
4 1260 8 mark.c <-- location X-2
3 685 0 eval.c <-- location X-1
2 462 36 eval.c <-- location X
1 100 0 buffer.c <-- location Y
>
<
CHANGE LIST JUMPS *changelist* *change-list-jumps* *E664*
When making a change the cursor position is remembered. One position is

View File

@@ -1,4 +1,4 @@
*options.txt* For Vim version 9.0. Last change: 2023 May 04
*options.txt* For Vim version 9.0. Last change: 2023 Aug 15
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -71,7 +71,7 @@ achieve special effects. These options come in three forms:
'ttytype'
Warning: This may have a lot of side effects.
*:set-args* *E487* *E521*
*:set-args* *:set=* *E487* *E521*
:se[t] {option}={value} or
:se[t] {option}:{value}
Set string or number option to {value}.
@@ -79,7 +79,9 @@ achieve special effects. These options come in three forms:
hex (preceded with 0x) or octal (preceded with '0').
The old value can be inserted by typing 'wildchar' (by
default this is a <Tab> or CTRL-E if 'compatible' is
set). See |cmdline-completion|.
set). Many string options with fixed syntax and names
also support completing known values. See
|cmdline-completion| and |complete-set-option|.
White space between {option} and '=' is allowed and
will be ignored. White space between '=' and {value}
is not allowed.
@@ -113,6 +115,9 @@ achieve special effects. These options come in three forms:
When the option is a list of flags, {value} must be
exactly as they appear in the option. Remove flags
one by one to avoid problems.
The individual values from a comma separated list or
list of flags can be inserted by typing 'wildchar'.
See |complete-set-option|.
Also see |:set-args| above.
The {option} arguments to ":set" may be repeated. For example: >
@@ -187,10 +192,27 @@ To include white space in a string option value it has to be preceded with a
backslash. To include a backslash you have to use two. Effectively this
means that the number of backslashes in an option value is halved (rounded
down).
In options 'path', 'cdpath', and 'tags', spaces have to be preceded with three
backslashes instead for compatibility with version 3.0 where the options can
be separated by either commas or spaces.
Comma-separated options like 'backupdir' and 'tags' will also require commas
to be escaped with two backslashes, whereas this is not needed for
non-comma-separated ones like 'makeprg'.
When setting options using |:let| and |literal-string|, you need to use one
fewer layer of backslash.
A few examples: >
:set tags=tags\ /usr/tags results in "tags /usr/tags"
:set tags=tags\\,file results in "tags\,file"
:set tags=tags\\\ file results in "tags\ file"
:set makeprg=make\ file results in "make file"
:let &makeprg='make file' (same as above)
:set makeprg=make\\\ file results in "make\ file"
:set tags=tags\ /usr/tags results in "tags" and "/usr/tags"
:set tags=tags\\\ file results in "tags file"
:let &tags='tags\ file' (same as above)
:set makeprg=make,file results in "make,file"
:set makeprg=make\\,file results in "make\,file"
:set tags=tags,file results in "tags" and "file"
:set tags=tags\\,file results in "tags,file"
:let &tags='tags\,file' (same as above)
The "|" character separates a ":set" command from a following command. To
include the "|" in the option value, use "\|" instead. This example sets the
@@ -252,6 +274,8 @@ opt+=val" the expansion is done before the adding or removing.
Handling of local options *local-options*
Note: The following also applies to |global-local| options.
Some of the options only apply to a window or buffer. Each window or buffer
has its own copy of this option, thus each can have its own value. This
allows you to set 'list' in one window but not in another. And set
@@ -301,6 +325,30 @@ The options local to a window are remembered for each buffer. This also
happens when the buffer is not loaded, but they are lost when the buffer is
wiped out |:bwipe|.
Special local window options *local-noglobal*
The following local window options won't be copied over when new windows are
created, thus they behave slightly differently:
Option Reason ~
'previewwindow' there can only be a single one
'scroll' specific to existing window
'winfixheight' specific to existing window
'winfixwidth' specific to existing window
Special local buffer options
The following local buffer options won't be copied over when new buffers are
created, thus they behave slightly differently:
Option Reason ~
'filetype' explicitly set by autocommands
'syntax' explicitly set by autocommands
'bufhidden' denote |special-buffers|
'buftype' denote |special-buffers|
'readonly' will be detected automatically
'modified' will be detected automatically
*:setl* *:setlocal*
:setl[ocal][!] ... Like ":set" but set only the value local to the
current buffer or window. Not all options have a
@@ -374,7 +422,6 @@ used. Thus it does the same as: >
Note: In the future more global options can be made |global-local|. Using
":setlocal" on a global option might work differently then.
*option-value-function*
Some options ('completefunc', 'imactivatefunc', 'imstatusfunc', 'omnifunc',
'operatorfunc', 'quickfixtextfunc', 'tagfunc' and 'thesaurusfunc') are set to
@@ -405,7 +452,7 @@ Set using a variable with lambda expression: >
let &tagfunc = L
In Vim9 script, in a compiled function, you can use a lambda, but a
closured does not work, because the function will be called without the
closure does not work, because the function will be called without the
context of where it was defined.
@@ -1449,7 +1496,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'bufhidden'* *'bh'*
'bufhidden' 'bh' string (default: "")
local to buffer
local to buffer |local-noglobal|
This option specifies what happens when a buffer is no longer
displayed in a window:
<empty> follow the global 'hidden' option
@@ -1481,7 +1528,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'buftype'* *'bt'* *E382*
'buftype' 'bt' string (default: "")
local to buffer
local to buffer |local-noglobal|
The value of this option specifies the type of a buffer:
<empty> normal buffer
nofile buffer which is not related to a file and will not be
@@ -1813,7 +1860,7 @@ A jump table for the options with a short description can be found at |Q_op|.
The screen column can be an absolute number, or a number preceded with
'+' or '-', which is added to or subtracted from 'textwidth'. >
:set cc=+1 " highlight column after 'textwidth'
:set cc=+1 " highlight column after 'textwidth'
:set cc=+1,+2,+3 " highlight three columns after 'textwidth'
:hi ColorColumn ctermbg=lightgrey guibg=lightgrey
<
@@ -2809,7 +2856,8 @@ A jump table for the options with a short description can be found at |Q_op|.
When omitted a context of six lines is used.
When using zero the context is actually one,
since folds require a line in between, also
for a deleted line.
for a deleted line. Set it to a very large
value (999999) to disable folding completely.
See |fold-diff|.
iblank Ignore changes where lines are all blank. Adds
@@ -3408,7 +3456,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'filetype'* *'ft'*
'filetype' 'ft' string (default: "")
local to buffer
local to buffer |local-noglobal|
When this option is set, the FileType autocommand event is triggered.
All autocommands that match with the value of this option will be
executed. Thus the value of 'filetype' is used in place of the file
@@ -4874,6 +4922,16 @@ A jump table for the options with a short description can be found at |Q_op|.
Otherwise only one space is inserted.
NOTE: This option is set when 'compatible' is set.
*'jumpoptions'* *'jop'*
'jumpoptions' 'jop' string (default "")
global
List of words that change the behavior of the |jumplist|.
stack Make the jumplist behave like the tagstack.
Relative location of entries in the jumplist is
preserved at the cost of discarding subsequent entries
when navigating backwards in the jumplist and then
jumping to a location. |jumplist-stack|
*'key'*
'key' string (default "")
local to buffer
@@ -4888,6 +4946,8 @@ A jump table for the options with a short description can be found at |Q_op|.
"echo &key". This is to avoid showing it to someone who shouldn't
know. It also means you cannot see it yourself once you have set it,
be careful not to make a typing error!
You also cannot use |:set-=|, |:set+=|, |:set^=| on this option to
prevent an attacker from guessing substrings in your key.
You can use "&key" in an expression to detect whether encryption is
enabled. When 'key' is set it returns "*****" (five stars).
@@ -5565,7 +5625,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'modified'* *'mod'* *'nomodified'* *'nomod'*
'modified' 'mod' boolean (default off)
local to buffer
local to buffer |local-noglobal|
When on, the buffer is considered to be modified. This option is set
when:
1. A change was made to the text since it was last written. Using the
@@ -6136,7 +6196,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'previewwindow'* *'nopreviewwindow'*
*'pvw'* *'nopvw'* *E590*
'previewwindow' 'pvw' boolean (default off)
local to window
local to window |local-noglobal|
{not available when compiled without the |+quickfix|
feature}
Identifies the preview window. Only one window can have this option
@@ -6331,7 +6391,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'readonly'* *'ro'* *'noreadonly'* *'noro'*
'readonly' 'ro' boolean (default off)
local to buffer
local to buffer |local-noglobal|
If on, writes fail unless you use a '!'. Protects you from
accidentally overwriting a file. Default on when Vim is started
in read-only mode ("vim -R") or when the executable is called "view".
@@ -6710,7 +6770,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'scroll'* *'scr'*
'scroll' 'scr' number (default: half the window height)
local to window
local to window |local-noglobal|
Number of lines to scroll with CTRL-U and CTRL-D commands. Will be
set to half the number of lines in the window when the window size
changes. This may happen when enabling the |status-line| or
@@ -6722,9 +6782,9 @@ A jump table for the options with a short description can be found at |Q_op|.
*'scrollbind'* *'scb'* *'noscrollbind'* *'noscb'*
'scrollbind' 'scb' boolean (default off)
local to window
See also |scroll-binding|. When this option is set, the current
window scrolls as other scrollbind windows (windows that also have
this option set) scroll. This option is useful for viewing the
See also |scroll-binding|. When this option is set, scrolling the
current window also scrolls other scrollbind windows (windows that
also have this option set). This option is useful for viewing the
differences between two versions of a file, see 'diff'.
See |'scrollopt'| for options that determine how this option should be
interpreted.
@@ -7135,7 +7195,7 @@ A jump table for the options with a short description can be found at |Q_op|.
local to buffer
Number of spaces to use for each step of (auto)indent. Used for
|'cindent'|, |>>|, |<<|, etc.
When zero the 'ts' value will be used. Use the |shiftwidth()|
When zero the 'tabstop' value will be used. Use the |shiftwidth()|
function to get the effective shiftwidth value.
*'shortmess'* *'shm'*
@@ -7434,6 +7494,8 @@ A jump table for the options with a short description can be found at |Q_op|.
line in the window wraps part of it may not be visible, as if it is
above the window. "<<<" is displayed at the start of the first line,
highlighted with |hl-NonText|.
You may also want to add "lastline" to the 'display' option to show as
much of the last line as possible.
NOTE: only partly implemented, currently works with CTRL-E, CTRL-Y
and scrolling with the mouse.
@@ -7970,7 +8032,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'syntax'* *'syn'*
'syntax' 'syn' string (default empty)
local to buffer
local to buffer |local-noglobal|
{not available when compiled without the |+syntax|
feature}
When this option is set, the syntax with this name is loaded, unless
@@ -8044,13 +8106,25 @@ A jump table for the options with a short description can be found at |Q_op|.
(or 3 or whatever you prefer) and use 'noexpandtab'. Then Vim
will use a mix of tabs and spaces, but typing <Tab> and <BS> will
behave like a tab appears every 4 (or 3) characters.
2. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use
This is the recommended way, the file will look the same with other
tools and when listing it in a terminal.
2. Set 'softtabstop' and 'shiftwidth' to whatever you prefer and use
'expandtab'. This way you will always insert spaces. The
formatting will never be messed up when 'tabstop' is changed (leave
it at 8 just in case). The file will be a bit larger.
You do need to check if no Tabs exist in the file. You can get rid
of them by first setting 'expandtab' and using `%retab!`, making
sure the value of 'tabstop' is set correctly.
3. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use
'expandtab'. This way you will always insert spaces. The
formatting will never be messed up when 'tabstop' is changed.
3. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use a
You do need to check if no Tabs exist in the file, just like in the
item just above.
4. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use a
|modeline| to set these values when editing the file again. Only
works when using Vim to edit the file.
4. Always set 'tabstop' and 'shiftwidth' to the same value, and
works when using Vim to edit the file, other tools assume a tabstop
is worth 8 spaces.
5. Always set 'tabstop' and 'shiftwidth' to the same value, and
'noexpandtab'. This should then work (for initial indents only)
for any tabstop setting that people use. It might be nice to have
tabs after the first non-blank inserted as spaces if you do this
@@ -8156,8 +8230,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|+emacs_tags|: "./tags,./TAGS,tags,TAGS")
global or local to buffer |global-local|
Filenames for the tag command, separated by spaces or commas. To
include a space or comma in a file name, precede it with a backslash
(see |option-backslash| about including spaces and backslashes).
include a space or comma in a file name, precede it with backslashes
(see |option-backslash| about including spaces/commas and backslashes).
When a file name starts with "./", the '.' is replaced with the path
of the current file. But only when the 'd' flag is not included in
'cpoptions'. Environment variables are expanded |:set_env|. Also see
@@ -8898,11 +8972,11 @@ A jump table for the options with a short description can be found at |Q_op|.
displayed when 'verbosefile' is set.
*'viewdir'* *'vdir'*
'viewdir' 'vdir' string (default for Amiga and Win32:
"$VIM/vimfiles/view",
for Unix: "~/.vim/view",
for macOS: "$VIM:vimfiles:view"
for VMS: "sys$login:vimfiles/view")
'viewdir' 'vdir' string (default for Amiga "home:vimfiles/view",
for Win32: "$HOME/vimfiles/view",
for Unix: "$HOME/.vim/view",
for macOS: "$VIM/vimfiles/view"
for VMS: "sys$login:vimfiles/view")
global
{not available when compiled without the |+mksession|
feature}
@@ -9406,7 +9480,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'winfixheight'* *'wfh'* *'nowinfixheight'* *'nowfh'*
'winfixheight' 'wfh' boolean (default off)
local to window
local to window |local-noglobal|
Keep the window height when windows are opened or closed and
'equalalways' is set. Also for |CTRL-W_=|. Set by default for the
|preview-window| and |quickfix-window|.
@@ -9414,7 +9488,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'winfixwidth'* *'wfw'* *'nowinfixwidth'* *'nowfw'*
'winfixwidth' 'wfw' boolean (default off)
local to window
local to window |local-noglobal|
Keep the window width when windows are opened or closed and
'equalalways' is set. Also for |CTRL-W_=|.
The width may be changed anyway when running out of room.

View File

@@ -1080,7 +1080,7 @@ match ASCII characters, as indicated by the range.
\(\) A pattern enclosed by escaped parentheses. */\(* */\(\)* */\)*
E.g., "\(^a\)" matches 'a' at the start of a line.
There can only be ten of these. You can use "\%(" to add more, but
There can only be nine of these. You can use "\%(" to add more, but
not counting it as a sub-expression.
*E51* *E54* *E55* *E872* *E873*

View File

@@ -772,6 +772,7 @@ Short explanation of each option: *option-list*
'iskeyword' 'isk' characters included in keywords
'isprint' 'isp' printable characters
'joinspaces' 'js' two spaces after a period with a join command
'jumpoptions' 'jop' specifies how jumping is done
'key' encryption key
'keymap' 'kmp' name of a keyboard mapping
'keymodel' 'km' enable starting/stopping selection with keys

View File

@@ -1,4 +1,4 @@
*repeat.txt* For Vim version 9.0. Last change: 2023 May 01
*repeat.txt* For Vim version 9.0. Last change: 2023 May 26
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -308,8 +308,8 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
'runtimepath'.
If the filetype detection was not enabled yet (this
is usually done with a "syntax enable" or "filetype
on" command in your .vimrc file), this will also look
is usually done with a `syntax enable` or `filetype on`
command in your .vimrc file), this will also look
for "{name}/ftdetect/*.vim" files.
When the optional ! is added no plugin files or
@@ -1149,8 +1149,8 @@ Profiling should give a good indication of where time is spent, but keep in
mind there are various things that may clobber the results:
- The accuracy of the time measured depends on the gettimeofday(), or
clock_gettime if available, system function. The accuracy ranges from 1/100
second to nanoseconds. With clock_gettime the times are displayed in
clock_gettime() if available, system function. The accuracy ranges from
1/100 second to nanoseconds. With clock_gettime() the times are displayed in
nanoseconds, otherwise microseconds. You can use `has("prof_nsec")`.
- Real elapsed time is measured, if other processes are busy they may cause

View File

@@ -191,16 +191,16 @@ windows can be given this behavior by setting the (window-specific)
other 'scrollbind' windows are scrolled the same amount, if possible. The
behavior of 'scrollbind' can be modified by the 'scrollopt' option.
When using the scrollbars, the binding only happens when scrolling the window
with focus (where the cursor is). You can use this to avoid scroll-binding
for a moment without resetting options.
When using the scrollbars or the mouse wheel, the binding only happens when
scrolling the window with focus (where the cursor is). You can use this to
avoid scroll-binding for a moment without resetting options.
When a window also has the 'diff' option set, the scroll-binding uses the
differences between the two buffers to synchronize the position precisely.
Otherwise the following method is used.
*scrollbind-relative*
Each 'scrollbind' window keeps track of its "relative offset," which can be
Each 'scrollbind' window keeps track of its "relative offset", which can be
thought of as the difference between the current window's vertical scroll
position and the other window's vertical scroll position. When one of the
'scrollbind' windows is asked to vertically scroll past the beginning or end
@@ -224,9 +224,10 @@ option.
*scrollbind-quickadj*
The 'scrollbind' flag is meaningful when using keyboard commands to vertically
scroll a window, and also meaningful when using the vertical scrollbar of the
window which has the cursor focus. However, when using the vertical scrollbar
of a window which doesn't have the cursor focus, 'scrollbind' is ignored.
scroll a window, and is also meaningful when using the vertical scrollbar or
the mouse wheel in the window which has the cursor focus. However, when using
the vertical scrollbar or the mouse wheel in a window which doesn't have the
cursor focus, 'scrollbind' is ignored.
This allows quick adjustment of the relative offset of 'scrollbind' windows.
==============================================================================

View File

@@ -1,4 +1,4 @@
*spell.txt* For Vim version 9.0. Last change: 2023 Apr 21
*spell.txt* For Vim version 9.0. Last change: 2023 May 25
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -122,7 +122,7 @@ zuG Undo |zW| and |zG|, remove the word from the internal
list, like with |zW|.
*:spellra* *:spellrare*
:[count]spellr[are] {word}
:[count]spellra[re] {word}
Add {word} as a rare word to 'spellfile', similar to
|zw|. Without count the first name is used, with
a count of two the second entry, etc.
@@ -135,7 +135,7 @@ zuG Undo |zW| and |zG|, remove the word from the internal
nnoremap z/ :exe ':spellrare! ' .. expand('<cWORD>')<CR>
< |:spellundo|, |zuw|, or |zuW| can be used to undo this.
:spellr[rare]! {word} Add {word} as a rare word to the internal word
:spellra[re]! {word} Add {word} as a rare word to the internal word
list, similar to |zW|.
:[count]spellu[ndo] {word} *:spellu* *:spellundo*

View File

@@ -1,4 +1,4 @@
*starting.txt* For Vim version 9.0. Last change: 2022 Nov 30
*starting.txt* For Vim version 9.0. Last change: 2023 May 30
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -792,9 +792,11 @@ accordingly. Vim proceeds in this order:
2. Process the arguments
The options and file names from the command that start Vim are
inspected. Buffers are created for all files (but not loaded yet).
inspected.
The |-V| argument can be used to display or log what happens next,
useful for debugging the initializations.
The |--cmd| arguments are executed.
Buffers are created for all files (but not loaded yet).
3. Execute Ex commands, from environment variables and/or files
An environment variable is read as one Ex command line, where multiple
@@ -1702,6 +1704,6 @@ most of the information will be restored).
If you get the |press-enter| prompt you can press "q"
and still get the prompt to enter a file number.
Use ! to abandon a modified buffer. |abandon|
{not when compiled with tiny or small features}
{not when compiled with tiny features}
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@@ -214,10 +214,10 @@ A syntax group name is to be used for syntax items that match the same kind of
thing. These are then linked to a highlight group that specifies the color.
A syntax group name doesn't specify any color or attributes itself.
The name for a highlight or syntax group must consist of ASCII letters, digits
and the underscore. As a regexp: "[a-zA-Z0-9_]*". However, Vim does not give
an error when using other characters. The maximum length of a group name is
about 200 bytes. *E1249*
The name for a highlight or syntax group must consist of ASCII letters,
digits, underscores, dots, or hyphens. As a regexp: "[a-zA-Z0-9_.-]*".
However, Vim does not give an error when using other characters. The maximum
length of a group name is about 200 bytes. *E1249*
To be able to allow each user to pick their favorite set of colors, there must
be preferred names for highlight groups that are common for many languages.
@@ -596,7 +596,7 @@ The method used to prevent copying in the generated page depends on the value
of |g:html_use_input_for_pc|.
*g:html_use_input_for_pc*
Default: "fallback"
Default: "none"
If |g:html_prevent_copy| is non-empty, then:
When "all", read-only <input> elements are used in place of normal text for
@@ -1579,9 +1579,10 @@ example, FORM files, use this in your startup vimrc: >
FORTH *forth.vim* *ft-forth-syntax*
Files matching "*.fs" could be F# or Forth. If the automatic detection
doesn't work for you, or you don't edit F# at all, use this in your
startup vimrc: >
Files matching "*.f" could be Fortran or Forth and those matching "*.fs" could
be F# or Forth. If the automatic detection doesn't work for you, or you don't
edit F# or Fortran at all, use this in your startup vimrc: >
:let filetype_f = "forth"
:let filetype_fs = "forth"
@@ -2159,11 +2160,11 @@ should set a variable in your .vimrc file: >
:let lpc_syntax_for_c = 1
If it doesn't work properly for some particular C or LPC files, use a
modeline. For a LPC file:
modeline. For a LPC file: >
// vim:set ft=lpc:
For a C file that is recognized as LPC:
For a C file that is recognized as LPC: >
// vim:set ft=c:
@@ -2195,7 +2196,7 @@ LUA *lua.vim* *ft-lua-syntax*
The Lua syntax file can be used for versions 4.0, 5.0, 5.1 and 5.2 (5.2 is
the default). You can select one of these versions using the global variables
lua_version and lua_subversion. For example, to activate Lua
5.1 syntax highlighting, set the variables like this:
5.1 syntax highlighting, set the variables like this: >
:let lua_version = 5
:let lua_subversion = 1

View File

@@ -433,7 +433,9 @@ $quote eval.txt /*$quote*
'isp' options.txt /*'isp'*
'isprint' options.txt /*'isprint'*
'joinspaces' options.txt /*'joinspaces'*
'jop' options.txt /*'jop'*
'js' options.txt /*'js'*
'jumpoptions' options.txt /*'jumpoptions'*
'key' options.txt /*'key'*
'keymap' options.txt /*'keymap'*
'keymodel' options.txt /*'keymodel'*
@@ -1434,6 +1436,7 @@ $quote eval.txt /*$quote*
+python/dyn various.txt /*+python\/dyn*
+python3 various.txt /*+python3*
+python3/dyn various.txt /*+python3\/dyn*
+python3/dyn-stable various.txt /*+python3\/dyn-stable*
+quickfix various.txt /*+quickfix*
+reltime various.txt /*+reltime*
+rightleft various.txt /*+rightleft*
@@ -1480,6 +1483,7 @@ $quote eval.txt /*$quote*
+wildmenu various.txt /*+wildmenu*
+windows various.txt /*+windows*
+writebackup various.txt /*+writebackup*
+xattr various.txt /*+xattr*
+xfontset various.txt /*+xfontset*
+xim various.txt /*+xim*
+xpm various.txt /*+xpm*
@@ -2074,7 +2078,14 @@ $quote eval.txt /*$quote*
:Arguments terminal.txt /*:Arguments*
:Asm terminal.txt /*:Asm*
:Break terminal.txt /*:Break*
:Cargo ft_rust.txt /*:Cargo*
:Cbench ft_rust.txt /*:Cbench*
:Cbuild ft_rust.txt /*:Cbuild*
:Cclean ft_rust.txt /*:Cclean*
:Cdoc ft_rust.txt /*:Cdoc*
:Cfilter quickfix.txt /*:Cfilter*
:Cinit ft_rust.txt /*:Cinit*
:Cinstall ft_rust.txt /*:Cinstall*
:Clear terminal.txt /*:Clear*
:CompilerSet usr_51.txt /*:CompilerSet*
:ConTeXt ft_context.txt /*:ConTeXt*
@@ -2082,12 +2093,20 @@ $quote eval.txt /*$quote*
:ConTeXtLog ft_context.txt /*:ConTeXtLog*
:ConTeXtStopJobs ft_context.txt /*:ConTeXtStopJobs*
:Continue terminal.txt /*:Continue*
:Cpublish ft_rust.txt /*:Cpublish*
:Crun ft_rust.txt /*:Crun*
:Cruntarget ft_rust.txt /*:Cruntarget*
:Csearch ft_rust.txt /*:Csearch*
:Ctest ft_rust.txt /*:Ctest*
:Cupdate ft_rust.txt /*:Cupdate*
:DiffOrig diff.txt /*:DiffOrig*
:DoMatchParen pi_paren.txt /*:DoMatchParen*
:Down terminal.txt /*:Down*
:Evaluate terminal.txt /*:Evaluate*
:Explore pi_netrw.txt /*:Explore*
:Finish terminal.txt /*:Finish*
:FixBeginfigs ft_mp.txt /*:FixBeginfigs*
:Frame terminal.txt /*:Frame*
:GLVS pi_getscript.txt /*:GLVS*
:Gdb terminal.txt /*:Gdb*
:GetLatestVimScripts_dat pi_getscript.txt /*:GetLatestVimScripts_dat*
@@ -2128,8 +2147,12 @@ $quote eval.txt /*$quote*
:RustExpand ft_rust.txt /*:RustExpand*
:RustFmt ft_rust.txt /*:RustFmt*
:RustFmtRange ft_rust.txt /*:RustFmtRange*
:RustInfo ft_rust.txt /*:RustInfo*
:RustInfoClipboard ft_rust.txt /*:RustInfoClipboard*
:RustInfoToFile ft_rust.txt /*:RustInfoToFile*
:RustPlay ft_rust.txt /*:RustPlay*
:RustRun ft_rust.txt /*:RustRun*
:RustTest ft_rust.txt /*:RustTest*
:Sexplore pi_netrw.txt /*:Sexplore*
:Source terminal.txt /*:Source*
:Step terminal.txt /*:Step*
@@ -2140,7 +2163,9 @@ $quote eval.txt /*$quote*
:TermdebugCommand terminal.txt /*:TermdebugCommand*
:Texplore pi_netrw.txt /*:Texplore*
:Until terminal.txt /*:Until*
:Up terminal.txt /*:Up*
:UseVimball pi_vimball.txt /*:UseVimball*
:Var terminal.txt /*:Var*
:Vexplore pi_netrw.txt /*:Vexplore*
:VimballList pi_vimball.txt /*:VimballList*
:Vimuntar pi_tar.txt /*:Vimuntar*
@@ -3184,6 +3209,7 @@ $quote eval.txt /*$quote*
:set-inv options.txt /*:set-inv*
:set-termcap options.txt /*:set-termcap*
:set-verbose options.txt /*:set-verbose*
:set= options.txt /*:set=*
:set^= options.txt /*:set^=*
:set_env options.txt /*:set_env*
:setf options.txt /*:setf*
@@ -3856,7 +3882,8 @@ BeOS os_beos.txt /*BeOS*
Blob eval.txt /*Blob*
Blobs eval.txt /*Blobs*
Boolean eval.txt /*Boolean*
Bram intro.txt /*Bram*
Bram version9.txt /*Bram*
Bram-Moolenaar version9.txt /*Bram-Moolenaar*
BufAdd autocmd.txt /*BufAdd*
BufCreate autocmd.txt /*BufCreate*
BufDelete autocmd.txt /*BufDelete*
@@ -4395,13 +4422,11 @@ E1325 vim9class.txt /*E1325*
E1326 vim9class.txt /*E1326*
E1327 vim9class.txt /*E1327*
E1328 vim9class.txt /*E1328*
E1329 vim9class.txt /*E1329*
E133 userfunc.txt /*E133*
E1330 vim9class.txt /*E1330*
E1331 vim9class.txt /*E1331*
E1332 vim9class.txt /*E1332*
E1333 vim9class.txt /*E1333*
E1334 vim9class.txt /*E1334*
E1335 vim9class.txt /*E1335*
E1336 options.txt /*E1336*
E1337 vim9class.txt /*E1337*
@@ -4433,11 +4458,39 @@ E136 starting.txt /*E136*
E1360 vim9class.txt /*E1360*
E1361 syntax.txt /*E1361*
E1362 vim9class.txt /*E1362*
E1363 vim9class.txt /*E1363*
E1363 vim9.txt /*E1363*
E1364 recover.txt /*E1364*
E1365 vim9class.txt /*E1365*
E1366 vim9class.txt /*E1366*
E1367 vim9class.txt /*E1367*
E1368 vim9class.txt /*E1368*
E1369 vim9class.txt /*E1369*
E137 starting.txt /*E137*
E1370 vim9class.txt /*E1370*
E1371 vim9class.txt /*E1371*
E1372 vim9class.txt /*E1372*
E1373 vim9class.txt /*E1373*
E1374 vim9class.txt /*E1374*
E1375 vim9class.txt /*E1375*
E1376 vim9class.txt /*E1376*
E1377 vim9class.txt /*E1377*
E1378 vim9class.txt /*E1378*
E1379 vim9class.txt /*E1379*
E138 starting.txt /*E138*
E1380 vim9class.txt /*E1380*
E1381 vim9class.txt /*E1381*
E1382 vim9class.txt /*E1382*
E1383 vim9class.txt /*E1383*
E1384 vim9class.txt /*E1384*
E1385 vim9class.txt /*E1385*
E1386 vim9class.txt /*E1386*
E1387 vim9class.txt /*E1387*
E1388 vim9class.txt /*E1388*
E1389 vim9class.txt /*E1389*
E139 message.txt /*E139*
E1390 vim9class.txt /*E1390*
E1391 eval.txt /*E1391*
E1392 eval.txt /*E1392*
E140 message.txt /*E140*
E141 message.txt /*E141*
E142 message.txt /*E142*
@@ -4450,6 +4503,16 @@ E148 repeat.txt /*E148*
E149 helphelp.txt /*E149*
E15 eval.txt /*E15*
E150 helphelp.txt /*E150*
E1500 builtin.txt /*E1500*
E1501 builtin.txt /*E1501*
E1502 builtin.txt /*E1502*
E1503 builtin.txt /*E1503*
E1504 builtin.txt /*E1504*
E1505 builtin.txt /*E1505*
E1506 editing.txt /*E1506*
E1507 builtin.txt /*E1507*
E1508 editing.txt /*E1508*
E1509 editing.txt /*E1509*
E151 helphelp.txt /*E151*
E152 helphelp.txt /*E152*
E153 helphelp.txt /*E153*
@@ -4653,6 +4716,7 @@ E337 gui.txt /*E337*
E338 editing.txt /*E338*
E339 message.txt /*E339*
E34 various.txt /*E34*
E340 message.txt /*E340*
E341 message.txt /*E341*
E342 message.txt /*E342*
E343 options.txt /*E343*
@@ -4945,6 +5009,8 @@ E610 editing.txt /*E610*
E611 eval.txt /*E611*
E612 sign.txt /*E612*
E613 print.txt /*E613*
E614 builtin.txt /*E614*
E616 builtin.txt /*E616*
E617 options.txt /*E617*
E618 print.txt /*E618*
E619 print.txt /*E619*
@@ -5028,6 +5094,7 @@ E69 pattern.txt /*E69*
E690 eval.txt /*E690*
E691 eval.txt /*E691*
E692 eval.txt /*E692*
E693 builtin.txt /*E693*
E694 eval.txt /*E694*
E695 eval.txt /*E695*
E696 eval.txt /*E696*
@@ -5041,6 +5108,7 @@ E702 builtin.txt /*E702*
E703 eval.txt /*E703*
E704 eval.txt /*E704*
E705 eval.txt /*E705*
E706 builtin.txt /*E706*
E707 eval.txt /*E707*
E708 eval.txt /*E708*
E709 eval.txt /*E709*
@@ -5457,7 +5525,7 @@ Mark motion.txt /*Mark*
MenuPopup autocmd.txt /*MenuPopup*
MiNT os_mint.txt /*MiNT*
ModeChanged autocmd.txt /*ModeChanged*
Moolenaar intro.txt /*Moolenaar*
Moolenaar version9.txt /*Moolenaar*
MorphOS os_amiga.txt /*MorphOS*
Motif gui_x11.txt /*Motif*
Myspell spell.txt /*Myspell*
@@ -5836,6 +5904,7 @@ abandon editing.txt /*abandon*
abbreviations map.txt /*abbreviations*
abel.vim syntax.txt /*abel.vim*
abs() builtin.txt /*abs()*
abstract-method vim9class.txt /*abstract-method*
acos() builtin.txt /*acos()*
active-buffer windows.txt /*active-buffer*
ada#Create_Tags() ft_ada.txt /*ada#Create_Tags()*
@@ -5873,6 +5942,7 @@ added-7.3 version7.txt /*added-7.3*
added-7.4 version7.txt /*added-7.4*
added-8.1 version8.txt /*added-8.1*
added-8.2 version8.txt /*added-8.2*
added-9.1 version9.txt /*added-9.1*
added-BeOS version5.txt /*added-BeOS*
added-Mac version5.txt /*added-Mac*
added-VMS version5.txt /*added-VMS*
@@ -5983,6 +6053,13 @@ b:clojure_syntax_keywords syntax.txt /*b:clojure_syntax_keywords*
b:clojure_syntax_without_core_keywords syntax.txt /*b:clojure_syntax_without_core_keywords*
b:current_syntax-variable syntax.txt /*b:current_syntax-variable*
b:netrw_lastfile pi_netrw.txt /*b:netrw_lastfile*
b:rust_cargo_avoid_whole_workspace ft_rust.txt /*b:rust_cargo_avoid_whole_workspace*
b:rust_cargo_check_all_features ft_rust.txt /*b:rust_cargo_check_all_features*
b:rust_cargo_check_all_targets ft_rust.txt /*b:rust_cargo_check_all_targets*
b:rust_cargo_check_benches ft_rust.txt /*b:rust_cargo_check_benches*
b:rust_cargo_check_examples ft_rust.txt /*b:rust_cargo_check_examples*
b:rust_cargo_check_tests ft_rust.txt /*b:rust_cargo_check_tests*
b:rustfmt_autosave ft_rust.txt /*b:rustfmt_autosave*
b:tex_stylish syntax.txt /*b:tex_stylish*
b:var eval.txt /*b:var*
b:yaml_schema syntax.txt /*b:yaml_schema*
@@ -6246,6 +6323,7 @@ changed-7.3 version7.txt /*changed-7.3*
changed-7.4 version7.txt /*changed-7.4*
changed-8.1 version8.txt /*changed-8.1*
changed-8.2 version8.txt /*changed-8.2*
changed-9.1 version9.txt /*changed-9.1*
changelist motion.txt /*changelist*
changelog.vim syntax.txt /*changelog.vim*
changenr() builtin.txt /*changenr()*
@@ -6328,7 +6406,7 @@ cino-{ indent.txt /*cino-{*
cino-} indent.txt /*cino-}*
cinoptions-values indent.txt /*cinoptions-values*
class vim9class.txt /*class*
class-function vim9class.txt /*class-function*
class-method vim9class.txt /*class-method*
clear-undo undo.txt /*clear-undo*
clearmatches() builtin.txt /*clearmatches()*
client-server remote.txt /*client-server*
@@ -6418,6 +6496,7 @@ complete-items insert.txt /*complete-items*
complete-popup insert.txt /*complete-popup*
complete-popuphidden insert.txt /*complete-popuphidden*
complete-script-local-functions cmdline.txt /*complete-script-local-functions*
complete-set-option cmdline.txt /*complete-set-option*
complete_CTRL-E insert.txt /*complete_CTRL-E*
complete_CTRL-Y insert.txt /*complete_CTRL-Y*
complete_add() builtin.txt /*complete_add()*
@@ -6433,6 +6512,7 @@ conceal syntax.txt /*conceal*
confirm() builtin.txt /*confirm()*
connection-refused message.txt /*connection-refused*
console-menus gui.txt /*console-menus*
constructor vim9class.txt /*constructor*
context.vim ft_context.txt /*context.vim*
control intro.txt /*control*
conversion-server mbyte.txt /*conversion-server*
@@ -6606,6 +6686,7 @@ debugger.txt debugger.txt /*debugger.txt*
dec-mouse options.txt /*dec-mouse*
decada_members ft_ada.txt /*decada_members*
deepcopy() builtin.txt /*deepcopy()*
default-constructor vim9class.txt /*default-constructor*
defaults.vim starting.txt /*defaults.vim*
defaults.vim-explained usr_05.txt /*defaults.vim-explained*
define-function userfunc.txt /*define-function*
@@ -6678,6 +6759,7 @@ dis motion.txt /*dis*
disable-menus gui.txt /*disable-menus*
discard editing.txt /*discard*
distribute-script usr_51.txt /*distribute-script*
distributed-plugins usr_05.txt /*distributed-plugins*
distribution intro.txt /*distribution*
diw motion.txt /*diw*
dl change.txt /*dl*
@@ -6727,6 +6809,7 @@ edit-no-break usr_25.txt /*edit-no-break*
edit-paragraph-join usr_25.txt /*edit-paragraph-join*
edit-window windows.txt /*edit-window*
editing.txt editing.txt /*editing.txt*
editorconfig-install usr_05.txt /*editorconfig-install*
efm-%> quickfix.txt /*efm-%>*
efm-entries quickfix.txt /*efm-entries*
efm-ignore quickfix.txt /*efm-ignore*
@@ -6752,6 +6835,7 @@ err_mode channel.txt /*err_mode*
err_modifiable channel.txt /*err_modifiable*
err_msg channel.txt /*err_msg*
err_name channel.txt /*err_name*
err_teapot() builtin.txt /*err_teapot()*
err_timeout channel.txt /*err_timeout*
errmsg-variable eval.txt /*errmsg-variable*
error-file-format quickfix.txt /*error-file-format*
@@ -7305,6 +7389,8 @@ g:ada_space_errors ft_ada.txt /*g:ada_space_errors*
g:ada_standard_types ft_ada.txt /*g:ada_standard_types*
g:ada_with_gnat_project_files ft_ada.txt /*g:ada_with_gnat_project_files*
g:ada_withuse_ordinary ft_ada.txt /*g:ada_withuse_ordinary*
g:cargo_makeprg_params ft_rust.txt /*g:cargo_makeprg_params*
g:cargo_shell_command_runner ft_rust.txt /*g:cargo_shell_command_runner*
g:clojure_align_multiline_strings indent.txt /*g:clojure_align_multiline_strings*
g:clojure_align_subforms indent.txt /*g:clojure_align_subforms*
g:clojure_discard_macro syntax.txt /*g:clojure_discard_macro*
@@ -7467,18 +7553,29 @@ g:netrw_wiw pi_netrw.txt /*g:netrw_wiw*
g:netrw_xstrlen pi_netrw.txt /*g:netrw_xstrlen*
g:no_mail_maps filetype.txt /*g:no_mail_maps*
g:no_plugin_maps filetype.txt /*g:no_plugin_maps*
g:plugin_exec filetype.txt /*g:plugin_exec*
g:rust_bang_comment_leader ft_rust.txt /*g:rust_bang_comment_leader*
g:rust_cargo_avoid_whole_workspace ft_rust.txt /*g:rust_cargo_avoid_whole_workspace*
g:rust_cargo_check_all_features ft_rust.txt /*g:rust_cargo_check_all_features*
g:rust_cargo_check_all_targets ft_rust.txt /*g:rust_cargo_check_all_targets*
g:rust_cargo_check_benches ft_rust.txt /*g:rust_cargo_check_benches*
g:rust_cargo_check_examples ft_rust.txt /*g:rust_cargo_check_examples*
g:rust_cargo_check_tests ft_rust.txt /*g:rust_cargo_check_tests*
g:rust_clip_command ft_rust.txt /*g:rust_clip_command*
g:rust_conceal ft_rust.txt /*g:rust_conceal*
g:rust_conceal_mod_path ft_rust.txt /*g:rust_conceal_mod_path*
g:rust_conceal_pub ft_rust.txt /*g:rust_conceal_pub*
g:rust_fold ft_rust.txt /*g:rust_fold*
g:rust_playpen_url ft_rust.txt /*g:rust_playpen_url*
g:rust_keep_autopairs_default ft_rust.txt /*g:rust_keep_autopairs_default*
g:rust_recommended_style ft_rust.txt /*g:rust_recommended_style*
g:rust_shortener_url ft_rust.txt /*g:rust_shortener_url*
g:rust_use_custom_ctags_defs ft_rust.txt /*g:rust_use_custom_ctags_defs*
g:rustc_makeprg_no_percent ft_rust.txt /*g:rustc_makeprg_no_percent*
g:rustc_path ft_rust.txt /*g:rustc_path*
g:rustfmt_autosave ft_rust.txt /*g:rustfmt_autosave*
g:rustfmt_autosave_if_config_present ft_rust.txt /*g:rustfmt_autosave_if_config_present*
g:rustfmt_command ft_rust.txt /*g:rustfmt_command*
g:rustfmt_emit_files ft_rust.txt /*g:rustfmt_emit_files*
g:rustfmt_fail_silently ft_rust.txt /*g:rustfmt_fail_silently*
g:rustfmt_options ft_rust.txt /*g:rustfmt_options*
g:statusline_winid options.txt /*g:statusline_winid*
@@ -7533,6 +7630,7 @@ g<LeftMouse> tagsrch.txt /*g<LeftMouse>*
g<RightMouse> tagsrch.txt /*g<RightMouse>*
g<Tab> tabpage.txt /*g<Tab>*
g<Up> motion.txt /*g<Up>*
g<kEnd> motion.txt /*g<kEnd>*
g? change.txt /*g?*
g?? change.txt /*g??*
g?g? change.txt /*g?g?*
@@ -8016,6 +8114,7 @@ i_CTRL-O insert.txt /*i_CTRL-O*
i_CTRL-P insert.txt /*i_CTRL-P*
i_CTRL-Q insert.txt /*i_CTRL-Q*
i_CTRL-R insert.txt /*i_CTRL-R*
i_CTRL-R_- insert.txt /*i_CTRL-R_-*
i_CTRL-R_= insert.txt /*i_CTRL-R_=*
i_CTRL-R_CTRL-O insert.txt /*i_CTRL-R_CTRL-O*
i_CTRL-R_CTRL-P insert.txt /*i_CTRL-R_CTRL-P*
@@ -8154,10 +8253,12 @@ insertmode-variable eval.txt /*insertmode-variable*
install usr_90.txt /*install*
install-home usr_90.txt /*install-home*
install-registry gui_w32.txt /*install-registry*
instanceof() builtin.txt /*instanceof()*
intel-itanium syntax.txt /*intel-itanium*
intellimouse-wheel-problems gui_w32.txt /*intellimouse-wheel-problems*
interactive-functions usr_41.txt /*interactive-functions*
interfaces-5.2 version5.txt /*interfaces-5.2*
internal-error message.txt /*internal-error*
internal-variables eval.txt /*internal-variables*
internal-wordlist spell.txt /*internal-wordlist*
internet intro.txt /*internet*
@@ -8225,6 +8326,7 @@ json_encode() builtin.txt /*json_encode()*
jtags tagsrch.txt /*jtags*
jump-motions motion.txt /*jump-motions*
jumplist motion.txt /*jumplist*
jumplist-stack motion.txt /*jumplist-stack*
jumpto-diffs diff.txt /*jumpto-diffs*
k motion.txt /*k*
kcc uganda.txt /*kcc*
@@ -8324,6 +8426,7 @@ load-plugins starting.txt /*load-plugins*
load-vim-script repeat.txt /*load-vim-script*
local-additions help.txt /*local-additions*
local-function userfunc.txt /*local-function*
local-noglobal options.txt /*local-noglobal*
local-options options.txt /*local-options*
local-variable eval.txt /*local-variable*
local-variables userfunc.txt /*local-variables*
@@ -8835,6 +8938,7 @@ netrw.vim pi_netrw.txt /*netrw.vim*
netrw_filehandler pi_netrw.txt /*netrw_filehandler*
netterm-mouse options.txt /*netterm-mouse*
network pi_netrw.txt /*network*
new() vim9class.txt /*new()*
new-5 version5.txt /*new-5*
new-6 version6.txt /*new-6*
new-7 version7.txt /*new-7*
@@ -8895,6 +8999,7 @@ new-operator-mod version6.txt /*new-operator-mod*
new-options-5.2 version5.txt /*new-options-5.2*
new-options-5.4 version5.txt /*new-options-5.4*
new-other-8.2 version8.txt /*new-other-8.2*
new-other-9.1 version9.txt /*new-other-9.1*
new-perl-python version5.txt /*new-perl-python*
new-persistent-undo version7.txt /*new-persistent-undo*
new-plugins version6.txt /*new-plugins*
@@ -8967,6 +9072,7 @@ numbersize-variable eval.txt /*numbersize-variable*
o insert.txt /*o*
o_CTRL-V motion.txt /*o_CTRL-V*
o_V motion.txt /*o_V*
o_object-select motion.txt /*o_object-select*
o_v motion.txt /*o_v*
object vim9class.txt /*object*
object-motions motion.txt /*object-motions*
@@ -9054,6 +9160,7 @@ patches-8 version8.txt /*patches-8*
patches-8.1 version8.txt /*patches-8.1*
patches-8.2 version8.txt /*patches-8.2*
patches-9 version9.txt /*patches-9*
patches-9.1 version9.txt /*patches-9.1*
patches-after-8.2 version9.txt /*patches-after-8.2*
pathshorten() builtin.txt /*pathshorten()*
pattern pattern.txt /*pattern*
@@ -9123,6 +9230,7 @@ plugin usr_05.txt /*plugin*
plugin-details filetype.txt /*plugin-details*
plugin-filetype usr_51.txt /*plugin-filetype*
plugin-special usr_51.txt /*plugin-special*
plugin_exec filetype.txt /*plugin_exec*
plugin_name.txt helphelp.txt /*plugin_name.txt*
pmbcs-option print.txt /*pmbcs-option*
pmbfn-option print.txt /*pmbfn-option*
@@ -9204,6 +9312,7 @@ print-intro print.txt /*print-intro*
print-options print.txt /*print-options*
print.txt print.txt /*print.txt*
printf() builtin.txt /*printf()*
printf-$ builtin.txt /*printf-$*
printf-% builtin.txt /*printf-%*
printf-B builtin.txt /*printf-B*
printf-E builtin.txt /*printf-E*
@@ -9221,6 +9330,8 @@ printf-s builtin.txt /*printf-s*
printf-x builtin.txt /*printf-x*
printing print.txt /*printing*
printing-formfeed print.txt /*printing-formfeed*
private-method vim9class.txt /*private-method*
private-variable vim9class.txt /*private-variable*
profile repeat.txt /*profile*
profiling repeat.txt /*profiling*
profiling-variable eval.txt /*profiling-variable*
@@ -9291,6 +9402,8 @@ python-path_hook if_pyth.txt /*python-path_hook*
python-pyeval if_pyth.txt /*python-pyeval*
python-range if_pyth.txt /*python-range*
python-special-path if_pyth.txt /*python-special-path*
python-stable if_pyth.txt /*python-stable*
python-stable-abi if_pyth.txt /*python-stable-abi*
python-strwidth if_pyth.txt /*python-strwidth*
python-tabpage if_pyth.txt /*python-tabpage*
python-tabpages if_pyth.txt /*python-tabpages*
@@ -9303,6 +9416,8 @@ python.vim syntax.txt /*python.vim*
python2-directory if_pyth.txt /*python2-directory*
python3 if_pyth.txt /*python3*
python3-directory if_pyth.txt /*python3-directory*
python3-stable-abi if_pyth.txt /*python3-stable-abi*
python3-version-variable eval.txt /*python3-version-variable*
python_x if_pyth.txt /*python_x*
python_x-special-comments if_pyth.txt /*python_x-special-comments*
pythonx if_pyth.txt /*pythonx*
@@ -9487,12 +9602,12 @@ russian-keymap russian.txt /*russian-keymap*
russian-l18n russian.txt /*russian-l18n*
russian.txt russian.txt /*russian.txt*
rust ft_rust.txt /*rust*
rust-auto-pairs ft_rust.txt /*rust-auto-pairs*
rust-commands ft_rust.txt /*rust-commands*
rust-intro ft_rust.txt /*rust-intro*
rust-mappings ft_rust.txt /*rust-mappings*
rust-settings ft_rust.txt /*rust-settings*
rust_<D-R> ft_rust.txt /*rust_<D-R>*
rust_<D-r> ft_rust.txt /*rust_<D-r>*
rust-syntastic ft_rust.txt /*rust-syntastic*
rview starting.txt /*rview*
rvim starting.txt /*rvim*
rxvt syntax.txt /*rxvt*
@@ -10314,15 +10429,20 @@ termdebug-communication terminal.txt /*termdebug-communication*
termdebug-customizing terminal.txt /*termdebug-customizing*
termdebug-events terminal.txt /*termdebug-events*
termdebug-example terminal.txt /*termdebug-example*
termdebug-frames terminal.txt /*termdebug-frames*
termdebug-prompt terminal.txt /*termdebug-prompt*
termdebug-starting terminal.txt /*termdebug-starting*
termdebug-stepping terminal.txt /*termdebug-stepping*
termdebug-variables terminal.txt /*termdebug-variables*
termdebug_disasm_window terminal.txt /*termdebug_disasm_window*
termdebug_map_K terminal.txt /*termdebug_map_K*
termdebug_map_minus terminal.txt /*termdebug_map_minus*
termdebug_map_plus terminal.txt /*termdebug_map_plus*
termdebug_popup terminal.txt /*termdebug_popup*
termdebug_shortcuts terminal.txt /*termdebug_shortcuts*
termdebug_signs terminal.txt /*termdebug_signs*
termdebug_use_prompt terminal.txt /*termdebug_use_prompt*
termdebug_variables_window terminal.txt /*termdebug_variables_window*
termdebug_wide terminal.txt /*termdebug_wide*
termdebug_winbar terminal.txt /*termdebug_winbar*
terminal terminal.txt /*terminal*
@@ -10627,6 +10747,7 @@ v:prevcount eval.txt /*v:prevcount*
v:profiling eval.txt /*v:profiling*
v:progname eval.txt /*v:progname*
v:progpath eval.txt /*v:progpath*
v:python3_version eval.txt /*v:python3_version*
v:register eval.txt /*v:register*
v:scrollstart eval.txt /*v:scrollstart*
v:searchforward eval.txt /*v:searchforward*
@@ -10772,6 +10893,7 @@ v_iw motion.txt /*v_iw*
v_i{ motion.txt /*v_i{*
v_i} motion.txt /*v_i}*
v_o visual.txt /*v_o*
v_object-select motion.txt /*v_object-select*
v_p change.txt /*v_p*
v_r change.txt /*v_r*
v_s change.txt /*v_s*
@@ -10818,6 +10940,7 @@ version-8.0 version8.txt /*version-8.0*
version-8.1 version8.txt /*version-8.1*
version-8.2 version8.txt /*version-8.2*
version-9.0 version9.txt /*version-9.0*
version-9.1 version9.txt /*version-9.1*
version-variable eval.txt /*version-variable*
version4.txt version4.txt /*version4.txt*
version5.txt version5.txt /*version5.txt*
@@ -10833,6 +10956,7 @@ version8.1 version8.txt /*version8.1*
version8.2 version8.txt /*version8.2*
version8.txt version8.txt /*version8.txt*
version9.0 version9.txt /*version9.0*
version9.1 version9.txt /*version9.1*
version9.txt version9.txt /*version9.txt*
versionlong-variable eval.txt /*versionlong-variable*
vi intro.txt /*vi*
@@ -10851,6 +10975,7 @@ vim-8.1 version8.txt /*vim-8.1*
vim-8.2 version8.txt /*vim-8.2*
vim-9 version9.txt /*vim-9*
vim-9.0 version9.txt /*vim-9.0*
vim-9.1 version9.txt /*vim-9.1*
vim-additions vi_diff.txt /*vim-additions*
vim-announce intro.txt /*vim-announce*
vim-arguments starting.txt /*vim-arguments*
@@ -10883,6 +11008,7 @@ vim9-declaration vim9.txt /*vim9-declaration*
vim9-declarations usr_41.txt /*vim9-declarations*
vim9-differences vim9.txt /*vim9-differences*
vim9-export vim9.txt /*vim9-export*
vim9-false-true vim9.txt /*vim9-false-true*
vim9-final vim9.txt /*vim9-final*
vim9-function-defined-later vim9.txt /*vim9-function-defined-later*
vim9-gotchas vim9.txt /*vim9-gotchas*
@@ -10900,6 +11026,7 @@ vim9-rationale vim9.txt /*vim9-rationale*
vim9-reload vim9.txt /*vim9-reload*
vim9-s-namespace vim9.txt /*vim9-s-namespace*
vim9-scopes vim9.txt /*vim9-scopes*
vim9-string-index vim9.txt /*vim9-string-index*
vim9-types vim9.txt /*vim9-types*
vim9-unpack-ignore vim9.txt /*vim9-unpack-ignore*
vim9-user-command vim9.txt /*vim9-user-command*
@@ -11108,6 +11235,7 @@ x-resources version5.txt /*x-resources*
x11-clientserver remote.txt /*x11-clientserver*
x11-cut-buffer gui_x11.txt /*x11-cut-buffer*
x11-selection gui_x11.txt /*x11-selection*
xattr editing.txt /*xattr*
xf86conf.vim syntax.txt /*xf86conf.vim*
xfontset mbyte.txt /*xfontset*
xfree-xterm syntax.txt /*xfree-xterm*

View File

@@ -1,4 +1,4 @@
*terminal.txt* For Vim version 9.0. Last change: 2022 Nov 10
*terminal.txt* For Vim version 9.0. Last change: 2023 Aug 23
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -38,6 +38,7 @@ If the result is "1" you have it.
Example session |termdebug-example|
Stepping through code |termdebug-stepping|
Inspecting variables |termdebug-variables|
Navigating stack frames |termdebug-frames|
Other commands |termdebug-commands|
Events |termdebug-events|
Prompt mode |termdebug-prompt|
@@ -1376,6 +1377,18 @@ This is similar to using "print" in the gdb window.
You can usually shorten `:Evaluate` to `:Ev`.
Navigating stack frames ~
*termdebug-frames* *:Frame* *:Up* *:Down*
`:Frame` [frame] select frame [frame], which is a frame number,
address, or function name (default: current frame)
`:Up` [count] go up [count] frames (default: 1; the frame that
called the current)
`+` same (see |termdebug_map_plus| to disable)
`:Down` [count] go down [count] frames (default: 1; the frame called
by the current)
`-` same (see |termdebug_map_minus| to disable)
Other commands ~
*termdebug-commands*
*:Gdb* jump to the gdb window
@@ -1384,6 +1397,9 @@ Other commands ~
isn't one
*:Asm* jump to the window with the disassembly, create it if there
isn't one
*:Var* jump to the window with the local and argument variables,
create it if there isn't one. This window updates whenever the
program is stopped
Events ~
*termdebug-events*
@@ -1446,20 +1462,37 @@ If there is no g:termdebug_config you can use: >
let g:termdebug_use_prompt = 1
<
*termdebug_map_K*
The K key is normally mapped to :Evaluate. If you do not want this use: >
The K key is normally mapped to |:Evaluate|. If you do not want this use: >
let g:termdebug_config['map_K'] = 0
If there is no g:termdebug_config you can use: >
let g:termdebug_map_K = 0
<
*termdebug_map_minus*
The - key is normally mapped to |:Down|. If you do not want this use: >
let g:termdebug_config['map_minus'] = 0
<
*termdebug_map_plus*
The + key is normally mapped to |:Up|. If you do not want this use: >
let g:termdebug_config['map_plus'] = 0
<
*termdebug_disasm_window*
If you want the Asm window shown by default, set the flag to 1.
the "disasm_window_height" entry can be used to set the window height: >
If you want the Asm window shown by default, set the "disasm_window" flag to
1. The "disasm_window_height" entry can be used to set the window height: >
let g:termdebug_config['disasm_window'] = 1
let g:termdebug_config['disasm_window_height'] = 15
If there is no g:termdebug_config you can use: >
let g:termdebug_disasm_window = 15
Any value greater than 1 will set the Asm window height to that value.
*termdebug_variables_window*
If you want the Var window shown by default, set the flag to 1.
the "variables_window_height" entry can be used to set the window height: >
let g:termdebug_config['variables_window'] = 1
let g:termdebug_config['variables_window_height'] = 15
If there is no g:termdebug_config you can use: >
let g:termdebug_variables_window = 15
Any value greater than 1 will set the Var window height to that value.
Communication ~
*termdebug-communication*
There is another, hidden, buffer, which is used for Vim to communicate with
@@ -1499,7 +1532,7 @@ The function will be called with the list of arguments so far, and a second
argument that is the name of the pty.
*gdb-version*
Only debuggers fully compatible with gdb will work. Vim uses the GDB/MI
interface. The "new-ui" command requires gdb version 7.12 or later. if you
interface. The "new-ui" command requires gdb version 7.12 or later. If you
get this error:
Undefined command: "new-ui". Try "help".~
Then your gdb is too old.
@@ -1541,6 +1574,20 @@ If there is no g:termdebug_config you can use: >
let g:termdebug_popup = 0
Change default signs ~
*termdebug_signs*
Termdebug uses the last two characters of the breakpoint ID in the
signcolumn to represent breakpoints. For example, breakpoint ID 133
will be displayed as `33`.
If you want to customize the breakpoint signs: >
let g:termdebug_config['sign'] = '>>'
If there is no g:terminal_config yet you can use: >
let g:termdebug_config = {'sign': '>>'}
After this, breakpoints will be displayed as `>>` in the signcolumn.
Window toolbar ~
*termdebug_winbar*
By default the Termdebug plugin creates a window toolbar if the mouse is

View File

@@ -1,4 +1,4 @@
*testing.txt* For Vim version 9.0. Last change: 2023 May 04
*testing.txt* For Vim version 9.0. Last change: 2023 May 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -21,7 +21,7 @@ Vim can be tested after building it, usually with "make test".
The tests are located in the directory "src/testdir".
There are two types of tests added over time:
test20.in oldest, only for tiny and small builds
test20.in oldest, only for tiny builds
test_something.vim new style tests
*new-style-testing*
@@ -166,15 +166,17 @@ test_gui_event({event}, {args})
Set or drag the left, right or horizontal scrollbar. Only
works when the scrollbar actually exists. The supported
items in {args} are:
which: scrollbar. The supported values are:
which: Selects the scrollbar. The supported values
are:
left Left scrollbar of the current window
right Right scrollbar of the current window
hor Horizontal scrollbar
value: amount to scroll. For the vertical scrollbars
the value can be 1 to the line-count of the
buffer. For the horizontal scrollbar the
value can be between 1 and the maximum line
length, assuming 'wrap' is not set.
value: Amount to scroll. For the vertical scrollbars
the value can be between 0 to the line-count
of the buffer minus one. For the horizontal
scrollbar the value can be between 1 and the
maximum line length, assuming 'wrap' is not
set.
dragging: 1 to drag the scrollbar and 0 to click in the
scrollbar.

View File

@@ -335,6 +335,12 @@ prop_list({lnum} [, {props}]) *prop_list()*
length length in bytes, one more if line break is
included
id property ID
text text to be displayed before {col}. Only
present for |virtual-text| properties.
text_align alignment property of |virtual-text|.
text_padding_left
left padding used for virtual text.
text_wrap specifies whether |virtual-text| is wrapped.
type name of the property type, omitted if
the type was deleted
type_bufnr buffer number for which this type was defined;

View File

@@ -1,4 +1,4 @@
*tips.txt* For Vim version 9.0. Last change: 2021 Nov 06
*tips.txt* For Vim version 9.0. Last change: 2023 Aug 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -431,14 +431,26 @@ comma-separated list of extension(s) you find yourself wanting to edit: >
" vim -b : edit binary using xxd-format!
augroup Binary
au!
au BufReadPre *.bin let &bin=1
au BufReadPost *.bin if &bin | %!xxd
au BufReadPost *.bin set ft=xxd | endif
au BufWritePre *.bin if &bin | %!xxd -r
au BufWritePre *.bin endif
au BufWritePost *.bin if &bin | %!xxd
au BufWritePost *.bin set nomod | endif
autocmd!
autocmd BufReadPre *.bin set binary
autocmd BufReadPost *.bin
\ if &binary
\ | execute "silent %!xxd -c 32"
\ | set filetype=xxd
\ | redraw
\ | endif
autocmd BufWritePre *.bin
\ if &binary
\ | let s:view = winsaveview()
\ | execute "silent %!xxd -r -c 32"
\ | endif
autocmd BufWritePost *.bin
\ if &binary
\ | execute "silent %!xxd -c 32"
\ | set nomodified
\ | call winrestview(s:view)
\ | redraw
\ | endif
augroup END
==============================================================================

View File

@@ -1,4 +1,4 @@
*todo.txt* For Vim version 9.0. Last change: 2023 May 13
*todo.txt* For Vim version 9.0. Last change: 2023 Jun 08
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -38,11 +38,12 @@ browser use: https://github.com/vim/vim/issues/1234
*known-bugs*
-------------------- Known bugs and current work -----------------------
Crash when splitting window: #11961. Set RedrawingDisabled in
win_split_ins().
FILETYPE_FILE is defined to the same value in multiple places.
Only use the one in feature.h. Others too.
CTRL-J mapping is not used if halfway another mapping. #12002
Is simplified mapping not used but escape code has been simplified?
Mapping with modifier is not recognized after a partial mapping. Probably
because the typeahead was simplified when looking for a matching mapping.
Need to somehow undo the simplification. #12002
Windows scroll when using the autocmd window. #12085
in restore_snapshot_rec() restore more values from the snapshot, instead of
@@ -57,29 +58,30 @@ When a help item can't be found, then open 'helpfile'. Search for the tag in
that file and gtive E149 only when not found. Helps for a tiny Vim installed
without all the help files.
SpellCap highlight not updated - PR #12428
Virtual text problems:
- Deleting character before a wrapping virtual text, causes for the following
lines to dissapear (Issue #12244)
- If 'list' is on, 'below' virtual text which includes 1 or 2 characters are
gone (Issue #12028)
- Virtual text aligned "above": Wrong indentation when using tabs (Issue
#12232)
- Virtual text to the right of the line that isn't visible doesn't cause the
'extends' character to show in 'list' mode. #12478
- Virtual text to the right of the line that fits exactly on screen causes
that line and all lines below it not to be displayed (Issue #12213)
- Window screen gets wrong when a virtual text is placed on 'above' or
'below' on an empty line (Issue #11959)
include #12140: positional arguments in printf(), fixes #10577
Include #11818: attach custom data to quickfix items.
Include #12292: buffer argument for undotree()?
- truncated Virtual text below an empty line causes display error #12493
When 'virtualedit' is "all" and 'cursorcolumn' is set, the wrong column may be
highlighted. (van-de-bugger, 2018 Jan 23, #2576)
Improve profiling by caching matching functions: PR #12192
With 'smoothscroll' set and "lastline" in 'display', moving the cursor to a
wrapping line that makes the display scroll up may scroll much more than
needed, thus jump-scrolling. (part of issue 12411)
Add filecopy() ? #12346
Implement foreach() PR #12166
@@ -91,12 +93,18 @@ Errors when running tests with valgrind:
- test_gui.vim:
Found errors in Test_gui_mouse_event():
When every block in if/elseif ends in "throw" or "return" code following after
"endif" should give an "unreachable code" error.
Upcoming larger works:
- Make spell checking work with recent .dic/.aff files, e.g. French. #4916
Make Vim understand the format somehow? Search for "spell" below.
Make sure suggestions are speedy, also with composed words (German).
- Make syntax highlighting faster and better. Discuss alternatives for using
other grammars (treesitter, TextMate).
- Make syntax highlighting faster and better.
Add a generic mechanism to test a syntax plugin: An input file for the
filetype and a screendump of expected result. With a way to specify the
setup (global variables) and another dump file from that.
Discuss alternatives for using other grammars (treesitter, TextMate).
- Possibly conversion to Vim syntax rules.
- Other mechanism than group and cluster to nest syntax items, to be used
for grammars.
@@ -112,53 +120,40 @@ Upcoming larger works:
- example plugin: https://github.com/uga-rosa/dps-vsctm.vim
Further Vim9 improvements, possibly after launch:
- implement :class and :interface: See |vim9-classes
- Change access: public by default, private by prefixing "_".
Check for error: can't have same name twice (ignoring "_" prefix).
Further Vim9 improvements:
- Classes and Interfaces. See |vim9-classes|
- "final" object members - can only be set in the constructor.
- Cannot use class type of itself in the method (Issue #12369)
- class members initialized during definition (Issue #12041)
- cannot call class member of funcref type (Issue #12324)
- nested function unable to directly modify private member (Issue #12076)
And: can't use "this" keyword in lambda function (Issue #12336)
- "return this" required for early return from constructor (inconsistent)
(Issue #12040)
- class/method confusion inside ":def" when using "class extends" (Issue
#12089)
- null_object - constant type 17 not supported (Issue #12043)
- problem compiling object method call as function call argument (Issue
#12081)
- Make ":defcompile ClassName" compile all functions and methods in the
class.
- object's method in stacktrace missing information (Issue #12078)
- Forward declaration of a class? E.g. for Clone() function.
email lifepillar 2023 Mar 26
- Cannot use an object method in a lambda #12417
Define all methods before compiling them?
- Cannot call class member of funcref type (Issue #12324)
Also #12081 first case.
- Using list of functions does not work #12081 (repro in later message).
- First argument of call() cannot be "obj.Func". (#11865)
- Getting member of variable with "any" type should be handled at runtime.
Remove temporary solution from #12096 / patch 9.0.1375.
- Private methods?
either: private def Func()
or: def _Func()
Perhaps use "private" keyword instead of "_" prefix?
- "final" object members - can only be set in the constructor.
- "obj.Method()" does not always work in a compiled function, assumes "obj"
is a dictionary. #12196 Issue #12024 might be the same problem.
Issue #11822: any.Func() can be a dict or an object call, need to handle
this at runtime. Also see #12198 for an example.
Possibly issue #11981 can be fixed at the same time (has two examples).
- accept line breaks in member initialization. #11957
- Support export/import of classes and interfaces.
- Make ":defcompile ClassName" compile all functions and methods in the
class.
- Forward declaration of a class? E.g. for Clone() function.
Email lifepillar 2023 Mar 26
- object empty(), len() - can class define a method to be used for them?
- add to help: when using a default new() method then reordering object
members may cause trouble. Can define new() without arguments to avoid.
- TODO items: check types for "implements" - members and methods
- When "Meta" is a class, is "const MetaAlias = Meta" allowed? It should
either work or given an error. possibly give an error now and implement it
either work or given an error. Possibly give an error now and implement it
later (using a typedef). #12006
- how about lock/unlock?
- When checking "implements" also check types of members and function args.
- For chaining, allow using the class name as type for function return
value.
- Implement "specifies" interface
- Implement generics
- Add "instanceof" (exact class name). And "assignable" (class or child)?
- Add "assignable" (class or child)?
- More efficient way for interface member index than iterating over list?
- a variant of type() that returns a different type for each class?
list<number> and list<string> should also differ.
@@ -173,20 +168,16 @@ Further Vim9 improvements, possibly after launch:
- Implement as part of an expression: ++expr, --expr, expr++, expr--.
Information missing in terminfo:
- Codes used for focus gained and lost termcodes are hard-coded in
set_termname(), not named.
- t_fe enable focus-event tracking
- t_fd disable focus-event tracking
- Accept "hyper" and "meta" modifiers (16 and 32) from Kitty like Meta?
8 is actually "super".
- t_RV request terminal version string; xterm: "\033[>c"
change in terminfo for "RV" uses the wrong escape sequence 7 - 14 Jan only
- Codes for <PasteStart> t_PS and <PasteEnd> t_PE; with bracketed paste:
t_BE and t_BD.
- Codes used for focus gained and lost (currently using use_xterm_like_mouse())
termcodes are hard-coded in set_termname(), not named.
Use the XF flag? enables recognizing the focus in/out events.
Check if t_fe is not empty.
Check for "1004" in t_XM. (disadvantage: only focus events when mouse is
used)
- t_fe enable focus-event tracking
- t_fd disable focus-event tracking
Modifiers for various keys
- flag to indicate "xterm compatible modifiers" ?
Underline and similar:
@@ -356,6 +347,12 @@ Autoconf: must use autoconf 2.69, later version generates lots of warnings
Problem with Visual highlight when 'linebreak' and 'showbreak' are set.
#11272
'cindent': compound literal indented wrong. Check for " = " before "{"?
#12491
GUI Scroll test fails on FreeBSD when using Motif. See FIXME in
Test_scrollbars in src/test_gui.vim
Selected index returned by complete_info() does not match the index in the
list of items. #12230
@@ -383,6 +380,9 @@ Add BufDeletePost. #11041
Add winid arg to col() and charcol() #11466 (request #11461)
'switchbuf' set to "newtab" does not work for ":cfirst" when in the quickfix
window. #12436
When :argument has a non-number argument, use it like :buffer to find the
argument by name. #12272
@@ -408,6 +408,10 @@ PR #11579 to add visualtext(), return Visually selected text.
PR #12032: Support Python 3 stable ABI.
PR #11860: Add more info to 'colorcolumn': display a character and highlight
for each separate entry. Disadvantage: option value gets very complicated
with multiple entries, e.g. every 8 columns.
Stray characters in the shell #11719, caused by requesting a response for:
- XT key sequences
- Whether modifyOtherKeys is active
@@ -472,6 +476,10 @@ To avoid flicker: add an option that when a screen clear is requested, instead
of clearing it draws everything and uses "clear to end of line" for every line.
Resetting 't_ut' already causes this?
Instead of prefixing "INTERNAL" to internal messages, add a message in iemsg()
and siemsg() and translate it. Messages only given to them don't need
translation.
When scheme can't be found by configure there is no clear "not found" message:
configure:5769: checking MzScheme install prefix
configure:5781: result:
@@ -489,7 +497,10 @@ Idea: when typing ":e /some/dir/" and "dir" does not exist, highlight in red.
initialization to figure out the default value from 'shell'. Add a test for
this.
Support translations for plugins: #11637
Add a diff() function to use the built-in diff support in a script.
#12321 Is the returned value in the right form now?
Support translations for plugins: #11637 PR: #12447
- Need a tool like xgettext for Vim script, generates a .pot file.
Need the equivalent of _() and N_(), perhaps TR() and TRN().
- Instructions for how to create .po files and translate.
@@ -541,6 +552,8 @@ New English spell files also have very slow suggestions.
When 'spelloptions' is "camel" then zG doesn't work on some words.
(Gary Johnson, 17 Oct 2022)
SpellCap doesn't show below a closed fold. #12420
'cdpath' problems:
- Adding "~" to 'cdpath' doesn't work for completion? (Davido, 2013 Aug 19)
- Problem with 'cdpath' on MS-Windows when a directory is equal to $HOME.
@@ -558,6 +571,11 @@ to tell which value from getvvcol() should be used. (#7964)
Value returned by virtcol() changes depending on how lines wrap. This is
inconsistent with the documentation.
When 'wildignore' has an entry ending in "/*" this means nothing matching the
path before it will be added. When encountering a directory check this and if
there is a match do not scan the directory (possibly speeds up :find a lot).
#12482
globpath() does not use 'wildignorecase' at all? (related to #8350)
mksession uses :buffer instead of :edit in one place but not another. #10629
@@ -2270,10 +2288,6 @@ Diff mode out of sync. (Gary Johnson, 2010 Aug 4)
Win32: completion of file name ":e c:\!test" results in ":e c:\\!test", which
does not work. (Nieko Maatjes, 2009 Jan 8, Ingo Karkat, 2009 Jan 22)
opening/closing window causes other window with 'winfixheight' to change
height. Also happens when there is another window in the frame, if it's not
very high. (Yegappan Lakshmanan, 2010 Jul 22, Michael Peeters, 2010 Jul 22)
Using ~ works OK on 'a' with composing char, but not on 0x0418 with composing
char 0x0301. (Tony Mechelynck, 2009 Mar 4)
@@ -3511,8 +3525,6 @@ Macintosh:
8 Dragging the status line doesn't scroll but redraw.
8 When performing incremental search, should abort searching as soon as a
character is typed.
8 When the value of $MAKE contains a path, configure can't handle this.
It's an autoconf bug. Remove the path from $MAKE to work around it.
8 How to set VIMRC_FILE to \"something\" for configure? Why does this not
work: CFLAGS='-DVIMRC_FILE=\"/mydir/myfile\"' ./configure
8 The temporary file is sometimes not writable. Check for this, and use an
@@ -5494,7 +5506,6 @@ Undo:
- Undo history wrong when ":next file" re-uses a buffer. (#5426) ex_next()
should pass flag to do_argfile(), then to do_ecmd(). Is there a test for
this?
- Add buffer argument to undotree(). (#4001)
- Undo problem: "g-" doesn't go back, gets stuck. (Björn Linse, 2016 Jul 18)
- Undo message is not always properly displayed. Patch by Ken Takata, 2013
oct 3. Doesn't work properly according to Yukihiro Nakadaira.

View File

@@ -46,8 +46,8 @@ II) It is allowed to distribute a modified (or extended) version of Vim,
maintainer will do with your changes and under what license they
will be distributed is negotiable. If there has been no negotiation
then this license, or a later version, also applies to your changes.
The current maintainer is Bram Moolenaar <Bram@vim.org>. If this
changes it will be announced in appropriate places (most likely
The current maintainers are listed here: https://github.com/orgs/vim/people.
If this changes it will be announced in appropriate places (most likely
vim.sf.net, www.vim.org and/or comp.editors). When it is completely
impossible to contact the maintainer, the obligation to send him
your changes ceases. Once the maintainer has confirmed that he has

View File

@@ -111,9 +111,19 @@ use CTRL-G u. This is useful if you want an insert command to be undoable in
parts. E.g., for each sentence. |i_CTRL-G_u|
Setting the value of 'undolevels' also closes the undo block. Even when the
new value is equal to the old value. In |Vim9| script: >
&undolevels = &undolevels
new value is equal to the old value. Use `g:undolevels` to explicitly read
and write only the global value of 'undolevels'. In |Vim9| script: >
&g:undolevels = &g:undolevels
In legacy script: >
let &g:undolevels = &g:undolevels
Note that the similar-looking assignment `let &undolevels=&undolevels` does not
preserve the global option value of 'undolevels' in the event that the local
option has been set to a different value. For example: >
" Start with different global and local values for 'undolevels'.
let &g:undolevels = 1000
let &l:undolevels = 2000
" This assignment changes the global option to 2000:
let &undolevels = &undolevels
==============================================================================
@@ -366,12 +376,20 @@ undo is possible. Use this if you are running out of memory.
When you set 'undolevels' to -1 the undo information is not immediately
cleared, this happens at the next change. To force clearing the undo
information you can use these commands: >
:let old_undolevels = &undolevels
:set undolevels=-1
:let old_undolevels = &l:undolevels
:setlocal undolevels=-1
:exe "normal a \<BS>\<Esc>"
:let &undolevels = old_undolevels
:let &l:undolevels = old_undolevels
:unlet old_undolevels
Note use of `&l:undolevels` to explicitly read the local value of 'undolevels'
and the use of `:setlocal` to change only the local option (which takes
precedence over the corresponding global option value). Saving the option value
via the use of `&undolevels` is unpredictable; it reads either the local value
(if one has been set) or the global value (otherwise). Also, if a local value
has been set, changing the option via `:set undolevels` will change both the
global and local values, requiring extra work to save and restore both values.
Marks for the buffer ('a to 'z) are also saved and restored, together with the
text.

View File

@@ -1,4 +1,4 @@
*userfunc.txt* For Vim version 9.0. Last change: 2023 Feb 02
*userfunc.txt* For Vim version 9.0. Last change: 2023 May 23
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -51,6 +51,13 @@ define a global function.
{name} can also be a |Dictionary| entry that is a
|Funcref|: >
:function dict.init
< Note that {name} is not an expression, you cannot use
a variable that is a function reference. You can use
this dirty trick to list the function referred to with
variable "Funcref": >
let g:MyFuncref = Funcref
func g:MyFuncref
unlet g:MyFuncref
:fu[nction] /{pattern} List functions with a name matching {pattern}.
Example that lists all functions ending with "File": >

View File

@@ -1,4 +1,4 @@
*usr_05.txt* For Vim version 9.0. Last change: 2019 May 23
*usr_05.txt* For Vim version 9.0. Last change: 2023 Sep 12
VIM USER MANUAL - by Bram Moolenaar
@@ -308,17 +308,27 @@ This switches on three very clever mechanisms:
*restore-cursor* *last-position-jump* >
autocmd BufReadPost *
\ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit'
\ | exe "normal! g`\""
\ | endif
augroup RestoreCursor
autocmd!
autocmd BufReadPost *
\ let line = line("'\"")
\ | if line >= 1 && line <= line("$") && &filetype !~# 'commit'
\ && index(['xxd', 'gitrebase'], &filetype) == -1
\ | execute "normal! g`\""
\ | endif
augroup END
Another autocommand. This time it is used after reading any file. The
complicated stuff after it checks if the '" mark is defined, and jumps to it
if so. The backslash at the start of a line is used to continue the command
from the previous line. That avoids a line getting very long.
See |line-continuation|. This only works in a Vim script file, not when
typing commands at the command-line.
if so. It doesn't do that for a commit or rebase message, which are likely
a different one than last time, and when using xxd(1) to filter and edit
binary files, which transforms input files back and forth, causing them to
have dual nature, so to speak. See also |using-xxd|.
The backslash at the start of a line is used to continue the command from the
previous line. That avoids a line getting very long. See |line-continuation|.
This only works in a Vim script file, not when typing commands at the
command line.
>
command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
@@ -417,6 +427,15 @@ an archive or as a repository. For an archive you can follow these steps:
Here "fancytext" is the name of the package, it can be anything
else.
Adding the editorconfig package *editorconfig-install*
Similar to the matchit package, to load the distributed editorconfig plugin
when Vim starts, add the following line to your vimrc file: >
packadd! editorconfig
After restarting your Vim, the plugin is active and you can read about it at: >
:h editorconfig.txt
More information about packages can be found here: |packages|.
==============================================================================
@@ -436,13 +455,18 @@ The global plugins will be discussed first, then the filetype ones
|add-filetype-plugin|.
GLOBAL PLUGINS *standard-plugin*
GLOBAL PLUGINS *standard-plugin* *distributed-plugins*
When you start Vim, it will automatically load a number of global plugins.
You don't have to do anything for this. They add functionality that most
people will want to use, but which was implemented as a Vim script instead of
being compiled into Vim. You can find them listed in the help index
|standard-plugin-list|. Also see |load-plugins|.
|standard-plugin-list|.
For locally installed plugins and packages (which come with a separated help
file) a similar list can be found in the help section |local-additions|.
Also see |load-plugins|.
*add-global-plugin*
You can add a global plugin to add functionality that will always be present

View File

@@ -877,6 +877,7 @@ Other computation: *bitwise-function*
srand() initialize seed used by rand()
Variables: *var-functions*
instanceof() check if a variable is an instance of a given class
type() type of a variable as a number
typename() type of a variable as text
islocked() check if a variable is locked
@@ -1232,6 +1233,7 @@ Inter-process communication: *channel-functions*
json_decode() decode a JSON string to Vim types
js_encode() encode an expression to a JSON string
js_decode() decode a JSON string to Vim types
err_teapot() give error 418 or 503
Jobs: *job-functions*
job_start() start a job
@@ -1372,7 +1374,7 @@ Various: *various-functions*
libcallnr() idem, returning a number
undofile() get the name of the undo file
undotree() return the state of the undo tree
undotree() return the state of the undo tree for a buffer
shiftwidth() effective value of 'shiftwidth'

View File

@@ -173,9 +173,8 @@ enabled from the Makefile.
--prefix={directory} Top directory where to install Vim.
--with-features=tiny Compile with many features disabled.
--with-features=small Compile with some features disabled.
--with-features=big Compile with more features enabled.
--with-features=tiny Compile with some features disabled.
--with-features=normal Compile with more features enabled.
--with-features=huge Compile with most features enabled.
See |+feature-list| for which feature
is enabled in which case.

View File

@@ -1,4 +1,4 @@
*various.txt* For Vim version 9.0. Last change: 2022 Dec 13
*various.txt* For Vim version 9.0. Last change: 2023 Sep 27
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -320,15 +320,13 @@ g8 Print the hex values of the bytes used in the
The first column shows the smallest version in which
they are included:
T tiny (always)
S small
N normal
B big
H huge
m manually enabled or depends on other features
- never, feature was removed
(none) system dependent
Thus if a feature is marked with "N", it is included
in the normal, big and huge versions of Vim.
in the normal and huge versions of Vim.
*+feature-list*
*+acl* |ACL| support included
@@ -450,6 +448,8 @@ m *+python* Python 2 interface |python|
m *+python/dyn* Python 2 interface |python-dynamic| |/dyn|
m *+python3* Python 3 interface |python|
m *+python3/dyn* Python 3 interface |python-dynamic| |/dyn|
m *+python3/dyn-stable*
Python 3 interface |python-dynamic| |python-stable| |/dyn|
N *+quickfix* |:make| and |quickfix| commands
N *+reltime* |reltime()| function, 'hlsearch'/'incsearch' timeout,
'redrawtime' option
@@ -501,6 +501,7 @@ T *+windows* more than one window; Always enabled since 8.0.1118.
m *+writebackup* |'writebackup'| is default on
m *+xim* X input method |xim|
*+xfontset* X fontset support |xfontset|
N *+xattr* compiled with extended attribute support (Linux only)
*+xpm* pixmap support
m *+xpm_w32* Win32 GUI only: pixmap support |w32-xpm-support|
*+xsmp* XSMP (X session management) support

View File

@@ -4627,7 +4627,7 @@ using an #ifdef. (Sergey Khorev)
Mzscheme interface didn't link, missing function. Changed order of libraries
in the configure script.
Ruby interface didn't compile on Mac. Changed #ifdef. (Kevin Ballard)
Ruby interface didn't compile on Mac. Changed #ifdef. (Lily Ballard)
Patch 7.1b.001 (extra)
Problem: Random text in a source file. No idea how it got there.

View File

@@ -1,4 +1,4 @@
*version9.txt* For Vim version 9.0. Last change: 2022 Nov 23
*version9.txt* For Vim version 9.0. Last change: 2023 Aug 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -43,6 +43,17 @@ when the release was being prepared. Sven was a long time supporter of Vim.
He registered the vim.org domain and created the first Vim website. We will
remember him!
*Bram* *Moolenaar* *Bram-Moolenaar*
Vim version 9.1 is dedicated to Bram Moolenaar, who passed away on August 3rd
2023 while still working full-time on Vim. The Vim project would not exist
without his ongoing passion to lead and develop Vim and the community for more
than 30 years. Bram was also passionate about his |ICCF| foundation to help
children in Uganda. If you enjoy using Vim, please consider donating! We will
miss his guidance, passion and leadership.
Obituary Articles: https://github.com/vim/vim/discussions/12742
Say Farewell: https://github.com/vim/vim/discussions/12737
==============================================================================
NEW FEATURES *new-9*
@@ -1187,7 +1198,7 @@ Solution: Use "curtab" if "tp" is NULL. (closes #5475)
Files: src/evalwindow.c, src/testdir/test_getvar.vim
Patch 8.2.0118
Problem: Crash when cycling to buffers involving popup window .
Problem: Crash when cycling to buffers involving popup window.
Solution: Do not decrement buffer reference count.
Files: src/popupwin.c, src/testdir/test_popupwin.vim,
src/testdir/dumps/Test_popupwin_infopopup_7.dump
@@ -31668,4 +31679,85 @@ Solution: make menu generation script use Vim9 script, fix errors.
Files: runtime/makemenu.vim
==============================================================================
VERSION 9.1 *version-9.1* *version9.1* *vim-9.1*
This section is about improvements made between version 9.0 and 9.1.
This release has hundreds of bug fixes, there are a few new features and there
are many minor improvements.
Vim9 classes
------------
Virtual text
------------
Smooth Scroll
-------------
Other improvements *new-other-9.1*
------------------
Changed *changed-9.1*
-------
Added *added-9.1*
-----
Various syntax, indent and other plugins were added.
Functions: ~
|err_teapot()| produce error 418 or 503
|getbufoneline()| get a one line from the specified buffer
|getcellwidths()| get character cell width overrides
|getmouseshape()| get name of the current mouse shape
|getscriptinfo()| get list of sourced vim scripts
|indexof()| index in a List or Blob of a true expression
|instanceof()| check if a variable is an instance of a given class
|keytrans()| translate internal key codes to be usable with |:map|
|popup_findecho()| get window ID for popup used for |:echowindow|
|setcmdline()| set the current command line
|strutf16len()| number of UTF-16 code units in a string
|swapfilelist()| list of existing swap files in 'directory'
|test_mswin_event()| generate an MS-Windows event for testing
|utf16idx()| UTF-16 index of a byte in a string
Autocommands: ~
|TextChangedT| after a change was made to the text in Terminal mode
|WinResized| after a window in the current tab page is resized
Commands: ~
|:abstract| define an Vim9 abstract class
|:class| start of a class specification
|:defer| call function when current function is done
|:echowindow| same as :echomsg, but use a popup window
|:endinterface| end of an interface specification
|:endclass| end of a class specification
|:horizontal| following window command work horizontally
|:interface| start of an interface specification
|:public| prefix for a class or object member
|:static| prefix for a class member or function
|:this| prefix for an object member
Options: ~
'jumpoptions' specifies how jumping is done
'keyprotocol' what keyboard protocol to use for what terminal
'lispoptions' changes how Lisp indenting is done
'showcmdloc' where to show (partial) command
'smoothscroll' scroll by screen lines when 'wrap' is set
'splitkeep' determines scroll behavior for split windows
Patches *patches-9.1*
-------
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@@ -1,4 +1,4 @@
.TH VIM 1 "22 febbraio 2002"
.TH VIM 1 "13 giugno 2022"
.SH NOME
vim \- VI Migliorato, un editor di testi per programmatori
.SH SINTASSI
@@ -35,17 +35,17 @@ Un editore di testi, compatibile con, e migliore di, Vi.
Pu<EFBFBD> essere usato per editare qualsiasi file di testo.
Particolarmente utile per editare programmi.
.PP
Ci sono parecchi miglioramenti rispetto a Vi: undo multipli,
finestre e buffer multipli, evidenziazione sintattica, possibilit<69>
di modificare la linea di comando, completamento nomi file, help
in linea, selezione testi in Modo Visual, etc..
Ci sono parecchi miglioramenti rispetto a Vi: undo multipli, finestre e buffer
multipli, evidenziazione sintattica, possibilit<69> di modificare la riga di comando,
completamento nomi file, help in linea, selezione testi in Modo Visual, etc..
Vedere ":help vi_diff.txt" per un sommario delle differenze fra
.B Vim
e Vi.
.PP
Mentre usate
.B Vim
potete ricevere molto aiuto dal sistema di help online, col comando ":help".
potete ricevere molto aiuto dal sistema di help online, col comando
":help".
Vedere qui sotto la sezione AIUTO ONLINE.
.PP
Quasi sempre
@@ -69,18 +69,16 @@ Una lista di nomi di file.
Il primo di questi sar<61> il file corrente, e verr<72> letto nel buffer.
Il cursore sar<61> posizionato sulla prima linea del buffer.
Potete arrivare agli altri file col comando ":next".
Per editare un file il cui nome inizia per "\-" premettete "\-\-" alla
lista_file.
Per editare un file il cui nome inizia per "\-" premettete "\-\-" alla lista_file.
.TP
\-
Il file da editare <20> letto dallo "stdin" [di solito, ma non
necessariamente, il terminale \- NdT]. I comandi sono letti da "stderr",
che dovrebbe essere un terminale [tty].
Il file da editare <20> letto dallo "stdin"-
I comandi sono letti da "stderr", che dovrebbe essere un terminale [tty].
.TP
\-t {tag}
Il file da editare e la posizione iniziale del cursore dipendono da "tag",
una specie di "etichetta" a cui saltare.
{tag} viene cercata nel file "tags", ed il file ad essa associato diventa
{tag} viene cercata nel file "tags", e il file a essa associato diventa
quello corrente, ed il comando ad essa associato viene eseguito.
Di solito si usa per programmi C, nel qual caso {tag} potrebbe essere un
nome di funzione.
@@ -129,9 +127,8 @@ della shell o sospendere
.B Vim.
Si pu<70> chiedere la stessa cosa anche con l'argomento "\-Z".
.SH OPZIONI
Le opzioni possono essere in un ordine qualsiasi, prima o dopo i nomi di
file. Opzioni che non necessitano un argomento possono essere specificate
dietro a un solo "\-".
Le opzioni possono essere in un ordine qualsiasi, prima o dopo i nomi di file.
Opzioni che non hanno un argomento si possono specificare dietro a un solo "\-".
.TP 12
+[numero]
Per il primo file il cursore sar<61> posizionato sulla linea "numero".
@@ -145,8 +142,7 @@ Vedere ":help search\-pattern" per come specificare l'espressione.
+{comando}
.TP
\-c {comando}
{comando} sar<61> eseguito dopo che il
primo file <20> stato letto.
{comando} sar<61> eseguito dopo che il primo file <20> stato letto.
{comando} <20> interpretato come un comando Ex.
Se il {comando} contiene spazi deve essere incluso fra doppi apici
(o altro delimitatore, a seconda della shell che si sta usando).
@@ -164,14 +160,13 @@ argomento specificato).
\-\-cmd {comando}
Come "\-c", ma il comando <20> eseguito PRIMA
di eseguire qualsiasi file vimrc.
Si possono usare fino a 10 di questi comandi, indipendentemente dai comandi
"\-c".
Si possono usare fino a 10 di questi comandi, indipendentemente dai comandi "\-c".
.TP
\-A
Se
.B Vim
<EFBFBD> stato compilato con supporto Arabic per editare file con orientamento
destra-sinistra e tastiera con mappatura Araba, questa opzione inizia
<EFBFBD> stato compilato con supporto ARABIC per editare file con orientamento
destra-sinistra e tastiera con mappatura araba, questa opzione inizia
.B Vim
in Modo Arabic, cio<69> impostando 'arabic'.
Altrimenti viene dato un messaggio di errore e
@@ -187,8 +182,7 @@ binario o un programma eseguibile.
Compatibile. Imposta l'opzione 'compatible'.
In questo modo
.B Vim
ha quasi lo stesso comportamento di Vi, anche in presenza di un file
di configurazione .vimrc [proprio di Vim, vi usa .exrc \- Ndt].
ha quasi lo stesso comportamento di Vi, anche in presenza di un file .vimrc.
.TP
\-d
Inizia in Modo Diff [differenze].
@@ -274,7 +268,8 @@ termina in modo anormale.
\-i {viminfo}
Se <20> abilitato l'uso di un file viminfo, questa opzione indica il nome
del file da usare invece di quello predefinito "~/.viminfo".
Si pu<70> anche evitare l'uso di un file .viminfo, dando come nome "NONE".
Si pu<70> anche evitare l'uso di un file .viminfo, dando come nome
"NONE".
.TP
\-L
Equivalente a \-r.
@@ -285,8 +280,8 @@ Imposta le opzioni 'lisp' e 'showmatch'.
.TP
\-m
Inibisce modifica file.
Annulla l'opzione 'write'.
<EFBFBD> ancora possibile modificare un buffer [in memoria \- Ndt], ma non scriverlo.
Inibisce l'opzione 'write'.
<EFBFBD> ancora possibile modificare un buffer, ma non riscriverlo.
.TP
\-M
Modifiche non permesse. Le opzioni 'modifiable' e 'write' sono annullate,
@@ -318,19 +313,23 @@ Se N manca, apri una finestra per ciascun file.
Apri N finestre, in verticale.
Se N manca, apri una finestra per ciascun file.
.TP
\-p[N]
Apri N pagine di linguette.
Quando N <20> omesso, apri una pagine di linguette per ciascun file.
.TP
\-R
Modo Read-only (Sola Lettura).
Imposta l'opzione 'readonly'.
Si pu<70> ancora modificare il buffer, ma siete protetti da una riscrittura
Si pu<70> ancora modificare il buffer, ma il file <20> protetto da una riscrittura
involontaria.
Se volete davvero riscrivere il file, aggiungete un punto esclamativo
Se si vuole davvero riscrivere il file, occorre aggiungere un punto esclamativo
al comando Ex, come in ":w!".
L'opzione \-R implica anche l'opzione \-n (vedere sotto).
L'opzione 'readonly' pu<70> essere annullata con ":set noro".
Vedere ":help 'readonly'".
.TP
\-r
Lista file di swap, assieme a dati utili per un recupero.
Lista file di swap, e informazioni su come usarli per ripristinare file.
.TP
\-r {file}
Modo Recovery (ripristino).
@@ -345,10 +344,10 @@ Modo silenzioso. Solo quando invocato come "Ex" o quando l'opzione
.TP
\-s {scriptin}
Lo script file {scriptin} <20> letto.
I caratteri nel file sono interpretati come se immessi da voi.
Lo stesso si pu<70> ottenere col comando ":source! {scriptin}".
I caratteri nel file sono interpretati come se immessi da terminale.
Lo stesso risultato si pu<70> ottenere col comando ":source! {scriptin}".
Se la fine del file di input viene raggiunta prima che Vim termini,
l'ulteriore input viene preso dalla tastiera.
l'ulteriore input verr<EFBFBD> preso dalla tastiera.
.TP
\-T {terminale}
Dice a
@@ -357,28 +356,25 @@ quale tipo di terminale state usando.
Utile solo se il terminale non viene riconosciuto correttamente da Vim.
Dovrebbe essere un terminale noto a
.B Vim
(internamente) o definito nel file termcap o terminfo.
(internamente) o definito nei file termcap o terminfo.
.TP
\-u {vimrc}
Usa i comandi nel file {vimrc} per inizializzazioni.
Tutte le altre inizializzazioni non sono eseguite.
Usate questa opzione per editare qualche file di tipo speciale.
Pu<EFBFBD> anche essere usato per non fare alcuna inizializzazione dando
come nome "NONE".
Si possono anche omettere tutte le inizializzazioni dando come nome "NONE".
Vedere ":help initialization" da vim per ulteriori dettagli.
.TP
\-U {gvimrc}
Usa i comandi nel file {gvimrc} per inizializzazioni GUI.
Tutte le altre inizializzazioni GUI non sono eseguite.
Pu<EFBFBD> anche essere usata per non fare alcuna inizializzazione GUI dando
come nome "NONE".
Si possono anche omettere tutte le inizializzazioni GUI dando come nome "NONE".
Vedere ":help gui-init" da vim per ulteriori dettagli.
.TP
\-V[N]
Verboso. Vim manda messaggi relativi agli script file che esegue
Verboso. Vim manda messaggi relativi ai file di script che esegue
e quando legge o scrive un file viminfo. Il numero opzionale N <20> il valore
dell'opzione 'verbose'.
Il valore predefinito <20> 10.
dell'opzione 'verbose'. Il valore predefinito <20> 10.
.TP
\-v
Inizia
@@ -388,7 +384,7 @@ effetto solo quando Vim viene invocato con il nome "ex".
.TP
\-w {scriptout}
Ogni carattere immesso viene registrato nel file {scriptout},
finch<EFBFBD> non uscite da
finch<EFBFBD> non si esce da
.B Vim.
Utile se si vuole creare uno script file da usare con "vim \-s" o
":source!".
@@ -398,40 +394,41 @@ Se il file {scriptout} esiste, quel che immettete viene aggiunto in fondo.
Come \-w, ma uno script file esistente viene sovrascritto.
.TP
\-x
Uso di cifratura nella scrittura dei file. E' necessario immettere
una chiave di cifratura.
Uso di cifratura nella scrittura dei file. Verr<EFBFBD> chiesta una chiave di cifratura.
.TP
\-X
Non connetterti al server X. Vim parte pi<70> rapidamente,
ma il titolo della finestra e la clipboard non sono disponibili.
Non connettersi al server X. Vim parte pi<70> rapidamente,
ma il titolo della finestra e la clipboard non sono usati.
.TP
\-y
Eseguire
.B Vim
in Modo Easy (semplificata), come se l'eseguibile invocato
sia "evim" o "eview".
in Modo Easy (semplificato), come se l'eseguibile invocato sia "evim" o "eview".
Fa s<> che
.B Vim
si comporti come un editor che usa solo il mouse e i caratteri.
.TP
\-Z
Modo ristretto. Vim si comporta come se invocato con un nome
che inizia per "r".
Modo ristretto. Vim si comporta come se invocato con un nome che inizia per "r".
.TP
\-\-
Specifica la fine delle opzioni.
Argomenti specificati dopo questo sono considerati nomi file.
Si pu<70> usare per editare un file il cui nome inizi per '-'.
.TP
\-\-clean
Richiede di non usare alcun file di personalizzazione (vimrc, plugin, etc.).
Utile per verificare se un problema persiste invocando Vim "originale".
.TP
\-\-echo\-wid
Solo con GUI GTK: Visualizza Window ID su "stdout".
Solo per GUI GTK: Visualizza Window ID su "stdout".
.TP
\-\-help
Vim d<> un messaggio ed esce, come con l'argomento "\-h".
.TP
\-\-literal
Considera i nomi passati come argomenti letterali, senza espandere
metacaratteri. Non necessario in Unix, la shell espande i metacaratteri.
Considera i nomi passati come argomenti letterali, senza espandere metacaratteri.
Non ha effetto in Unix, dove la shell espande comunque i metacaratteri.
.TP
\-\-noplugin
Non caricare plugin. Implicito se si specifica \-u NONE.
@@ -442,8 +439,7 @@ argomenti. Se non si trova un server viene dato un messaggio e i file sono
editati nel Vim corrente.
.TP
\-\-remote\-expr {expr}
Connettersi a un server Vim, valutare ivi {expr} e stampare il risultato
su "stdout".
Connettersi a un server Vim, valutare {expr} e stampare il risultato su "stdout".
.TP
\-\-remote\-send {chiavi}
Connettersi a un server Vim e spedirgli {chiavi}.
@@ -458,16 +454,17 @@ Come \-\-remote, ma Vim non termina finch
Come \-\-remote\-wait, ma senza avvisare se non si trova un server.
.TP
\-\-serverlist
Lista i nomi di tutti i server Vim disponibili.
Elenca i nomi di tutti i server Vim disponibili.
.TP
\-\-servername {nome}
Usa {nome} come nome server. Usato per il Vim corrente, a meno che sia
usato con l'argomento \-\-remote, nel qual caso indica il server a cui
connettersi.
Usa {nome} come nome server. Usato per il Vim corrente, a meno che sia usato
con l'argomento \-\-remote, nel qual caso indica il server a cui connettersi.
.TP
\-\-socketid {id}
Solo con GUI GTK: Usa il meccanismo GtkPlug per eseguire gvim in un'altra
finestra.
Solo per GUI GTK: Usa meccanismo GtkPlug per eseguire gvim in un'altra finestra.
.TP
\-\-startuptime {nome_file}
Durante la fase iniziale, scrive messaggi di log al file {nome_file}.
.TP
\-\-version
Stampa la versione di Vim ed esci.
@@ -477,9 +474,8 @@ Battere ":help" in
per iniziare.
Battere ":help argomento" per ricevere aiuto su uno specifico argomento.
Per esempio: ":help ZZ" per ricevere aiuto sul comando "ZZ".
Usare <Tab> e CTRL\-D per completare gli argomenti
(":help cmdline\-completion").
Ci sono "tag" nei file di help per saltare da un argomento a un altro
Usare <Tab> e CTRL\-D per completare gli argomenti (":help cmdline\-completion").
Ci sono "tag" nei file di help per passare da un argomento a un altro
(simili a legami ipertestuali, vedere ":help").
Tutti i file di documentazione possono essere navigati cos<6F>. Ad es.:
":help syntax.txt".
@@ -489,7 +485,7 @@ Tutti i file di documentazione possono essere navigati cos
I file di documentazione di
.B Vim
.
Usate ":help doc\-file\-list" per avere la lista completa.
Usare ":help doc\-file\-list" per avere la lista completa.
.TP
/usr/local/lib/vim/doc/tags
Il file di tags usato per trovare informazioni nei file di documentazione.
@@ -506,7 +502,7 @@ Inizializzazioni
a livello di sistema.
.TP
~/.vimrc
Le vostre personali inizializzazioni di
Inizializzazioni personali di
.B Vim
.
.TP
@@ -514,11 +510,10 @@ Le vostre personali inizializzazioni di
Inizializzazioni gvim a livello di sistema.
.TP
~/.gvimrc
Le vostre personali inizializzazioni di gvim.
Inizializzazioni personali di
.TP
/usr/local/lib/vim/optwin.vim
Script Vim usato dal comando ":options", un modo semplice
per visualizzare e impostare opzioni.
Script Vim usato dal comando ":options", da usare per visualizzare e impostare opzioni.
.TP
/usr/local/lib/vim/menu.vim
Inizializzazioni del men<65> gvim a livello di sistema.
@@ -527,12 +522,10 @@ Inizializzazioni del men
Script Vim per generare una segnalazione di errore. Vedere ":help bugs".
.TP
/usr/local/lib/vim/filetype.vim
Script Vim per determinare il tipo di un file a partire dal suo nome.
Vedere ":help 'filetype'".
Script Vim per determinare il tipo di un file dal suo nome. Vedere ":help 'filetype'".
.TP
/usr/local/lib/vim/scripts.vim
Script Vim per determinare il tipo di un file a partire dal suo contenuto.
Vedere ":help 'filetype'".
Script Vim per determinare il tipo di un file dal suo contenuto. Vedere ":help 'filetype'".
.TP
/usr/local/lib/vim/print/*.ps
File usati per stampa PostScript.
@@ -545,7 +538,7 @@ vimtutor(1)
.SH AUTORE
Buona parte di
.B Vim
<EFBFBD> stato scritto da Bram Moolenaar, con molto aiuto da altri.
<EFBFBD> stato scritto da Bram Moolenaar, con molto aiuto da parte di altri.
Vedere ":help credits" in
.B Vim.
.br
@@ -557,10 +550,9 @@ In verit
Probabili.
Vedere ":help todo" per una lista di problemi noti.
.PP
Si noti che un certo numero di comportamenti che possono essere considerati
errori da qualcuno, sono in effetti causati da una riproduzione fin troppo
fedele del comportamento di Vi.
Se ritenete che altre cose siano errori "perch<63> Vi si comporta diversamente",
date prima un'occhiata al file vi_diff.txt
(o battere :help vi_diff.txt da Vim).
Date anche un'occhiata alle opzioni 'compatible' e 'cpoptions.
Si noti che un certo numero di comportamenti che possono essere considerati errori
da qualcuno, sono in effetti causati da una riproduzione fin troppo fedele del
comportamento di Vi. Se si ritiene che altre cose siano errori "perch<63> Vi si comporta
diversamente", si dia prima un'occhiata al file vi_diff.txt (o si immetta
:help vi_diff.txt da Vim).
Un'occhiata va data anche alle opzioni 'compatible' e 'cpoptions.

View File

@@ -1,4 +1,4 @@
.TH VIM 1 "22 febbraio 2002"
.TH VIM 1 "13 giugno 2022"
.SH NOME
vim \- VI Migliorato, un editor di testi per programmatori
.SH SINTASSI
@@ -35,17 +35,17 @@ Un editore di testi, compatibile con, e migliore di, Vi.
Può essere usato per editare qualsiasi file di testo.
Particolarmente utile per editare programmi.
.PP
Ci sono parecchi miglioramenti rispetto a Vi: undo multipli,
finestre e buffer multipli, evidenziazione sintattica, possibilità
di modificare la linea di comando, completamento nomi file, help
in linea, selezione testi in Modo Visual, etc..
Ci sono parecchi miglioramenti rispetto a Vi: undo multipli, finestre e buffer
multipli, evidenziazione sintattica, possibilità di modificare la riga di comando,
completamento nomi file, help in linea, selezione testi in Modo Visual, etc..
Vedere ":help vi_diff.txt" per un sommario delle differenze fra
.B Vim
e Vi.
.PP
Mentre usate
.B Vim
potete ricevere molto aiuto dal sistema di help online, col comando ":help".
potete ricevere molto aiuto dal sistema di help online, col comando
":help".
Vedere qui sotto la sezione AIUTO ONLINE.
.PP
Quasi sempre
@@ -69,18 +69,16 @@ Una lista di nomi di file.
Il primo di questi sarà il file corrente, e verrà letto nel buffer.
Il cursore sarà posizionato sulla prima linea del buffer.
Potete arrivare agli altri file col comando ":next".
Per editare un file il cui nome inizia per "\-" premettete "\-\-" alla
lista_file.
Per editare un file il cui nome inizia per "\-" premettete "\-\-" alla lista_file.
.TP
\-
Il file da editare è letto dallo "stdin" [di solito, ma non
necessariamente, il terminale \- NdT]. I comandi sono letti da "stderr",
che dovrebbe essere un terminale [tty].
Il file da editare è letto dallo "stdin"-
I comandi sono letti da "stderr", che dovrebbe essere un terminale [tty].
.TP
\-t {tag}
Il file da editare e la posizione iniziale del cursore dipendono da "tag",
una specie di "etichetta" a cui saltare.
{tag} viene cercata nel file "tags", ed il file ad essa associato diventa
{tag} viene cercata nel file "tags", e il file a essa associato diventa
quello corrente, ed il comando ad essa associato viene eseguito.
Di solito si usa per programmi C, nel qual caso {tag} potrebbe essere un
nome di funzione.
@@ -129,9 +127,8 @@ della shell o sospendere
.B Vim.
Si può chiedere la stessa cosa anche con l'argomento "\-Z".
.SH OPZIONI
Le opzioni possono essere in un ordine qualsiasi, prima o dopo i nomi di
file. Opzioni che non necessitano un argomento possono essere specificate
dietro a un solo "\-".
Le opzioni possono essere in un ordine qualsiasi, prima o dopo i nomi di file.
Opzioni che non hanno un argomento si possono specificare dietro a un solo "\-".
.TP 12
+[numero]
Per il primo file il cursore sarà posizionato sulla linea "numero".
@@ -145,8 +142,7 @@ Vedere ":help search\-pattern" per come specificare l'espressione.
+{comando}
.TP
\-c {comando}
{comando} sarà eseguito dopo che il
primo file è stato letto.
{comando} sarà eseguito dopo che il primo file è stato letto.
{comando} è interpretato come un comando Ex.
Se il {comando} contiene spazi deve essere incluso fra doppi apici
(o altro delimitatore, a seconda della shell che si sta usando).
@@ -164,14 +160,13 @@ argomento specificato).
\-\-cmd {comando}
Come "\-c", ma il comando è eseguito PRIMA
di eseguire qualsiasi file vimrc.
Si possono usare fino a 10 di questi comandi, indipendentemente dai comandi
"\-c".
Si possono usare fino a 10 di questi comandi, indipendentemente dai comandi "\-c".
.TP
\-A
Se
.B Vim
è stato compilato con supporto Arabic per editare file con orientamento
destra-sinistra e tastiera con mappatura Araba, questa opzione inizia
è stato compilato con supporto ARABIC per editare file con orientamento
destra-sinistra e tastiera con mappatura araba, questa opzione inizia
.B Vim
in Modo Arabic, cioè impostando 'arabic'.
Altrimenti viene dato un messaggio di errore e
@@ -187,8 +182,7 @@ binario o un programma eseguibile.
Compatibile. Imposta l'opzione 'compatible'.
In questo modo
.B Vim
ha quasi lo stesso comportamento di Vi, anche in presenza di un file
di configurazione .vimrc [proprio di Vim, vi usa .exrc \- Ndt].
ha quasi lo stesso comportamento di Vi, anche in presenza di un file .vimrc.
.TP
\-d
Inizia in Modo Diff [differenze].
@@ -274,7 +268,8 @@ termina in modo anormale.
\-i {viminfo}
Se è abilitato l'uso di un file viminfo, questa opzione indica il nome
del file da usare invece di quello predefinito "~/.viminfo".
Si può anche evitare l'uso di un file .viminfo, dando come nome "NONE".
Si può anche evitare l'uso di un file .viminfo, dando come nome
"NONE".
.TP
\-L
Equivalente a \-r.
@@ -285,8 +280,8 @@ Imposta le opzioni 'lisp' e 'showmatch'.
.TP
\-m
Inibisce modifica file.
Annulla l'opzione 'write'.
È ancora possibile modificare un buffer [in memoria \- Ndt], ma non scriverlo.
Inibisce l'opzione 'write'.
È ancora possibile modificare un buffer, ma non riscriverlo.
.TP
\-M
Modifiche non permesse. Le opzioni 'modifiable' e 'write' sono annullate,
@@ -318,19 +313,23 @@ Se N manca, apri una finestra per ciascun file.
Apri N finestre, in verticale.
Se N manca, apri una finestra per ciascun file.
.TP
\-p[N]
Apri N pagine di linguette.
Quando N è omesso, apri una pagine di linguette per ciascun file.
.TP
\-R
Modo Read-only (Sola Lettura).
Imposta l'opzione 'readonly'.
Si può ancora modificare il buffer, ma siete protetti da una riscrittura
Si può ancora modificare il buffer, ma il file è protetto da una riscrittura
involontaria.
Se volete davvero riscrivere il file, aggiungete un punto esclamativo
Se si vuole davvero riscrivere il file, occorre aggiungere un punto esclamativo
al comando Ex, come in ":w!".
L'opzione \-R implica anche l'opzione \-n (vedere sotto).
L'opzione 'readonly' può essere annullata con ":set noro".
Vedere ":help 'readonly'".
.TP
\-r
Lista file di swap, assieme a dati utili per un recupero.
Lista file di swap, e informazioni su come usarli per ripristinare file.
.TP
\-r {file}
Modo Recovery (ripristino).
@@ -345,10 +344,10 @@ Modo silenzioso. Solo quando invocato come "Ex" o quando l'opzione
.TP
\-s {scriptin}
Lo script file {scriptin} è letto.
I caratteri nel file sono interpretati come se immessi da voi.
Lo stesso si può ottenere col comando ":source! {scriptin}".
I caratteri nel file sono interpretati come se immessi da terminale.
Lo stesso risultato si può ottenere col comando ":source! {scriptin}".
Se la fine del file di input viene raggiunta prima che Vim termini,
l'ulteriore input viene preso dalla tastiera.
l'ulteriore input verrà preso dalla tastiera.
.TP
\-T {terminale}
Dice a
@@ -357,28 +356,25 @@ quale tipo di terminale state usando.
Utile solo se il terminale non viene riconosciuto correttamente da Vim.
Dovrebbe essere un terminale noto a
.B Vim
(internamente) o definito nel file termcap o terminfo.
(internamente) o definito nei file termcap o terminfo.
.TP
\-u {vimrc}
Usa i comandi nel file {vimrc} per inizializzazioni.
Tutte le altre inizializzazioni non sono eseguite.
Usate questa opzione per editare qualche file di tipo speciale.
Può anche essere usato per non fare alcuna inizializzazione dando
come nome "NONE".
Si possono anche omettere tutte le inizializzazioni dando come nome "NONE".
Vedere ":help initialization" da vim per ulteriori dettagli.
.TP
\-U {gvimrc}
Usa i comandi nel file {gvimrc} per inizializzazioni GUI.
Tutte le altre inizializzazioni GUI non sono eseguite.
Può anche essere usata per non fare alcuna inizializzazione GUI dando
come nome "NONE".
Si possono anche omettere tutte le inizializzazioni GUI dando come nome "NONE".
Vedere ":help gui-init" da vim per ulteriori dettagli.
.TP
\-V[N]
Verboso. Vim manda messaggi relativi agli script file che esegue
Verboso. Vim manda messaggi relativi ai file di script che esegue
e quando legge o scrive un file viminfo. Il numero opzionale N è il valore
dell'opzione 'verbose'.
Il valore predefinito è 10.
dell'opzione 'verbose'. Il valore predefinito è 10.
.TP
\-v
Inizia
@@ -388,7 +384,7 @@ effetto solo quando Vim viene invocato con il nome "ex".
.TP
\-w {scriptout}
Ogni carattere immesso viene registrato nel file {scriptout},
finché non uscite da
finché non si esce da
.B Vim.
Utile se si vuole creare uno script file da usare con "vim \-s" o
":source!".
@@ -398,40 +394,41 @@ Se il file {scriptout} esiste, quel che immettete viene aggiunto in fondo.
Come \-w, ma uno script file esistente viene sovrascritto.
.TP
\-x
Uso di cifratura nella scrittura dei file. E' necessario immettere
una chiave di cifratura.
Uso di cifratura nella scrittura dei file. Verrà chiesta una chiave di cifratura.
.TP
\-X
Non connetterti al server X. Vim parte più rapidamente,
ma il titolo della finestra e la clipboard non sono disponibili.
Non connettersi al server X. Vim parte più rapidamente,
ma il titolo della finestra e la clipboard non sono usati.
.TP
\-y
Eseguire
.B Vim
in Modo Easy (semplificata), come se l'eseguibile invocato
sia "evim" o "eview".
in Modo Easy (semplificato), come se l'eseguibile invocato sia "evim" o "eview".
Fa sì che
.B Vim
si comporti come un editor che usa solo il mouse e i caratteri.
.TP
\-Z
Modo ristretto. Vim si comporta come se invocato con un nome
che inizia per "r".
Modo ristretto. Vim si comporta come se invocato con un nome che inizia per "r".
.TP
\-\-
Specifica la fine delle opzioni.
Argomenti specificati dopo questo sono considerati nomi file.
Si può usare per editare un file il cui nome inizi per '-'.
.TP
\-\-clean
Richiede di non usare alcun file di personalizzazione (vimrc, plugin, etc.).
Utile per verificare se un problema persiste invocando Vim "originale".
.TP
\-\-echo\-wid
Solo con GUI GTK: Visualizza Window ID su "stdout".
Solo per GUI GTK: Visualizza Window ID su "stdout".
.TP
\-\-help
Vim dà un messaggio ed esce, come con l'argomento "\-h".
.TP
\-\-literal
Considera i nomi passati come argomenti letterali, senza espandere
metacaratteri. Non necessario in Unix, la shell espande i metacaratteri.
Considera i nomi passati come argomenti letterali, senza espandere metacaratteri.
Non ha effetto in Unix, dove la shell espande comunque i metacaratteri.
.TP
\-\-noplugin
Non caricare plugin. Implicito se si specifica \-u NONE.
@@ -442,8 +439,7 @@ argomenti. Se non si trova un server viene dato un messaggio e i file sono
editati nel Vim corrente.
.TP
\-\-remote\-expr {expr}
Connettersi a un server Vim, valutare ivi {expr} e stampare il risultato
su "stdout".
Connettersi a un server Vim, valutare {expr} e stampare il risultato su "stdout".
.TP
\-\-remote\-send {chiavi}
Connettersi a un server Vim e spedirgli {chiavi}.
@@ -458,16 +454,17 @@ Come \-\-remote, ma Vim non termina finché i file non sono stati editati.
Come \-\-remote\-wait, ma senza avvisare se non si trova un server.
.TP
\-\-serverlist
Lista i nomi di tutti i server Vim disponibili.
Elenca i nomi di tutti i server Vim disponibili.
.TP
\-\-servername {nome}
Usa {nome} come nome server. Usato per il Vim corrente, a meno che sia
usato con l'argomento \-\-remote, nel qual caso indica il server a cui
connettersi.
Usa {nome} come nome server. Usato per il Vim corrente, a meno che sia usato
con l'argomento \-\-remote, nel qual caso indica il server a cui connettersi.
.TP
\-\-socketid {id}
Solo con GUI GTK: Usa il meccanismo GtkPlug per eseguire gvim in un'altra
finestra.
Solo per GUI GTK: Usa meccanismo GtkPlug per eseguire gvim in un'altra finestra.
.TP
\-\-startuptime {nome_file}
Durante la fase iniziale, scrive messaggi di log al file {nome_file}.
.TP
\-\-version
Stampa la versione di Vim ed esci.
@@ -477,9 +474,8 @@ Battere ":help" in
per iniziare.
Battere ":help argomento" per ricevere aiuto su uno specifico argomento.
Per esempio: ":help ZZ" per ricevere aiuto sul comando "ZZ".
Usare <Tab> e CTRL\-D per completare gli argomenti
(":help cmdline\-completion").
Ci sono "tag" nei file di help per saltare da un argomento a un altro
Usare <Tab> e CTRL\-D per completare gli argomenti (":help cmdline\-completion").
Ci sono "tag" nei file di help per passare da un argomento a un altro
(simili a legami ipertestuali, vedere ":help").
Tutti i file di documentazione possono essere navigati così. Ad es.:
":help syntax.txt".
@@ -489,7 +485,7 @@ Tutti i file di documentazione possono essere navigati così. Ad es.:
I file di documentazione di
.B Vim
.
Usate ":help doc\-file\-list" per avere la lista completa.
Usare ":help doc\-file\-list" per avere la lista completa.
.TP
/usr/local/lib/vim/doc/tags
Il file di tags usato per trovare informazioni nei file di documentazione.
@@ -506,7 +502,7 @@ Inizializzazioni
a livello di sistema.
.TP
~/.vimrc
Le vostre personali inizializzazioni di
Inizializzazioni personali di
.B Vim
.
.TP
@@ -514,11 +510,10 @@ Le vostre personali inizializzazioni di
Inizializzazioni gvim a livello di sistema.
.TP
~/.gvimrc
Le vostre personali inizializzazioni di gvim.
Inizializzazioni personali di
.TP
/usr/local/lib/vim/optwin.vim
Script Vim usato dal comando ":options", un modo semplice
per visualizzare e impostare opzioni.
Script Vim usato dal comando ":options", da usare per visualizzare e impostare opzioni.
.TP
/usr/local/lib/vim/menu.vim
Inizializzazioni del menù gvim a livello di sistema.
@@ -527,12 +522,10 @@ Inizializzazioni del menù gvim a livello di sistema.
Script Vim per generare una segnalazione di errore. Vedere ":help bugs".
.TP
/usr/local/lib/vim/filetype.vim
Script Vim per determinare il tipo di un file a partire dal suo nome.
Vedere ":help 'filetype'".
Script Vim per determinare il tipo di un file dal suo nome. Vedere ":help 'filetype'".
.TP
/usr/local/lib/vim/scripts.vim
Script Vim per determinare il tipo di un file a partire dal suo contenuto.
Vedere ":help 'filetype'".
Script Vim per determinare il tipo di un file dal suo contenuto. Vedere ":help 'filetype'".
.TP
/usr/local/lib/vim/print/*.ps
File usati per stampa PostScript.
@@ -545,7 +538,7 @@ vimtutor(1)
.SH AUTORE
Buona parte di
.B Vim
è stato scritto da Bram Moolenaar, con molto aiuto da altri.
è stato scritto da Bram Moolenaar, con molto aiuto da parte di altri.
Vedere ":help credits" in
.B Vim.
.br
@@ -557,10 +550,9 @@ In verità, poco o nulla è rimasto del loro codice originale.
Probabili.
Vedere ":help todo" per una lista di problemi noti.
.PP
Si noti che un certo numero di comportamenti che possono essere considerati
errori da qualcuno, sono in effetti causati da una riproduzione fin troppo
fedele del comportamento di Vi.
Se ritenete che altre cose siano errori "perché Vi si comporta diversamente",
date prima un'occhiata al file vi_diff.txt
(o battere :help vi_diff.txt da Vim).
Date anche un'occhiata alle opzioni 'compatible' e 'cpoptions.
Si noti che un certo numero di comportamenti che possono essere considerati errori
da qualcuno, sono in effetti causati da una riproduzione fin troppo fedele del
comportamento di Vi. Se si ritiene che altre cose siano errori "perché Vi si comporta
diversamente", si dia prima un'occhiata al file vi_diff.txt (o si immetta
:help vi_diff.txt da Vim).
Un'occhiata va data anche alle opzioni 'compatible' e 'cpoptions.

View File

@@ -1,4 +1,4 @@
*vim9.txt* For Vim version 9.0. Last change: 2023 Mar 07
*vim9.txt* For Vim version 9.0. Last change: 2023 Jun 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -117,6 +117,9 @@ script and `:def` functions; details are below:
- Unless mentioned specifically, the highest |scriptversion| is used.
- When defining an expression mapping, the expression will be evaluated in the
context of the script where it was defined.
- When indexing a string the index is counted in characters, not bytes:
|vim9-string-index|
- Some possibly unexpected differences: |vim9-gotchas|.
Comments starting with # ~
@@ -190,8 +193,8 @@ created yet. In this case you can call `execute()` to invoke it at runtime. >
used for the command or the error was caught a `:try` block), does not get a
range passed, cannot be a "dict" function, and can always be a closure.
*vim9-no-dict-function*
Later classes will be added, which replaces the "dict function" mechanism.
For now you will need to pass the dictionary explicitly: >
You can use a Vim9 Class (|Vim9-class|) instead of a "dict function".
You can also pass the dictionary explicitly: >
def DictFunc(self: dict<any>, arg: string)
echo self[arg]
enddef
@@ -1030,10 +1033,12 @@ In Vim9 script one can use the following predefined values: >
null
null_blob
null_channel
null_class
null_dict
null_function
null_job
null_list
null_object
null_partial
null_string
`true` is the same as `v:true`, `false` the same as `v:false`, `null` the same
@@ -1056,11 +1061,11 @@ It is possible to compare `null` with any value, this will not give a type
error. However, comparing `null` with a number, float or bool will always
result in `false`. This is different from legacy script, where comparing
`null` with zero or `false` would return `true`.
*vim9-false-true*
When converting a boolean to a string `false` and `true` are used, not
`v:false` and `v:true` like in legacy script. `v:none` has no `none`
replacement, it has no equivalent in other languages.
*vim9-string-index*
Indexing a string with [idx] or taking a slice with [idx : idx] uses character
indexes instead of byte indexes. Composing characters are included.
Example: >
@@ -1552,7 +1557,7 @@ string to a number.
If a type is given where it is not expected you can get *E1272* .
If a type is incomplete you get *E1363*, e.g. when you have an object for
If a type is incomplete you get *E1363* , e.g. when you have an object for
which the class is not known (usually that is a null object).
Type inference ~
@@ -1751,7 +1756,7 @@ Exporting an item can be written as: >
export interface MyClass ...
< *E1043* *E1044*
As this suggests, only constants, variables, `:def` functions and classes can
be exported. {not implemented yet: class, interface}
be exported.
*E1042*
`:export` can only be used in Vim9 script, at the script level.
@@ -1784,7 +1789,7 @@ filename. For example: >
Then you can use "that.item", etc. You are free to choose the name "that".
Use something that will be recognized as referring to the imported script.
Avoid command names, command modifiers and builtin function names, because the
name will shadow them. Better not start the name starts with a capital
name will shadow them. It's better not to start the name with a capital
letter, since it can then also shadow global user commands and functions.
Also, you cannot use the name for something else in the script, such as a
function or variable name.
@@ -1857,9 +1862,9 @@ However, the namespace cannot be resolved on its own: >
<
This also affects the use of |<SID>| in the legacy mapping context. Since
|<SID>| is only a valid prefix for a function and NOT for a namespace, you
cannot use it
to scope a function in a script local namespace. Instead of prefixing the
function with |<SID>| you should use|<ScriptCmd>|. For example: >
cannot use it to scope a function in a script local namespace. Instead of
prefixing the function with |<SID>| you should use|<ScriptCmd>|. For example:
>
noremap ,a <ScriptCmd>:call s:that.OtherFunc()<CR>
<
*:import-cycle*

View File

@@ -1,4 +1,4 @@
*vim9class.txt* For Vim version 9.0. Last change: 2023 Mar 22
*vim9class.txt* For Vim version 9.0. Last change: 2023 Sep 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -11,7 +11,7 @@ Vim9 classes, objects, interfaces, types and enums.
1. Overview |Vim9-class-overview|
2. A simple class |Vim9-simple-class|
3. Class members and functions |Vim9-class-member|
3. Class variables and methods |Vim9-class-member|
4. Using an abstract class |Vim9-abstract-class|
5. Using an interface |Vim9-using-interface|
6. More class details |Vim9-class|
@@ -37,7 +37,7 @@ The basic item is an object:
functions are invoked "on the object", which is what sets it apart from the
traditional separation of data and code that manipulates the data.
- An object has a well defined interface, with typed member variables and
member functions.
methods.
- Objects are created from a class and all objects have the same interface.
This does not change at runtime, it is not dynamic.
@@ -103,7 +103,7 @@ You can create an object from this class with the new() method: >
var pos = TextPosition.new(1, 1)
The object members "lnum" and "col" can be accessed directly: >
The object variables "lnum" and "col" can be accessed directly: >
echo $'The text position is ({pos.lnum}, {pos.col})'
< *E1317* *E1327*
@@ -111,50 +111,54 @@ If you have been using other object-oriented languages you will notice that
in Vim the object members are consistently referred to with the "this."
prefix. This is different from languages like Java and TypeScript. The
naming convention makes the object members easy to spot. Also, when a
variable does not have the "this." prefix you know it is not an object member.
variable does not have the "this." prefix you know it is not an object
variable.
Member write access ~
Object variable write access ~
Now try to change an object member directly: >
Now try to change an object variable directly: >
pos.lnum = 9
< *E1335*
This will give you an error! That is because by default object members can be
read but not set. That's why the TextPosition class provides a method for it: >
This will give you an error! That is because by default object variables can
be read but not set. That's why the TextPosition class provides a method for
it: >
pos.SetLnum(9)
Allowing to read but not set an object member is the most common and safest
Allowing to read but not set an object variable is the most common and safest
way. Most often there is no problem using a value, while setting a value may
have side effects that need to be taken care of. In this case, the SetLnum()
method could check if the line number is valid and either give an error or use
the closest valid value.
*:public* *E1331*
If you don't care about side effects and want to allow the object member to be
changed at any time, you can make it public: >
If you don't care about side effects and want to allow the object variable to
be changed at any time, you can make it public: >
public this.lnum: number
public this.col: number
Now you don't need the SetLnum(), SetCol() and SetPosition() methods, setting
"pos.lnum" directly above will no longer give an error.
*E1334*
If you try to set an object member that doesn't exist you get an error: >
*E1326*
If you try to set an object variable that doesn't exist you get an error: >
pos.other = 9
< E1334: Object member not found: other ~
< E1326: Member not found on object "TextPosition": other ~
*E1376*
A object variable cannot be accessed using the class name.
Private members ~
*E1332* *E1333*
On the other hand, if you do not want the object members to be read directly,
Private variables ~
*private-variable* *E1332* *E1333*
On the other hand, if you do not want the object variables to be read directly,
you can make them private. This is done by prefixing an underscore to the
name: >
this._lnum: number
this._col number
Now you need to provide methods to get the value of the private members.
Now you need to provide methods to get the value of the private variables.
These are commonly called getters. We recommend using a name that starts with
"Get": >
@@ -166,7 +170,7 @@ These are commonly called getters. We recommend using a name that starts with
return this._col
enddef
This example isn't very useful, the members might as well have been public.
This example isn't very useful, the variables might as well have been public.
It does become useful if you check the value. For example, restrict the line
number to the total number of lines: >
@@ -176,12 +180,32 @@ number to the total number of lines: >
endif
return this._lnum
enddef
<
Private methods ~
*private-method* *E1366*
If you want object methods to be accessible only from other methods of the
same class and not used from outside the class, then you can make them
private. This is done by prefixing the method name with an underscore: >
class SomeClass
def _Foo(): number
return 10
enddef
def Bar(): number
return this._Foo()
enddef
endclass
<
Accessing a private method outside the class will result in an error (using
the above class): >
var a = SomeClass.new()
a._Foo()
<
Simplifying the new() method ~
Many constructors take values for the object members. Thus you very often see
this pattern: >
*new()* *constructor*
Many constructors take values for the object variables. Thus you very often
see this pattern: >
class SomeClass
this.lnum: number
@@ -192,20 +216,22 @@ this pattern: >
this.col = col
enddef
endclass
Not only is this text you need to write, it also has the type of each member
twice. Since this is so common a shorter way to write new() is provided: >
<
*E1390*
Not only is this text you need to write, it also has the type of each
variables twice. Since this is so common a shorter way to write new() is
provided: >
def new(this.lnum, this.col)
enddef
The semantics are easy to understand: Providing the object member name,
The semantics are easy to understand: Providing the object variable name,
including "this.", as the argument to new() means the value provided in the
new() call is assigned to that object member. This mechanism comes from the
new() call is assigned to that object variable. This mechanism comes from the
Dart language.
Putting together this way of using new() and making the members public results
in a much shorter class definition than what we started with: >
Putting together this way of using new() and making the variables public
results in a much shorter class definition than what we started with: >
class TextPosition
public this.lnum: number
@@ -222,23 +248,32 @@ in a much shorter class definition than what we started with: >
The sequence of constructing a new object is:
1. Memory is allocated and cleared. All values are zero/false/empty.
2. For each declared member that has an initializer, the expression is
evaluated and assigned to the member. This happens in the sequence the
members are declared in the class.
2. For each declared object variable that has an initializer, the expression
is evaluated and assigned to the variable. This happens in the sequence
the variables are declared in the class.
3. Arguments in the new() method in the "this.name" form are assigned.
4. The body of the new() method is executed.
If the class extends a parent class, the same thing happens. In the second
step the members of the parent class are done first. There is no need to call
"super()" or "new()" on the parent.
step the object variables of the parent class are initialized first. There is
no need to call "super()" or "new()" on the parent.
*E1365*
When defining the new() method the return type should not be specified. It
always returns an object of the class.
*E1386*
When invoking an object method, the method name should be preceded by the
object variable name. A object method cannot be invoked using the class
name.
==============================================================================
3. class members and functions *Vim9-class-member*
3. Class Variables and Methods *Vim9-class-member*
*:static* *E1337* *E1338*
*:static* *E1337* *E1338* *E1368*
Class members are declared with "static". They are used by the name without a
prefix: >
prefix in the class where they are defined: >
class OtherThing
this.size: number
@@ -249,9 +284,13 @@ prefix: >
enddef
endclass
< *E1340* *E1341*
Since the name is used as-is, shadowing the name by a function argument name
Since the name is used as-is, shadowing the name by a method argument name
or local variable name is not allowed.
*E1374* *E1375* *E1384* *E1385*
To access a class member outside of the class where it is defined, the class
name prefix must be used. A class member cannot be accessed using an object.
Just like object members the access can be made private by using an underscore
as the first character in the name, and it can be made public by prefixing
"public": >
@@ -262,10 +301,11 @@ as the first character in the name, and it can be made public by prefixing
public static result: number # anybody can read and write
endclass
<
*class-function*
Class functions are also declared with "static". They have no access to
object members, they cannot use the "this" keyword. >
*class-method*
Class methods are also declared with "static". They can use the class
variables but they have no access to the object variables, they cannot use the
"this" keyword:
>
class OtherThing
this.size: number
static totalSize: number
@@ -278,8 +318,50 @@ object members, they cannot use the "this" keyword. >
enddef
endclass
Inside the class the function can be called by name directly, outside the
class the class name must be prefixed: `OtherThing.ClearTotalSize()`.
Inside the class the class method can be called by name directly, outside the
class the class name must be prefixed: `OtherThing.ClearTotalSize()`. To use
a super class method in a child class, the class name must be prefixed.
Just like object methods the access can be made private by using an underscore
as the first character in the method name: >
class OtherThing
static def _Foo()
echo "Foo"
enddef
def Bar()
_Foo()
enddef
endclass
<
*E1370*
Note that constructors cannot be declared as "static", because they always
are.
To access the class methods and class variables of a super class in an
extended class, the class name prefix should be used just as from anywhere
outside of the defining class: >
vim9script
class Vehicle
static nextID: number = 1000
static def GetID(): number
nextID += 1
return nextID
enddef
endclass
class Car extends Vehicle
this.myID: number
def new()
this.myID = Vehicle.GetID()
enddef
endclass
<
Class variables and methods are not inherited by a child class. A child class
can declare a static variable or a method with the same name as the one in the
super class. Depending on the class where the member is used the
corresponding class member will be used. The type of the class member in a
child class can be different from that in the super class.
==============================================================================
@@ -319,6 +401,21 @@ class, for which objects can be created. Example: >
An abstract class is defined the same way as a normal class, except that it
does not have any new() method. *E1359*
*abstract-method* *E1371* *E1372*
An abstract method can be defined in an abstract class by using the "abstract"
prefix when defining the method: >
abstract class Shape
abstract def Draw()
abstract static def SetColor()
endclass
<
*E1373*
A class extending the abstract class must implement all the abstract methods.
The signature (arguments, argument types and return type) must be exactly the
same. If the return type of a method is a class, then that class or one of
its subclasses can be used in the extended method. Class methods in an
abstract class can also be abstract methods.
==============================================================================
@@ -360,9 +457,10 @@ a number. This example extends the one above: >
return this.base * this.height / 2
enddef
endclass
<
*E1348* *E1349* *E1367* *E1382* *E1383*
If a class declares to implement an interface, all the items specified in the
interface must appear in the class, with the same types. *E1348* *E1349*
interface must appear in the class, with the same types.
The interface name can be used as a type: >
@@ -373,7 +471,14 @@ The interface name can be used as a type: >
for shape in shapes
echo $'the surface is {shape.Surface()}'
endfor
<
*E1378* *E1379* *E1380* *E1387*
An interface can contain only object methods and read-only object variables.
An interface cannot contain read-write and private object variables, private
object methods, class variables and class methods.
An interface can extend another interface using "extends". The sub-interface
inherits all the instance variables and methods from the super interface.
==============================================================================
@@ -415,11 +520,23 @@ once. They can appear in any order, although this order is recommended: >
extends ClassName
implements InterfaceName, OtherInterface
specifies SomeInterface
< *E1355*
Each member and function name can be used only once. It is not possible to
define a function with the same name and different type of arguments.
< *E1355* *E1369*
Each variable and method name can be used only once. It is not possible to
define a method with the same name and different type of arguments. It is not
possible to use a public and private member variable with the same name. A
object variable name used in a super class cannot be reused in a child class.
Object Variable Initialization ~
If the type of a variable is not explicitly specified in a class, then it is
set to "any" during class definition. When an object is instantiated from the
class, then the type of the variable is set.
The following reserved keyword names cannot be used as an object or class
variable name: "super", "this", "true", "false", "null", "null_blob",
"null_dict", "null_function", "null_list", "null_partial", "null_string",
"null_channel" and "null_job".
Extending a class ~
*extends*
A class can extend one other class. *E1352* *E1353* *E1354*
@@ -428,33 +545,39 @@ The basic idea is to build on top of an existing class, add properties to it.
The extended class is called the "base class" or "super class". The new class
is called the "child class".
Object members from the base class are all taken over by the child class. It
Object variables from the base class are all taken over by the child class. It
is not possible to override them (unlike some other languages).
*E1356* *E1357* *E1358*
Object methods of the base class can be overruled. The signature (arguments,
argument types and return type) must be exactly the same. The method of the
base class can be called by prefixing "super.".
argument types and return type) must be exactly the same. If the return type
of a method is a class, then that class or one of its subclasses can be used
in the extended method. The method of the base class can be called by
prefixing "super.".
*E1377*
The access level of a method (public or private) in a child class should be
the same as the super class.
Other object methods of the base class are taken over by the child class.
Class functions, including functions starting with "new", can be overruled,
like with object methods. The function on the base class can be called by
prefixing the name of the class (for class functions) or "super.".
Class methods, including methods starting with "new", can be overruled, like
with object methods. The method on the base class can be called by prefixing
the name of the class (for class methods) or "super.".
Unlike other languages, the constructor of the base class does not need to be
invoked. In fact, it cannot be invoked. If some initialization from the base
class also needs to be done in a child class, put it in an object method and
call that method from every constructor().
If the base class did not specify a new() function then one was automatically
created. This function will not be taken over by the child class. The child
class can define its own new() function, or, if there isn't one, a new()
function will be added automatically.
If the base class did not specify a new() method then one was automatically
created. This method will not be taken over by the child class. The child
class can define its own new() method, or, if there isn't one, a new() method
will be added automatically.
A class implementing an interface ~
*implements* *E1346* *E1347*
*implements* *E1346* *E1347* *E1389*
A class can implement one or more interfaces. The "implements" keyword can
only appear once *E1350* . Multiple interfaces can be specified, separated by
commas. Each interface name can appear only once. *E1351*
@@ -462,28 +585,37 @@ commas. Each interface name can appear only once. *E1351*
A class defining an interface ~
*specifies*
A class can declare its interface, the object members and methods, with a
A class can declare its interface, the object variables and methods, with a
named interface. This avoids the need for separately specifying the
interface, which is often done in many languages, especially Java.
Items in a class ~
*E1318* *E1325* *E1326*
*E1318* *E1325* *E1388*
Inside a class, in between `:class` and `:endclass`, these items can appear:
- An object member declaration: >
this._memberName: memberType
this.memberName: memberType
public this.memberName: memberType
- An object variable declaration: >
this._privateVariableName: memberType
this.readonlyVariableName: memberType
public this.readwriteVariableName: memberType
- A class variable declaration: >
static _privateClassVariableName: memberType
static readonlyClassVariableName: memberType
static public readwriteClassVariableName: memberType
- A constructor method: >
def new(arguments)
def newName(arguments)
- A class method: >
static def SomeMethod(arguments)
static def _PrivateMethod(arguments)
- An object method: >
def SomeMethod(arguments)
< *E1329*
For the object member the type must be specified. The best way is to do this
explicitly with ": {type}". For simple types you can also use an initializer,
such as "= 123", and Vim will see that the type is a number. Avoid doing this
for more complex types and when the type will be incomplete. For example: >
def _PrivateMethod(arguments)
For the object variable the type must be specified. The best way is to do
this explicitly with ": {type}". For simple types you can also use an
initializer, such as "= 123", and Vim will see that the type is a number.
Avoid doing this for more complex types and when the type will be incomplete.
For example: >
this.nameList = []
This specifies a list, but the item type is unknown. Better use: >
this.nameList: list<string>
@@ -503,8 +635,8 @@ prefixed with `:export`: >
export interface InterfaceName
endinterface
< *E1344*
An interface can declare object members, just like in a class but without any
initializer.
An interface can declare object variables, just like in a class but without
any initializer.
*E1345*
An interface can declare methods with `:def`, including the arguments and
return type, but without the body and without `:enddef`. Example: >
@@ -518,6 +650,8 @@ An interface name must start with an uppercase letter. *E1343*
The "Has" prefix can be used to make it easier to guess this is an interface
name, with a hint about what it provides.
An interface can only be defined in a |Vim9| script file. *E1342*
An interface cannot "implement" another interface but it can "extend" another
interface. *E1381*
null object ~
@@ -525,15 +659,15 @@ null object ~
When a variable is declared to have the type of an object, but it is not
initialized, the value is null. When trying to use this null object Vim often
does not know what class was supposed to be used. Vim then cannot check if
a member name is correct and you will get an "Using a null object" error,
even when the member name is invalid. *E1360* *E1362* *E1363*
a variable name is correct and you will get an "Using a null object" error,
even when the variable name is invalid. *E1360* *E1362*
Default constructor ~
*default-constructor*
In case you define a class without a new() method, one will be automatically
defined. This default constructor will have arguments for all the object
members, in the order they were specified. Thus if your class looks like: >
variables, in the order they were specified. Thus if your class looks like: >
class AutoNew
this.name: string
@@ -541,14 +675,14 @@ members, in the order they were specified. Thus if your class looks like: >
this.gender: Gender
endclass
Then The default constructor will be: >
Then the default constructor will be: >
def new(this.name = v:none, this.age = v:none, this.gender = v:none)
enddef
The "= v:none" default values make the arguments optional. Thus you can also
call `new()` without any arguments. No assignment will happen and the default
value for the object members will be used. This is a more useful example,
value for the object variables will be used. This is a more useful example,
with default values: >
class TextPosition
@@ -564,13 +698,13 @@ the name, you can define the constructor like this: >
enddef
< *E1328*
Note that you cannot use another default value than "v:none" here. If you
want to initialize the object members, do it where they are declared. This
want to initialize the object variables, do it where they are declared. This
way you only need to look in one place for the default values.
All object members will be used in the default constructor, also private
All object variables will be used in the default constructor, also private
access ones.
If the class extends another one, the object members of that class will come
If the class extends another one, the object variables of that class will come
first.
@@ -608,17 +742,19 @@ constructor methods.
7. Type definition *Vim9-type* *:type*
{not implemented yet}
A type definition is giving a name to a type specification. For Example: >
:type ListOfStrings list<string>
TODO: more explanation
==============================================================================
8. Enum *Vim9-enum* *:enum* *:endenum*
{not implemented yet}
An enum is a type that can have one of a list of values. Example: >
:enum Color
@@ -629,8 +765,6 @@ An enum is a type that can have one of a list of values. Example: >
Black
:endenum
TODO: more explanation
==============================================================================
@@ -684,7 +818,7 @@ the method being called is obvious.
No overloading of the constructor ~
In Vim script, both legacy and |Vim9| script, there is no overloading of
functions. That means it is not possible to use the same function name with
methods. That means it is not possible to use the same method name with
different types of arguments. Therefore there also is only one new()
constructor.
@@ -727,39 +861,40 @@ class implements an interface just because the methods happen to match is
brittle and leads to obscure problems, let's not do that.
Using "this.member" everywhere ~
Using "this.variable" everywhere ~
The object members in various programming languages can often be accessed in
The object variables in various programming languages can often be accessed in
different ways, depending on the location. Sometimes "this." has to be
prepended to avoid ambiguity. They are usually declared without "this.".
That is quite inconsistent and sometimes confusing.
A very common issue is that in the constructor the arguments use the same name
as the object member. Then for these members "this." needs to be prefixed in
the body, while for other members this is not needed and often omitted. This
leads to a mix of members with and without "this.", which is inconsistent.
as the object variable. Then for these variables "this." needs to be prefixed
in the body, while for other variables this is not needed and often omitted.
This leads to a mix of variables with and without "this.", which is
inconsistent.
For |Vim9| classes the "this." prefix is always used. Also for declaring the
members. Simple and consistent. When looking at the code inside a class it's
also directly clear which variable references are object members and which
aren't.
variables. Simple and consistent. When looking at the code inside a class
it's also directly clear which variable references are object variables and
which aren't.
Using class members ~
Using class variables ~
Using "static member" to declare a class member is very common, nothing new
here. In |Vim9| script these can be accessed directly by their name. Very
much like how a script-local variable can be used in a function. Since object
members are always accessed with "this." prepended, it's also quickly clear
what kind of member it is.
Using "static variable" to declare a class variable is very common, nothing
new here. In |Vim9| script these can be accessed directly by their name.
Very much like how a script-local variable can be used in a method. Since
object variables are always accessed with "this." prepended, it's also quickly
clear what kind of variable it is.
TypeScript prepends the class name before the class member, also inside the
class. This has two problems: The class name can be rather long, taking up
quite a bit of space, and when the class is renamed all these places need to
be changed too.
TypeScript prepends the class name before the class variable name, also inside
the class. This has two problems: The class name can be rather long, taking
up quite a bit of space, and when the class is renamed all these places need
to be changed too.
Declaring object and class members ~
Declaring object and class variables ~
The main choice is whether to use "var" as with variable declarations.
TypeScript does not use it: >
@@ -768,7 +903,7 @@ TypeScript does not use it: >
y = 0;
}
Following that Vim object members could be declared like this: >
Following that Vim object variables could be declared like this: >
class Point
this.x: number
this.y = 0
@@ -781,7 +916,7 @@ declaration. Adding "var" changes that: >
var this.y = 0
endclass
We also need to be able to declare class members using the "static" keyword.
We also need to be able to declare class variables using the "static" keyword.
There we can also choose to leave out "var": >
class Point
var this.x: number
@@ -821,50 +956,50 @@ while there is no ClassName() method, it's a method by another name in the
class called ClassName. Quite confusing.
Default read access to object members ~
Default read access to object variables ~
Some users will remark that the access rules for object members are
Some users will remark that the access rules for object variables are
asymmetric. Well, that is intentional. Changing a value is a very different
action than reading a value. The read operation has no side effects, it can
be done any number of times without affecting the object. Changing the value
can have many side effects, and even have a ripple effect, affecting other
objects.
When adding object members one usually doesn't think much about this, just get
the type right. And normally the values are set in the new() method.
When adding object variables one usually doesn't think much about this, just
get the type right. And normally the values are set in the new() method.
Therefore defaulting to read access only "just works" in most cases. And when
directly writing you get an error, which makes you wonder if you actually want
to allow that. This helps writing code with fewer mistakes.
Making object members private with an underscore ~
Making object variables private with an underscore ~
When an object member is private, it can only be read and changed inside the
When an object variable is private, it can only be read and changed inside the
class (and in sub-classes), then it cannot be used outside of the class.
Prepending an underscore is a simple way to make that visible. Various
programming languages have this as a recommendation.
In case you change your mind and want to make the object member accessible
In case you change your mind and want to make the object variable accessible
outside of the class, you will have to remove the underscore everywhere.
Since the name only appears in the class (and sub-classes) they will be easy
to find and change.
The other way around is much harder: you can easily prepend an underscore to
the object member inside the class to make it private, but any usage elsewhere
you will have to track down and change. You may have to make it a "set"
method call. This reflects the real world problem that taking away access
requires work to be done for all places where that access exists.
the object variable inside the class to make it private, but any usage
elsewhere you will have to track down and change. You may have to make it a
"set" method call. This reflects the real world problem that taking away
access requires work to be done for all places where that access exists.
An alternative would have been using the "private" keyword, just like "public"
changes the access in the other direction. Well, that's just to reduce the
number of keywords.
No protected object members ~
No protected object variables ~
Some languages provide several ways to control access to object members. The
most known is "protected", and the meaning varies from language to language.
Others are "shared", "private" and even "friend".
Some languages provide several ways to control access to object variables.
The most known is "protected", and the meaning varies from language to
language. Others are "shared", "private" and even "friend".
These rules make life more difficult. That can be justified in projects where
many people work on the same, complex code where it is easy to make mistakes.

View File

@@ -1,48 +1,46 @@
.TH VIMDIFF 1 "30 marzo 2001"
.SH NOME
vimdiff \- modifica due, tre o quattro versioni di un file con Vim,
visualizzando le differenze
vimdiff \- modifica da due, fino a otto versioni di un file con Vim, visualizzando le differenze
.SH SINTASSI
.br
.B vimdiff
[opzioni] file1 file2 [file3 [file4]]
[opzioni] file1 file2 [file3 [file4 [file5 [file6 [file7 [file8]]]]]]
.PP
.B gvimdiff
.SH DESCRIZIONE
.B Vimdiff
inizia
.B Vim
per due (o tre o quattro) file.
per due e fino a otto file.
Ogni file ha una sua finestra.
Le differenze fra file sono evidenziate.
<EFBFBD> una maniera elegante per controllare modifiche e portare modifiche
verso un'altra versione dello stesso file.
<EFBFBD> una maniera elegante per controllare modifiche e applicare modifiche
a qualche altra versione dello stesso file.
.PP
Vedere vim(1) per dettagli su Vim in generale.
Vedere vim(1) per dettagli su Vim in s<EFBFBD>.
.PP
Se iniziato con
.B gvimdiff
la GUI sar<61> utilizzata, se disponibile.
.PP
In ogni finestra l'opzione 'diff' <20> impostata, evidenziando cos<6F> le
differenze.
In ogni finestra l'opzione 'diff' <20> impostata, in modo da evidenziare le
differenze fra le versioni
.br
Le opzioni 'wrap' e 'scrollbind' sono impostate per migliorare la
visibilit<EFBFBD> del testo.
Le opzioni 'wrap' e 'scrollbind' sono impostate per favorire la visibilit<69> del testo.
.br
L'opzione 'foldmethod' <20> impostata al valore "diff", che mette gruppi di
L'opzione 'foldmethod' <20> impostata al valore "diff", che mette i gruppi di
linee uguali fra i diversi file in una piegatura. 'foldcolumn' <20> impostato
a due per poter facilmente visualizzare le piegature, aprirle e chiuderle.
.SH OPZIONI
Lo schermo <20> diviso verticalmente, come se aveste usato l'opzione "\-O".
Per dividerlo orizzontalmente, usare l'opzione "\-o".
Lo schermo <20> diviso verticalmente, come quando si usa l'opzione "\-O".
Per dividerlo orizzontalmente, usare invece l'opzione "\-o".
.PP
Per tutte le altre opzioni, vedere vim(1).
Per tutti gli altri argomenti, vedere vim(1).
.SH VEDERE ANCHE
vim(1)
.SH AUTORE
Buona parte di
.B Vim
<EFBFBD> stato scritto da Bram Moolenaar, con molto aiuto da altri.
<EFBFBD> stato scritto da Bram Moolenaar, con molto aiuto da parte di altri.
Vedere ":help credits" in
.B Vim.

View File

@@ -1,48 +1,46 @@
.TH VIMDIFF 1 "30 marzo 2001"
.SH NOME
vimdiff \- modifica due, tre o quattro versioni di un file con Vim,
visualizzando le differenze
vimdiff \- modifica da due, fino a otto versioni di un file con Vim, visualizzando le differenze
.SH SINTASSI
.br
.B vimdiff
[opzioni] file1 file2 [file3 [file4]]
[opzioni] file1 file2 [file3 [file4 [file5 [file6 [file7 [file8]]]]]]
.PP
.B gvimdiff
.SH DESCRIZIONE
.B Vimdiff
inizia
.B Vim
per due (o tre o quattro) file.
per due e fino a otto file.
Ogni file ha una sua finestra.
Le differenze fra file sono evidenziate.
È una maniera elegante per controllare modifiche e portare modifiche
verso un'altra versione dello stesso file.
È una maniera elegante per controllare modifiche e applicare modifiche
a qualche altra versione dello stesso file.
.PP
Vedere vim(1) per dettagli su Vim in generale.
Vedere vim(1) per dettagli su Vim in .
.PP
Se iniziato con
.B gvimdiff
la GUI sarà utilizzata, se disponibile.
.PP
In ogni finestra l'opzione 'diff' è impostata, evidenziando così le
differenze.
In ogni finestra l'opzione 'diff' è impostata, in modo da evidenziare le
differenze fra le versioni
.br
Le opzioni 'wrap' e 'scrollbind' sono impostate per migliorare la
visibilità del testo.
Le opzioni 'wrap' e 'scrollbind' sono impostate per favorire la visibilità del testo.
.br
L'opzione 'foldmethod' è impostata al valore "diff", che mette gruppi di
L'opzione 'foldmethod' è impostata al valore "diff", che mette i gruppi di
linee uguali fra i diversi file in una piegatura. 'foldcolumn' è impostato
a due per poter facilmente visualizzare le piegature, aprirle e chiuderle.
.SH OPZIONI
Lo schermo è diviso verticalmente, come se aveste usato l'opzione "\-O".
Per dividerlo orizzontalmente, usare l'opzione "\-o".
Lo schermo è diviso verticalmente, come quando si usa l'opzione "\-O".
Per dividerlo orizzontalmente, usare invece l'opzione "\-o".
.PP
Per tutte le altre opzioni, vedere vim(1).
Per tutti gli altri argomenti, vedere vim(1).
.SH VEDERE ANCHE
vim(1)
.SH AUTORE
Buona parte di
.B Vim
è stato scritto da Bram Moolenaar, con molto aiuto da altri.
è stato scritto da Bram Moolenaar, con molto aiuto da parte di altri.
Vedere ":help credits" in
.B Vim.

View File

@@ -1,6 +1,6 @@
.TH VIMTUTOR 1 "2 aprile 2001"
.SH NOME
vimtutor \- Un breve corso per imparare Vim
vimtutor \- Un breve corso introduttivo a Vim
.SH SINTASSI
.br
.B vimtutor [\-g] [lingua]
@@ -8,51 +8,50 @@ vimtutor \- Un breve corso per imparare Vim
.B Vimtutor
inizia il
.B Vim
tutor (una breve corso per imparare Vim).
Per prima cosa viene creata una copia del file di lavoro, che pu<70> cos<6F> essere
modificato senza alterare il file usato come modello.
tutor (un breve corso introduttivo a Vim).
Viene utilizzata una copia del file di lavoro, che pu<70> cos<6F> essere modificato
a piacere senza alterare il file usato come modello.
.PP
Il comando
.B Vimtutor
<EFBFBD> utile a chi voglia imparare i primi comandi
<EFBFBD> utile a chi voglia imparare i primi comandi di
.B Vim
.
.PP
L'argomento opzionale \-g inizia vimtutor usando gvim invece che vim, se la
versione GUI di vim <20> disponibile. oppure utilizza vim, se gvim non <20>
disponibile.
versione GUI di vim <20> disponibile; altrimenti viene utilizzato Vim.
.PP
L'arogmento opzionale [lingua] <20> l'abbreviazione di due lettere del nome
L'argomento opzionale [lingua] <20> l'abbreviazione di due lettere del nome
di una lingua, per esempio "it" oppure "es".
se L'argomento [lingua] non viene specificato, si utilizza la lingua "locale"
Se l'argomento [lingua] non viene specificato, si utilizza la lingua "locale"
del computer.
Se la versione in quella lingua del "tutor" <20> disponibile, sar<61> usata.
Altrimenti sar<EFBFBD> usata la versione inglese.
Se la versione in tale lingua del "tutor" non <20> disponibile,
verr<EFBFBD> usata la versione inglese.
.PP
.B Vim
<EFBFBD> sempre iniziato in Modo compatibile con vi.
<EFBFBD> sempre iniziato in Modo compatibile con Vi.
.SH FILE
.TP 15
/usr/local/lib/vim/tutor/tutor[.language]
Il/I file di testo per
I file di testo per
.B Vimtutor
.
.TP 15
/usr/local/lib/vim/tutor/tutor.vim
Lo script di Vim usato per copiare il file di testo
.B Vimtutor
.
.SH AUTORE
The
Il corso introduttivo
.B Vimtutor
<EFBFBD> stato scritto in origine per Vi da Michael C. Pierce e Robert K. Ware,
Colorado School of Mines, usando idee fornite da Charles Smith,
Colorado State University.
E\-mail: bware@mines.colorado.edu.
E-mail: bware@mines.colorado.edu (non pi<70> valido).
.br
<EFBFBD> stato modificato per
.B Vim
da Bram Moolenaar.
Per i nomi dei traduttori, vedere i file usati nelle rispettive lingue.
Per i nomi dei traduttori, vedere i file nelle rispettive lingue.
.SH VEDERE ANCHE
vim(1)

View File

@@ -1,6 +1,6 @@
.TH VIMTUTOR 1 "2 aprile 2001"
.SH NOME
vimtutor \- Un breve corso per imparare Vim
vimtutor \- Un breve corso introduttivo a Vim
.SH SINTASSI
.br
.B vimtutor [\-g] [lingua]
@@ -8,51 +8,50 @@ vimtutor \- Un breve corso per imparare Vim
.B Vimtutor
inizia il
.B Vim
tutor (una breve corso per imparare Vim).
Per prima cosa viene creata una copia del file di lavoro, che può così essere
modificato senza alterare il file usato come modello.
tutor (un breve corso introduttivo a Vim).
Viene utilizzata una copia del file di lavoro, che può così essere modificato
a piacere senza alterare il file usato come modello.
.PP
Il comando
.B Vimtutor
è utile a chi voglia imparare i primi comandi
è utile a chi voglia imparare i primi comandi di
.B Vim
.
.PP
L'argomento opzionale \-g inizia vimtutor usando gvim invece che vim, se la
versione GUI di vim è disponibile. oppure utilizza vim, se gvim non è
disponibile.
versione GUI di vim è disponibile; altrimenti viene utilizzato Vim.
.PP
L'arogmento opzionale [lingua] è l'abbreviazione di due lettere del nome
L'argomento opzionale [lingua] è l'abbreviazione di due lettere del nome
di una lingua, per esempio "it" oppure "es".
se L'argomento [lingua] non viene specificato, si utilizza la lingua "locale"
Se l'argomento [lingua] non viene specificato, si utilizza la lingua "locale"
del computer.
Se la versione in quella lingua del "tutor" è disponibile, sarà usata.
Altrimenti sarà usata la versione inglese.
Se la versione in tale lingua del "tutor" non è disponibile,
verrà usata la versione inglese.
.PP
.B Vim
è sempre iniziato in Modo compatibile con vi.
è sempre iniziato in Modo compatibile con Vi.
.SH FILE
.TP 15
/usr/local/lib/vim/tutor/tutor[.language]
Il/I file di testo per
I file di testo per
.B Vimtutor
.
.TP 15
/usr/local/lib/vim/tutor/tutor.vim
Lo script di Vim usato per copiare il file di testo
.B Vimtutor
.
.SH AUTORE
The
Il corso introduttivo
.B Vimtutor
è stato scritto in origine per Vi da Michael C. Pierce e Robert K. Ware,
Colorado School of Mines, usando idee fornite da Charles Smith,
Colorado State University.
E\-mail: bware@mines.colorado.edu.
E-mail: bware@mines.colorado.edu (non più valido).
.br
È stato modificato per
.B Vim
da Bram Moolenaar.
Per i nomi dei traduttori, vedere i file usati nelle rispettive lingue.
Per i nomi dei traduttori, vedere i file nelle rispettive lingue.
.SH VEDERE ANCHE
vim(1)

View File

@@ -1,4 +1,4 @@
*visual.txt* For Vim version 9.0. Last change: 2022 Dec 04
*visual.txt* For Vim version 9.0. Last change: 2023 Sep 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -183,6 +183,8 @@ If you want to highlight exactly the same area as the last time, you can use
CTRL-C In Visual mode: Stop Visual mode. When insert mode is
pending (the mode message shows
"-- (insert) VISUAL --"), it is also stopped.
On MS-Windows, you may need to press CTRL-Break
|dos-CTRL-Break|.
==============================================================================
3. Changing the Visual area *visual-change*

View File

@@ -189,7 +189,7 @@ CTRL-W v *CTRL-W_v*
it doesn't!
CTRL-W n *CTRL-W_n*
CTRL-W CTRL_N *CTRL-W_CTRL-N*
CTRL-W CTRL-N *CTRL-W_CTRL-N*
:[N]new [++opt] [+cmd] *:new*
Create a new window and start editing an empty file in it.
Make new window N high (default is to use half the existing

View File

@@ -70,7 +70,7 @@ Convertit en binaires plut
Cette option <20>crit les octets comme une s<>quence de "1" et de "0" au lieu
d'une conversion en hexad<61>cimal traditionnel. Chaque ligne est pr<70>c<EFBFBD>d<EFBFBD>e par un
num<EFBFBD>ro de ligne en hexad<61>cimal et suivie de la repr<70>sentation ASCII (ou
EBCDIC) correspondante. Les options \-r, \-p, \-i ne fonctionnent pas dans ce
EBCDIC) correspondante. Les options \-p, \-i ne fonctionnent pas dans ce
mode.
.TP
.IR "\-c cols " | " \-cols cols"

View File

@@ -70,7 +70,7 @@ Convertit en binaires plutôt qu'en hexadécimal.
Cette option écrit les octets comme une séquence de "1" et de "0" au lieu
d'une conversion en hexadécimal traditionnel. Chaque ligne est précédée par un
numéro de ligne en hexadécimal et suivie de la représentation ASCII (ou
EBCDIC) correspondante. Les options \-r, \-p, \-i ne fonctionnent pas dans ce
EBCDIC) correspondante. Les options \-p, \-i ne fonctionnent pas dans ce
mode.
.TP
.IR "\-c cols " | " \-cols cols"

View File

@@ -6,7 +6,7 @@
.\" Modificato da Bram Moolenaar <Bram@vim.org>
.SH NOME
.I xxd
\- Produce esadecimale da un file binario o viceversa.
\- Produce lista esadecimale da un file binario o viceversa.
.SH SINTASSI
.B xxd
\-h[elp]
@@ -18,36 +18,33 @@
\-r[evert] [opzioni] [input_file [output_file]]
.SH DESCRIZIONE
.I xxd
crea un'immagine esadecimale di un dato file o dello "standard input".
Pu<EFBFBD> anche ottenere da un'immagine esadecimale il file binario originale.
crea un'immagine esadecimale di un dato file o dello `standard input'.
Pu<EFBFBD> anche ricostruire da un'immagine esadecimale il file binario originale.
Come
.BR uuencode (1)
e
.BR uudecode (1)
permette di trasmettere dati binari in una rappresentazione ASCII "a prova
di email", ma ha anche il vantaggio di poter decodificare sullo "standard
output". Inoltre, pu<70> essere usato per effettuare delle modifiche (patch)
a file binari.
permette di trasmettere dati binari in una rappresentazione ASCII `a prova
di email', ma ha anche il vantaggio di poter decodificare sullo `standard output'.
Inoltre, pu<70> essere usato per effettuare delle modifiche (patch) a file binari.
.SH OPZIONI
Se non si specifica un
.I input_file
il programma legge dallo "standard input".
il programma legge dallo `standard input'.
Se
.I input_file
<EFBFBD> specificato come il carattere
.RB \` \- '
, l'input <20> letto dallo "standard input".
, l'input <20> letto dallo `standard input'.
Se non si specifica un
.I output_file
(o si mette al suo posto il carattere
.RB \` \- '
), i risultati sono inviati allo "standard output".
), i risultati sono inviati allo `standard output'.
.PP
Si noti che la scansione dei caratteri <20> "pigra", e non controlla oltre
la prima lettera dell'opzione, a meno che l'opzione sia seguita da un
parametro.
Gli spazi fra una singola lettera di opzione e il corrispondente parametro
dopo di essa sono facoltativi.
Si noti che la scansione dei caratteri <20> "pigra", e non controlla oltre la prima
lettera di un'opzione, a meno che l'opzione sia seguita da un parametro.
Gli spazi fra una singola lettera di opzione e il relativo parametro sono facoltativi.
I parametri delle opzioni possono essere specificati usando la notazione
decimale, esadecimale oppure ottale.
Pertanto
@@ -56,122 +53,141 @@ Pertanto
.B \-c 010
e
.B \-cols 8
sono notazioni equivalenti fra loro.
sono tutte notazioni equivalenti fra loro.
.PP
.TP
.IR \-a " | " \-autoskip
Richiesta di autoskip: Un singolo '*' rimpiazza linee di zeri binari.
Valore di default: off.
Richiesta di omissione: Un singolo '*' rimpiazza righe a zeri binari. Default: off.
.TP
.IR \-b " | " \-bits
Richiesta di una immagine binaria (cifre binarie), invece che esadecimale.
Questa opzione scrive un byte come otto cifre "1" e "0" invece di usare i
numeri esadecimali. Ogni linea <20> preceduta da un indirizzo in esadecimale e
seguita da una decodifica ascii (o ebcdic). Le opzioni specificabili dalla
linea comando \-r, \-p, \-i non funzionano in questo modo.
Richiesta di un'immagine binaria (cifre binarie), invece che esadecimale.
Quest'opzione scrive un byte come otto cifre "1" e "0" invece di usare i
numeri esadecimali. Ogni riga <20> preceduta da un indirizzo in esadecimale e
seguita da una decodifica ASCII (o EBCDIC). Le opzioni \-p, \-i,
specificabili dalla riga comando, non funzionano in questo modo.
.TP
.IR "\-c colonne " | " \-cols colonne"
.IR "\-c colonne " | " \-cols colonne"
In ogni linea sono formattate
In ogni riga sono formattate
.RI < colonne >
colonne. Valore di default 16 (\-i: 12, \-ps: 30, \-b: 6).
Valore massimo 256.
Non c'<27> un valore massimo per \-ps; se si specifica 0 viene scritta un'unica lunga riga di output.
.TP
.IR \-C " | " \-capitalize
Mette in maiuscolo i nomi di variabili nello stile delle `include' C, se si usa \-i.
.TP
.IR \-E " | " \-EBCDIC
Cambia la codifica della colonna di destra da ASCII a EBCDIC.
Questo non modifica la rappresentazione esadecimale. Non ha senso
specificare questa opzione in combinazione con \-r, \-p o \-i.
specificare quest'opzione in combinazione con \-r, \-p o \-i.
.TP
.IR "\-g numero_byte " | " \-groupsize numero_byte"
Inserisci ogni
.RI < numero_byte >
byte di output (di due caratteri esadecimali o otto numeri binari ognuno)
uno spazio bianco.
.IR \-e
Considera la lista esadecimale come avente codifica `little-endian'.
Quest'opzione tratta i gruppi di byte come parole in codifica `little-endian'.
Il raggruppamento di default dei byte a 4 a 4 pu<70> essere cambiato usando
.RI "" \-g .
Quest'opzione si applica solo alla lista esadecimale, Lasciando inalterata
la rappresentazione ASCII (or EBCDIC).
Le opzioni della riga di comando
\-r, \-p, \-i non funzionano in questa modalit<69>.
.TP
.IR "\-g numero " | " \-groupsize numero"
Separa ogni gruppo di
.RI < numero >
byte in output (di due caratteri esadecimali o otto caratteri binari ognuno) con uno spazio bianco.
Specificando
.I \-g 0
i byte di output non sono separati da alcuno spazio.
.RI < numero_byte > ha come valore di default " 2
in modalit<69> normale [esadecimale] e \fI1\fP in modalit<69> binaria.
Il raggruppamento non si applica agli stili "PostScript" e "include".
.RI < Numero "> ha come valore di default " 2
in modalit<69> normale [esadecimale], \fI4\fP in modalit<69> `little-endian' e \fI1\fP in modalit<69> binaria.
Il raggruppamento non si applica agli stili `PostScript' e `include'.
.TP
.IR \-h " | " \-help
stampa un sommario dei comandi disponibili ed esce. Non viene fatto
null'altro.
Stampa un sommario dei comandi disponibili ed esce. Non viene fatto null'altro.
.TP
.IR \-i " | " \-include
L'output <20> nello stile dei file "include" in C. Viene preparata la
definizione completa di un "array" [vettore], dandogli il nome del
file di input), tranne che nel caso in cui xxd legga dallo "standard input".
L'output <20> un file `include' in C. Viene preparata la definizione completa del
vettore (col nome del file di input), tranne quando xxd legga dallo `standard input'.
.TP
.IR "\-l numero " | " \-len numero"
Il programma esce dopo aver scritto
.RI < numero >
byte.
.TP
.I "\-n nome " | " \-name nome"
Specifica il nome del vettore in output quando si usa \-i. Il vettore viene chiamato
\fInome\fP e la sua lunghezza viene chiamata \fInome\fP_len.
.TP
.I \-o incremento
Aggiunge
.RI < incremento >
alla posizione visualizzata dei byte del file.
.TP
.IR \-p " | " \-ps " | " \-postscript " | " \-plain
L'output <20> nello stile di un dump continuo sotto postscript.
Noto anche come stile esadecimale semplice [plain].
L'output <20> nello stile di un dump esadecimale continuo sotto postscript.
Noto anche come stile esadecimale semplice.
.TP
.IR \-r " | " \-revert
ricostruzione: converte (o mette una patch) a partire dall'immagine
esadecimale, creando [o modificando] il file binario.
Se non diretto allo "standard output", xxd scrive nel suo file di output
in maniera continua, senza interruzioni. Usare la combinazione
Ricostruisce: converte (o mette una patch) da immagine esadecimale, a file binario.
Se non scrive sullo `standard output', xxd scrive nel file di output in maniera
continua, senza interruzioni. Usare la combinazione
.I \-r \-p
per leggere dump in stile esadecimale semplice [plain], senza l'informazione
di numero di linea e senza un particolare tracciato di colonna. Degli spazi
o delle linee vuote possono essere inserite a piacere [e vengono ignorate].
per leggere un dump in stile esadecimale semplice, senza l'informazione del numero
di riga e senza un particolare tracciato di colonna. Spazi o righe vuote
possono essere presenti dappertutto [e vengono ignorati]. Usare la combinazione
.I \-r \-b
per leggere un dump binario, invece che un dump esadecimale.
.TP
.IR \-R " "[quando]
Nell'output i valori esadecimali e i caratteri corrispondenti hanno entrambi
lo stesso colore, a seconda del valore esadecimale. Utile soprattutto a
distinguere i caratteri stampabili da quelli non stampabili.
.I quando
pu<EFBFBD> assumere i valori
.BR never ", " always ", o " auto .
Quando la variabile d'ambiente
.BR $NO_COLOR
<EFBFBD> impostata, la colorazione viene disabilitata.
.TP
.I \-seek distanza
Usato con l'opzione
.IR \-r :
(ricostruzione),
.RI < distanza >
viene aggiunta alla posizione nel file trovata nella immagine
esadecimale.
viene aggiunta alla posizione nel file trovata nella immagine esadecimale.
.TP
.I \-s [+][\-]seek
Inizia a
.RI < seek >
byte assoluti (o relativi) di distanza all'interno di input_file.
\fI+ \fRindica che il "seek" <20> relativo alla posizione corrente nel file
"standard input" (non significativa quando non si legge da "standard input").
\fI\- \fRindica che il "seek" dovrebbe posizionarsi ad quel numero di
caratteri dalla fine dell'input (o se in combinazione con
\fI+ \fR: prime della posizione corrente nel file "standard input").
Se non si specifica una opzione \-s, xxd inizia alla posizione
corrente all'interno del file.
\fI+ \fRindica che il `seek' <20> relativo alla posizione corrente nel file `standard input'
(non significativo quando non si legge da `standard input'). \fI\- \fRindica che il
`seek' dovrebbe posizionarsi al numero specificato di caratteri dalla fine dell'input
(o se in combinazione con \fI+ \fR: prima della posizione corrente nel file `standard input').
Se non si specifica l'opzione \-s, xxd inizia dalla posizione corrente all'interno del file.
.TP
.I \-u
usa lettere esadecimali maiuscole. Il valore di default <EFBFBD> di usare
lettere minuscole.
Usa lettere esadecimali maiuscole. Per default si usano lettere minuscole.
.TP
.IR \-v " | " \-version
visualizza la stringa contenente la versione del programma.
Visualizza la stringa contenente la versione del programma.
.SH ATTENZIONE
.PP
.I xxd \-r
<EFBFBD> capace di operare "magie" nell'utilizzare l'informazione "numero di linea".
Se sul file di output ci si pu<70> posizionare usando la "seek", il numero di
linea all'inizio di ogni riga esadecimale pu<70> essere non ordinato, delle
linee possono mancare delle linee, oppure esserci delle sovrapposizioni.
In simili casi xxd user<65> lseek(2) per raggiungere la posizione d'inizio.
Se il file di output non consente di usare "seek", sono permessi solo dei
"buchi", che saranno riempiti con zeri binari.
<EFBFBD> capace di operare "magie" nell'utilizzare l'informazione "numero di riga".
Se <EFBFBD> possibili posizionarsi tramite `seek' sul file di output, il numero di riga
di ogni riga esadecimale pu<70> essere non ordinato, delle righe possono mancare, o
sovrapporsi. In tal caso xxd user<65> lseek(2) per posizionarsi all'interno del file.
Se per il file di output non si pu<70> usare `seek', sono permessi solo dei "buchi", che saranno riempiti con zeri binari.
.PP
.I xxd \-r
non genera mai errori di specifica parametri. I parametri non riconosciuti
sono silenziosamente ignorati.
non genera mai errori per parametri errati. I parametri extra sono silenziosamente ignorati.
.PP
Nel modificare immagini esadecimali, tenete conto che
Nel modificare immagini esadecimali, si tenga conto che
.I xxd \-r
salta il resto della linea, dopo aver letto abbastanza caratteri contenenti
dati esadecimali (vedere opzione \-c). Ci<43> implica pure che le modifiche alle
colonne di caratteri stampabili ascii (o ebcdic) sono sempre ignorate.
La ricostruzione da un file immagine esadecimale in stile semplice
(postscript) con xxd \-r \-p non dipende dal numero corretto di colonne.
IN questo caso, qualsiasi cosa assomigli a una coppia di cifre esadecimali
<EFBFBD> interpretata [e utilizzata].
salta il resto della riga, dopo aver letto i caratteri contenenti dati esadecimali
(vedere opzione \-c). Ci<43> implica pure che le modifiche alle colonne di caratteri
stampabili ASCII (o EBCDIC) sono sempre ignorate. La ricostruzione da un file immagine
esadecimale in stile semplice (postscript) con xxd \-r \-p non dipende dal numero corretto di colonne. In questo caso, qualsiasi cosa assomigli a una coppia di cifre esadecimali <20> interpretata [e utilizzata].
.PP
Notare la differenza fra
.br
@@ -183,53 +199,47 @@ e
.PP
.I xxd \-s \+seek
pu<EFBFBD> comportarsi in modo diverso da
.IR "xxd \-s seek"
, perch<EFBFBD> lseek(2) <20> usata per tornare indietro nel file di input. Il '+'
fa differenza se il file di input <20> lo "standard input", e se la posizione nel
file di "standard input" non <20> all'inizio del file quando xxd <20> eseguito,
con questo input.
I seguenti esempi possono contribuire a chiarire il concetto
(o ad oscurarlo!)...
.IR "xxd \-s seek" ,
perch<EFBFBD> lseek(2) <20> usata per tornare indietro nel file di input. Il '+'
fa differenza se il file di input <20> lo `standard input', e se la posizione nel
file di `standard input' non <20> all'inizio del file quando xxd <20> eseguito, e riceve input.
I seguenti esempi possono contribuire a chiarire il concetto (o ad oscurarlo!)...
.PP
Riavvolge lo "standard input" prima di leggere; necessario perch<63> `cat'
ha gi<67> letto lo stesso file ["file"] fino alla fine dello "standard input".
Riavvolge lo `standard input' prima di leggere; necessario perch<63> `cat'
ha gi<67> letto lo stesso file fino alla fine dello `standard input'.
.br
\fI% sh \-c 'cat > copia_normale; xxd \-s 0 > copia_esadecimale' < file
\fI% sh \-c "cat > copia_normale; xxd \-s 0 > copia_esadecimale" < file\fR
.PP
Stampa immagine esadecimale dalla posizione file 0x480 (=1024+128) in poi.
Il segno `+' vuol dire "rispetto alla posizione corrente", quindi il `128'
si aggiunge a 1k (1024) dove `dd' si era fermato.
.br
\fI% sh \-c 'dd of=normale bs=1k count=1; xxd \-s +128 > esadecimale' < file
\fI% sh \-c "dd of=normale bs=1k count=1; xxd \-s +128 > esadecimale" < file\fR
.PP
Immagine esadecimale dalla posizione 0x100 ( = 1024\-768 ) del file in avanti.
Immagine esadecimale dalla posizione 0x100 (=1024\-768 ) del file in avanti.
.br
\fI% sh \-c 'dd of=normale bs=1k count=1; xxd \-s +\-768 > esadecimale' < file
\fI% sh \-c "dd of=normale bs=1k count=1; xxd \-s +\-768 > esadecimale" < file
.PP
Comunque, questo capita raramente, e l'uso del `+' non serve quasi mai.
L'autore preferisce monitorare il comportamento di xxd con strace(1) o
truss(1), quando si usa l'opzione \-s.
L'autore preferisce monitorare il comportamento di xxd con strace(1) o truss(1), quando si usa l'opzione \-s.
.SH ESEMPI
.PP
.br
Stampa tutto tranne le prime tre linee (0x30 byte esadecimali) di
.B file
\.
Stampa tutto tranne le prime tre righe (0x30 byte in esadecimale) di
.BR file .
.br
\fI% xxd \-s 0x30 file
\fI% xxd \-s 0x30 file\fR
.PP
.br
Stampa 3 linee (0x30 byte esadecimali) alla fine di
.B file
\.
Stampa 3 righe (0x30 byte in esadecimale) alla fine di
.BR file .
.br
\fI% xxd \-s \-0x30 file
.PP
.br
Stampa 120 byte come immagine esadecimale continua con 20 byte per linea.
Stampa 120 byte come immagine esadecimale continua con 20 byte per riga.
.br
\fI% xxd \-l 120 \-ps \-c 20 xxd.1\fR
.br
2e54482058584420312022417567757374203139
.br
@@ -245,11 +255,9 @@ Stampa 120 byte come immagine esadecimale continua con 20 byte per linea.
.br
.br
Stampa i primi 120 byte della pagina di manuale vim.1 a 12 byte per linea.
Stampa i primi 120 byte della pagina di manuale xxd.1 a 12 byte per riga.
.br
\fI% xxd \-l 120 \-c 12 xxd.1\fR
.br
0000000: 2e54 4820 5858 4420 3120 2241 .TH XXD 1 "A
.br
@@ -285,13 +293,13 @@ su
.B output_file
premettendogli 100 byte a 0x00.
.br
\fI% xxd input_file | xxd \-r \-s 100 \> output_file\fR
\fI% xxd input_file | xxd \-r \-s 100 > output_file\fR
.br
.br
Modificare (patch) la data nel file xxd.1
.br
\fI% echo '0000037: 3574 68' | xxd \-r \- xxd.1\fR
\fI% echo "0000037: 3574 68" | xxd \-r \- xxd.1\fR
.br
\fI% xxd \-s 0x36 \-l 13 \-c 13 xxd.1\fR
.br
@@ -299,9 +307,9 @@ Modificare (patch) la data nel file xxd.1
.PP
.br
Creare un file di 65537 byte tutto a 0x00,
tranne che l'ultimo carattere che <20> una 'A' (esadecimale 0x41).
tranne l'ultimo carattere che <20> una 'A' (esadecimale 0x41).
.br
\fI% echo '010000: 41' | xxd \-r \> file\fR
\fI% echo "010000: 41" | xxd \-r > file\fR
.PP
.br
Stampa una immagine esadecimale del file di cui sopra con opzione autoskip.
@@ -314,34 +322,31 @@ Stampa una immagine esadecimale del file di cui sopra con opzione autoskip.
.br
000fffc: 0000 0000 40 ....A
.PP
Crea un file di 1 byte che contiene il solo carattere 'A'.
Creare un file di 1 byte che contiene il solo carattere 'A'.
Il numero dopo '\-r \-s' viene aggiunto a quello trovato nel file;
in pratica, i byte precedenti non sono stampati.
.br
\fI% echo '010000: 41' | xxd \-r \-s \-0x10000 \> file\fR
\fI% echo "010000: 41" | xxd \-r \-s \-0x10000 > file\fR
.PP
Usa xxd come filtro all'interno di un editor come
Usare xxd come filtro all'interno di un editor come
.B vim(1)
per ottenere una immagine esadecimale di una parte di file
delimitata dai marcatori `a' e `z'.
per ottenere l'immagine esadecimale della parte di file fra i marcatori `a' e `z'.
.br
\fI:'a,'z!xxd\fR
.PP
Usare xxd come filtro all'interno di un editor come
.B vim(1)
per ricostruire un pezzo di file binario da una immagine esadecimale
delimitata dai marcatori `a' e `z'.
per ricostruire un pezzo di file binario da un'immagine esadecimale fra i marcatori `a' e `z'.
.br
\fI:'a,'z!xxd \-r\fR
.PP
Usare xxd come filtro all'interno di un editor come
.B vim(1)
per ricostruire una sola linea di file binario da una immagine esadecimale,
Portare il cursore sopra la linea e battere:
per ricostruire una sola riga di file binario da un'immagine esadecimale. Portare il cursore sopra la riga e battere:
.br
\fI!!xxd \-r\fR
.PP
Per leggere singoli caratteri da una linea seriale
Leggere singoli caratteri da una linea seriale
.br
\fI% xxd \-c1 < /dev/term/b &\fR
.br
@@ -356,7 +361,8 @@ Il programma pu
nessun errore rilevato.
.TP
\-1
operazione non supportata (
operazione non supportata
\%(\c
.I xxd \-r \-i
non ancora possible).
.TP
@@ -370,14 +376,13 @@ problemi con il file di input.
problemi con il file di output.
.TP
4,5
posizione "seek" specificata non raggiungibile all'interno del file.
posizione `seek' specificata non raggiungibile all'interno del file.
.SH VEDERE ANCHE
uuencode(1), uudecode(1), patch(1)
.br
.SH AVVERTIMENTI
La stranezza dello strumento rispecchia la mente del suo creatore.
Usate a vostro rischio e pericolo. Copiate i file. Tracciate l'esecuzione.
Diventate un mago.
Usate a vostro rischio e pericolo. Copiate i file. Tracciate l'esecuzione. Diventate un mago.
.br
.SH VERSIONE
Questa pagina di manuale documenta la versione 1.7 di xxd.
@@ -393,7 +398,7 @@ fate soldi e condivideteli con me
.br
perdete soldi e non venite a chiederli a me.
.PP
Pagina di manuale messa in piedi da Tony Nugent
Pagina di manuale iniziata da Tony Nugent
.br
<tony@sctnugen.ppp.gu.edu.au> <T.Nugent@sct.gu.edu.au>
.br

View File

@@ -6,7 +6,7 @@
.\" Modificato da Bram Moolenaar <Bram@vim.org>
.SH NOME
.I xxd
\- Produce esadecimale da un file binario o viceversa.
\- Produce lista esadecimale da un file binario o viceversa.
.SH SINTASSI
.B xxd
\-h[elp]
@@ -18,36 +18,33 @@
\-r[evert] [opzioni] [input_file [output_file]]
.SH DESCRIZIONE
.I xxd
crea un'immagine esadecimale di un dato file o dello "standard input".
Può anche ottenere da un'immagine esadecimale il file binario originale.
crea un'immagine esadecimale di un dato file o dello `standard input'.
Può anche ricostruire da un'immagine esadecimale il file binario originale.
Come
.BR uuencode (1)
e
.BR uudecode (1)
permette di trasmettere dati binari in una rappresentazione ASCII "a prova
di email", ma ha anche il vantaggio di poter decodificare sullo "standard
output". Inoltre, può essere usato per effettuare delle modifiche (patch)
a file binari.
permette di trasmettere dati binari in una rappresentazione ASCII `a prova
di email', ma ha anche il vantaggio di poter decodificare sullo `standard output'.
Inoltre, può essere usato per effettuare delle modifiche (patch) a file binari.
.SH OPZIONI
Se non si specifica un
.I input_file
il programma legge dallo "standard input".
il programma legge dallo `standard input'.
Se
.I input_file
è specificato come il carattere
.RB \` \- '
, l'input è letto dallo "standard input".
, l'input è letto dallo `standard input'.
Se non si specifica un
.I output_file
(o si mette al suo posto il carattere
.RB \` \- '
), i risultati sono inviati allo "standard output".
), i risultati sono inviati allo `standard output'.
.PP
Si noti che la scansione dei caratteri è "pigra", e non controlla oltre
la prima lettera dell'opzione, a meno che l'opzione sia seguita da un
parametro.
Gli spazi fra una singola lettera di opzione e il corrispondente parametro
dopo di essa sono facoltativi.
Si noti che la scansione dei caratteri è "pigra", e non controlla oltre la prima
lettera di un'opzione, a meno che l'opzione sia seguita da un parametro.
Gli spazi fra una singola lettera di opzione e il relativo parametro sono facoltativi.
I parametri delle opzioni possono essere specificati usando la notazione
decimale, esadecimale oppure ottale.
Pertanto
@@ -56,122 +53,141 @@ Pertanto
.B \-c 010
e
.B \-cols 8
sono notazioni equivalenti fra loro.
sono tutte notazioni equivalenti fra loro.
.PP
.TP
.IR \-a " | " \-autoskip
Richiesta di autoskip: Un singolo '*' rimpiazza linee di zeri binari.
Valore di default: off.
Richiesta di omissione: Un singolo '*' rimpiazza righe a zeri binari. Default: off.
.TP
.IR \-b " | " \-bits
Richiesta di una immagine binaria (cifre binarie), invece che esadecimale.
Questa opzione scrive un byte come otto cifre "1" e "0" invece di usare i
numeri esadecimali. Ogni linea è preceduta da un indirizzo in esadecimale e
seguita da una decodifica ascii (o ebcdic). Le opzioni specificabili dalla
linea comando \-r, \-p, \-i non funzionano in questo modo.
Richiesta di un'immagine binaria (cifre binarie), invece che esadecimale.
Quest'opzione scrive un byte come otto cifre "1" e "0" invece di usare i
numeri esadecimali. Ogni riga è preceduta da un indirizzo in esadecimale e
seguita da una decodifica ASCII (o EBCDIC). Le opzioni \-p, \-i,
specificabili dalla riga comando, non funzionano in questo modo.
.TP
.IR "\-c colonne " | " \-cols colonne"
.IR "\-c colonne " | " \-cols colonne"
In ogni linea sono formattate
In ogni riga sono formattate
.RI < colonne >
colonne. Valore di default 16 (\-i: 12, \-ps: 30, \-b: 6).
Valore massimo 256.
Non c'è un valore massimo per \-ps; se si specifica 0 viene scritta un'unica lunga riga di output.
.TP
.IR \-C " | " \-capitalize
Mette in maiuscolo i nomi di variabili nello stile delle `include' C, se si usa \-i.
.TP
.IR \-E " | " \-EBCDIC
Cambia la codifica della colonna di destra da ASCII a EBCDIC.
Questo non modifica la rappresentazione esadecimale. Non ha senso
specificare questa opzione in combinazione con \-r, \-p o \-i.
specificare quest'opzione in combinazione con \-r, \-p o \-i.
.TP
.IR "\-g numero_byte " | " \-groupsize numero_byte"
Inserisci ogni
.RI < numero_byte >
byte di output (di due caratteri esadecimali o otto numeri binari ognuno)
uno spazio bianco.
.IR \-e
Considera la lista esadecimale come avente codifica `little-endian'.
Quest'opzione tratta i gruppi di byte come parole in codifica `little-endian'.
Il raggruppamento di default dei byte a 4 a 4 può essere cambiato usando
.RI "" \-g .
Quest'opzione si applica solo alla lista esadecimale, Lasciando inalterata
la rappresentazione ASCII (or EBCDIC).
Le opzioni della riga di comando
\-r, \-p, \-i non funzionano in questa modalità.
.TP
.IR "\-g numero " | " \-groupsize numero"
Separa ogni gruppo di
.RI < numero >
byte in output (di due caratteri esadecimali o otto caratteri binari ognuno) con uno spazio bianco.
Specificando
.I \-g 0
i byte di output non sono separati da alcuno spazio.
.RI < numero_byte > ha come valore di default " 2
in modalità normale [esadecimale] e \fI1\fP in modalità binaria.
Il raggruppamento non si applica agli stili "PostScript" e "include".
.RI < Numero "> ha come valore di default " 2
in modalità normale [esadecimale], \fI4\fP in modalità `little-endian' e \fI1\fP in modalità binaria.
Il raggruppamento non si applica agli stili `PostScript' e `include'.
.TP
.IR \-h " | " \-help
stampa un sommario dei comandi disponibili ed esce. Non viene fatto
null'altro.
Stampa un sommario dei comandi disponibili ed esce. Non viene fatto null'altro.
.TP
.IR \-i " | " \-include
L'output è nello stile dei file "include" in C. Viene preparata la
definizione completa di un "array" [vettore], dandogli il nome del
file di input), tranne che nel caso in cui xxd legga dallo "standard input".
L'output è un file `include' in C. Viene preparata la definizione completa del
vettore (col nome del file di input), tranne quando xxd legga dallo `standard input'.
.TP
.IR "\-l numero " | " \-len numero"
Il programma esce dopo aver scritto
.RI < numero >
byte.
.TP
.I "\-n nome " | " \-name nome"
Specifica il nome del vettore in output quando si usa \-i. Il vettore viene chiamato
\fInome\fP e la sua lunghezza viene chiamata \fInome\fP_len.
.TP
.I \-o incremento
Aggiunge
.RI < incremento >
alla posizione visualizzata dei byte del file.
.TP
.IR \-p " | " \-ps " | " \-postscript " | " \-plain
L'output è nello stile di un dump continuo sotto postscript.
Noto anche come stile esadecimale semplice [plain].
L'output è nello stile di un dump esadecimale continuo sotto postscript.
Noto anche come stile esadecimale semplice.
.TP
.IR \-r " | " \-revert
ricostruzione: converte (o mette una patch) a partire dall'immagine
esadecimale, creando [o modificando] il file binario.
Se non diretto allo "standard output", xxd scrive nel suo file di output
in maniera continua, senza interruzioni. Usare la combinazione
Ricostruisce: converte (o mette una patch) da immagine esadecimale, a file binario.
Se non scrive sullo `standard output', xxd scrive nel file di output in maniera
continua, senza interruzioni. Usare la combinazione
.I \-r \-p
per leggere dump in stile esadecimale semplice [plain], senza l'informazione
di numero di linea e senza un particolare tracciato di colonna. Degli spazi
o delle linee vuote possono essere inserite a piacere [e vengono ignorate].
per leggere un dump in stile esadecimale semplice, senza l'informazione del numero
di riga e senza un particolare tracciato di colonna. Spazi o righe vuote
possono essere presenti dappertutto [e vengono ignorati]. Usare la combinazione
.I \-r \-b
per leggere un dump binario, invece che un dump esadecimale.
.TP
.IR \-R " "[quando]
Nell'output i valori esadecimali e i caratteri corrispondenti hanno entrambi
lo stesso colore, a seconda del valore esadecimale. Utile soprattutto a
distinguere i caratteri stampabili da quelli non stampabili.
.I quando
può assumere i valori
.BR never ", " always ", o " auto .
Quando la variabile d'ambiente
.BR $NO_COLOR
è impostata, la colorazione viene disabilitata.
.TP
.I \-seek distanza
Usato con l'opzione
.IR \-r :
(ricostruzione),
.RI < distanza >
viene aggiunta alla posizione nel file trovata nella immagine
esadecimale.
viene aggiunta alla posizione nel file trovata nella immagine esadecimale.
.TP
.I \-s [+][\-]seek
Inizia a
.RI < seek >
byte assoluti (o relativi) di distanza all'interno di input_file.
\fI+ \fRindica che il "seek" è relativo alla posizione corrente nel file
"standard input" (non significativa quando non si legge da "standard input").
\fI\- \fRindica che il "seek" dovrebbe posizionarsi ad quel numero di
caratteri dalla fine dell'input (o se in combinazione con
\fI+ \fR: prime della posizione corrente nel file "standard input").
Se non si specifica una opzione \-s, xxd inizia alla posizione
corrente all'interno del file.
\fI+ \fRindica che il `seek' è relativo alla posizione corrente nel file `standard input'
(non significativo quando non si legge da `standard input'). \fI\- \fRindica che il
`seek' dovrebbe posizionarsi al numero specificato di caratteri dalla fine dell'input
(o se in combinazione con \fI+ \fR: prima della posizione corrente nel file `standard input').
Se non si specifica l'opzione \-s, xxd inizia dalla posizione corrente all'interno del file.
.TP
.I \-u
usa lettere esadecimali maiuscole. Il valore di default è di usare
lettere minuscole.
Usa lettere esadecimali maiuscole. Per default si usano lettere minuscole.
.TP
.IR \-v " | " \-version
visualizza la stringa contenente la versione del programma.
Visualizza la stringa contenente la versione del programma.
.SH ATTENZIONE
.PP
.I xxd \-r
è capace di operare "magie" nell'utilizzare l'informazione "numero di linea".
Se sul file di output ci si può posizionare usando la "seek", il numero di
linea all'inizio di ogni riga esadecimale può essere non ordinato, delle
linee possono mancare delle linee, oppure esserci delle sovrapposizioni.
In simili casi xxd userà lseek(2) per raggiungere la posizione d'inizio.
Se il file di output non consente di usare "seek", sono permessi solo dei
"buchi", che saranno riempiti con zeri binari.
è capace di operare "magie" nell'utilizzare l'informazione "numero di riga".
Se è possibili posizionarsi tramite `seek' sul file di output, il numero di riga
di ogni riga esadecimale può essere non ordinato, delle righe possono mancare, o
sovrapporsi. In tal caso xxd userà lseek(2) per posizionarsi all'interno del file.
Se per il file di output non si può usare `seek', sono permessi solo dei "buchi", che saranno riempiti con zeri binari.
.PP
.I xxd \-r
non genera mai errori di specifica parametri. I parametri non riconosciuti
sono silenziosamente ignorati.
non genera mai errori per parametri errati. I parametri extra sono silenziosamente ignorati.
.PP
Nel modificare immagini esadecimali, tenete conto che
Nel modificare immagini esadecimali, si tenga conto che
.I xxd \-r
salta il resto della linea, dopo aver letto abbastanza caratteri contenenti
dati esadecimali (vedere opzione \-c). Ciò implica pure che le modifiche alle
colonne di caratteri stampabili ascii (o ebcdic) sono sempre ignorate.
La ricostruzione da un file immagine esadecimale in stile semplice
(postscript) con xxd \-r \-p non dipende dal numero corretto di colonne.
IN questo caso, qualsiasi cosa assomigli a una coppia di cifre esadecimali
è interpretata [e utilizzata].
salta il resto della riga, dopo aver letto i caratteri contenenti dati esadecimali
(vedere opzione \-c). Ciò implica pure che le modifiche alle colonne di caratteri
stampabili ASCII (o EBCDIC) sono sempre ignorate. La ricostruzione da un file immagine
esadecimale in stile semplice (postscript) con xxd \-r \-p non dipende dal numero corretto di colonne. In questo caso, qualsiasi cosa assomigli a una coppia di cifre esadecimali è interpretata [e utilizzata].
.PP
Notare la differenza fra
.br
@@ -183,53 +199,47 @@ e
.PP
.I xxd \-s \+seek
può comportarsi in modo diverso da
.IR "xxd \-s seek"
, perché lseek(2) è usata per tornare indietro nel file di input. Il '+'
fa differenza se il file di input è lo "standard input", e se la posizione nel
file di "standard input" non è all'inizio del file quando xxd è eseguito,
con questo input.
I seguenti esempi possono contribuire a chiarire il concetto
(o ad oscurarlo!)...
.IR "xxd \-s seek" ,
perché lseek(2) è usata per tornare indietro nel file di input. Il '+'
fa differenza se il file di input è lo `standard input', e se la posizione nel
file di `standard input' non è all'inizio del file quando xxd è eseguito, e riceve input.
I seguenti esempi possono contribuire a chiarire il concetto (o ad oscurarlo!)...
.PP
Riavvolge lo "standard input" prima di leggere; necessario perché `cat'
ha già letto lo stesso file ["file"] fino alla fine dello "standard input".
Riavvolge lo `standard input' prima di leggere; necessario perché `cat'
ha già letto lo stesso file fino alla fine dello `standard input'.
.br
\fI% sh \-c 'cat > copia_normale; xxd \-s 0 > copia_esadecimale' < file
\fI% sh \-c "cat > copia_normale; xxd \-s 0 > copia_esadecimale" < file\fR
.PP
Stampa immagine esadecimale dalla posizione file 0x480 (=1024+128) in poi.
Il segno `+' vuol dire "rispetto alla posizione corrente", quindi il `128'
si aggiunge a 1k (1024) dove `dd' si era fermato.
.br
\fI% sh \-c 'dd of=normale bs=1k count=1; xxd \-s +128 > esadecimale' < file
\fI% sh \-c "dd of=normale bs=1k count=1; xxd \-s +128 > esadecimale" < file\fR
.PP
Immagine esadecimale dalla posizione 0x100 ( = 1024\-768 ) del file in avanti.
Immagine esadecimale dalla posizione 0x100 (=1024\-768 ) del file in avanti.
.br
\fI% sh \-c 'dd of=normale bs=1k count=1; xxd \-s +\-768 > esadecimale' < file
\fI% sh \-c "dd of=normale bs=1k count=1; xxd \-s +\-768 > esadecimale" < file
.PP
Comunque, questo capita raramente, e l'uso del `+' non serve quasi mai.
L'autore preferisce monitorare il comportamento di xxd con strace(1) o
truss(1), quando si usa l'opzione \-s.
L'autore preferisce monitorare il comportamento di xxd con strace(1) o truss(1), quando si usa l'opzione \-s.
.SH ESEMPI
.PP
.br
Stampa tutto tranne le prime tre linee (0x30 byte esadecimali) di
.B file
\.
Stampa tutto tranne le prime tre righe (0x30 byte in esadecimale) di
.BR file .
.br
\fI% xxd \-s 0x30 file
\fI% xxd \-s 0x30 file\fR
.PP
.br
Stampa 3 linee (0x30 byte esadecimali) alla fine di
.B file
\.
Stampa 3 righe (0x30 byte in esadecimale) alla fine di
.BR file .
.br
\fI% xxd \-s \-0x30 file
.PP
.br
Stampa 120 byte come immagine esadecimale continua con 20 byte per linea.
Stampa 120 byte come immagine esadecimale continua con 20 byte per riga.
.br
\fI% xxd \-l 120 \-ps \-c 20 xxd.1\fR
.br
2e54482058584420312022417567757374203139
.br
@@ -245,11 +255,9 @@ Stampa 120 byte come immagine esadecimale continua con 20 byte per linea.
.br
.br
Stampa i primi 120 byte della pagina di manuale vim.1 a 12 byte per linea.
Stampa i primi 120 byte della pagina di manuale xxd.1 a 12 byte per riga.
.br
\fI% xxd \-l 120 \-c 12 xxd.1\fR
.br
0000000: 2e54 4820 5858 4420 3120 2241 .TH XXD 1 "A
.br
@@ -285,13 +293,13 @@ su
.B output_file
premettendogli 100 byte a 0x00.
.br
\fI% xxd input_file | xxd \-r \-s 100 \> output_file\fR
\fI% xxd input_file | xxd \-r \-s 100 > output_file\fR
.br
.br
Modificare (patch) la data nel file xxd.1
.br
\fI% echo '0000037: 3574 68' | xxd \-r \- xxd.1\fR
\fI% echo "0000037: 3574 68" | xxd \-r \- xxd.1\fR
.br
\fI% xxd \-s 0x36 \-l 13 \-c 13 xxd.1\fR
.br
@@ -299,9 +307,9 @@ Modificare (patch) la data nel file xxd.1
.PP
.br
Creare un file di 65537 byte tutto a 0x00,
tranne che l'ultimo carattere che è una 'A' (esadecimale 0x41).
tranne l'ultimo carattere che è una 'A' (esadecimale 0x41).
.br
\fI% echo '010000: 41' | xxd \-r \> file\fR
\fI% echo "010000: 41" | xxd \-r > file\fR
.PP
.br
Stampa una immagine esadecimale del file di cui sopra con opzione autoskip.
@@ -314,34 +322,31 @@ Stampa una immagine esadecimale del file di cui sopra con opzione autoskip.
.br
000fffc: 0000 0000 40 ....A
.PP
Crea un file di 1 byte che contiene il solo carattere 'A'.
Creare un file di 1 byte che contiene il solo carattere 'A'.
Il numero dopo '\-r \-s' viene aggiunto a quello trovato nel file;
in pratica, i byte precedenti non sono stampati.
.br
\fI% echo '010000: 41' | xxd \-r \-s \-0x10000 \> file\fR
\fI% echo "010000: 41" | xxd \-r \-s \-0x10000 > file\fR
.PP
Usa xxd come filtro all'interno di un editor come
Usare xxd come filtro all'interno di un editor come
.B vim(1)
per ottenere una immagine esadecimale di una parte di file
delimitata dai marcatori `a' e `z'.
per ottenere l'immagine esadecimale della parte di file fra i marcatori `a' e `z'.
.br
\fI:'a,'z!xxd\fR
.PP
Usare xxd come filtro all'interno di un editor come
.B vim(1)
per ricostruire un pezzo di file binario da una immagine esadecimale
delimitata dai marcatori `a' e `z'.
per ricostruire un pezzo di file binario da un'immagine esadecimale fra i marcatori `a' e `z'.
.br
\fI:'a,'z!xxd \-r\fR
.PP
Usare xxd come filtro all'interno di un editor come
.B vim(1)
per ricostruire una sola linea di file binario da una immagine esadecimale,
Portare il cursore sopra la linea e battere:
per ricostruire una sola riga di file binario da un'immagine esadecimale. Portare il cursore sopra la riga e battere:
.br
\fI!!xxd \-r\fR
.PP
Per leggere singoli caratteri da una linea seriale
Leggere singoli caratteri da una linea seriale
.br
\fI% xxd \-c1 < /dev/term/b &\fR
.br
@@ -356,7 +361,8 @@ Il programma può restituire questi codici di errore:
nessun errore rilevato.
.TP
\-1
operazione non supportata (
operazione non supportata
\%(\c
.I xxd \-r \-i
non ancora possible).
.TP
@@ -370,14 +376,13 @@ problemi con il file di input.
problemi con il file di output.
.TP
4,5
posizione "seek" specificata non raggiungibile all'interno del file.
posizione `seek' specificata non raggiungibile all'interno del file.
.SH VEDERE ANCHE
uuencode(1), uudecode(1), patch(1)
.br
.SH AVVERTIMENTI
La stranezza dello strumento rispecchia la mente del suo creatore.
Usate a vostro rischio e pericolo. Copiate i file. Tracciate l'esecuzione.
Diventate un mago.
Usate a vostro rischio e pericolo. Copiate i file. Tracciate l'esecuzione. Diventate un mago.
.br
.SH VERSIONE
Questa pagina di manuale documenta la versione 1.7 di xxd.
@@ -393,7 +398,7 @@ fate soldi e condivideteli con me
.br
perdete soldi e non venite a chiederli a me.
.PP
Pagina di manuale messa in piedi da Tony Nugent
Pagina di manuale iniziata da Tony Nugent
.br
<tony@sctnugen.ppp.gu.edu.au> <T.Nugent@sct.gu.edu.au>
.br

View File

@@ -58,7 +58,7 @@
1 オクテットが "1" と "0" の 8 文字で出力されます。
各行の行頭には 16 進数の行番号が表示されます。
行末には ascii (または ebcdic) で表した場合の文字が表示されます。
このモードでは \-r、\-p、\-i は機能しません。
このモードでは \-p、\-i は機能しません。
.TP
.IR \-e
リトルエンディアンの 16 進ダンプに切り替える。

Some files were not shown because too many files have changed in this diff Show More