summaryrefslogtreecommitdiffstats
path: root/runtime
AgeCommit message (Collapse)Author
2024-03-05patch 9.1.0150: Several minor 'winfixbuf' issuesv9.1.0150Sean Dewar
Problem: several minor 'winfixbuf' issues exist, mostly relating to the quickfix list Solution: address them and adjust tests. Retab and reflow a few things too. (Sean Dewar) Things touched include: - Replace the semsgs with gettext'd emsgs. - Handle window switching in ex_listdo properly, so curbuf and curwin are kept in-sync and trigger autocommands; handle those properly. - Don't change the list entry index in qf_jump_edit_buffer if we fail due to 'wfb' (achieved by returning FAIL; QF_ABORT should only be used if the list was changed). - Make qf_jump_edit_buffer actually switch to prevwin when using `:cXX` commands **outside** of the list window if 'wfb' is set in curwin. Handle autocommands properly in case they mess with the list. NOTE: previously, it seemed to split if 'wfb' was set, but do nothing and fail if prevwin is *valid*. This behaviour seemed strange, and maybe unintentional? Now it aligns more with what's described for the `:cXX` commands in the original PR description when used outside a list window, I think. - In both functions, only consider prevwin if 'wfb' isn't set for it; fallback to splitting otherwise. - Use win_split to split. Not sure if there was a specific reason for using ex_splitview. win_split is simpler and respects modifiers like :vertical that may have been used. Plus, its return value can be checked for setting opened_window in qf code (technically win_split_ins autocmds could immediately close it or change windows, in which the qf code might close some other window on failure; it's already the case elsewhere, though). closes: #14142 Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-05runtime(c): Recognize "__inline" (#14145)Wu Yongwei
`__inline` is recognized by GCC, and may even be preferred, as MSVC does not recognize `__inline__`. Signed-off-by: Wu Yongwei <wuyongwei@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-04runtime(vim): Update base-syntax, fix escaping :syn and :hi sub-groups (#14137)dkearns
* runtime(vim): Update base-syntax, fix escaping :syn and :hi sub-groups - Remove contained :syntax and :highlight sub-groups from the function body cluster. These should only match in the respective commands. - Remove vimSynLine syntax group from several clusters. The definition of vimSynLine was removed in Vim 5.3. * runtime(vim): Update syntax generator, use standard Last Change date format The de facto standard date format is YYYY MMM DD. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-04runtime(sh): Update syntax file, fix issue #962 (#14138)dkearns
Allow the opening parenthesis of a multiline array assignment, within an if statement, to appear at EOL. Fixes issue #962. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-04runtime(css): update syntax scriptJay Sitter
Signed-off-by: Jay Sitter <jay@jaysitter.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-03runtime(vim): Update base-syntax, fix issue #14135 (#14136)dkearns
Fix incorrect error highlighting for function calls in :command definitions. vimFunctionError should be restricted to :function header lines. fixes: #14135 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-03runtime(doc): Highlight the error message at *E1513*Christian Brabandt
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-03runtime(vim): Update base-syntax, improve :augroup highlighting (#14125)dkearns
- Explicitly match the bang and group name in :aug! {name}. - Allow any characters in a group name. - Match default group switch marker, END. - Match :aug without arguments (list command). Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-03runtime(mswin): Use unnamed register when clipboard not working (#13813)Shixian Li
* Use unnamed register while clipboard not exist * Do not need to specify the unnamed register explicitly fixes: #13809 Signed-off-by: Shixian Li <lsx7@sina.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-03patch 9.1.0148: Vim9: can't call internal methods with objectsv9.1.0148Yegappan Lakshmanan
Problem: Vim9: can't call internal methods with objects Solution: Add support for empty(), len() and string() function calls for objects (Yegappan Lakshmanan) closes: #14129 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-03patch 9.1.0147: Cannot keep a buffer focused in a windowv9.1.0147Colin Kennedy
Problem: Cannot keep a buffer focused in a window (Amit Levy) Solution: Add the 'winfixbuf' window-local option (Colin Kennedy) fixes: #6445 closes: #13903 Signed-off-by: Colin Kennedy <colinvfx@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-03runtime(java): Recognise text blocks (#14128)Aliaksei Budavei
Also, accept as valid the space escape sequence `\s`. Also, consistently use the claimed `javaDebug` prefix for syntax group definitions kept under `g:java_highlight_debug`. Since `javaStringError` is commented out for its generality, let's comment out `javaDebugStringError`, its copy, as well. References: https://openjdk.org/jeps/378 https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.7 Closes #10910. Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-02runtime(r,rhelp,rmd,rnoweb,rrst): Update ftplugin, browsefilter labels (#14126)dkearns
Use the standard format for browsefilter labels: "File Description (*.ext1, *.ext2, *.ext3)" Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-01runtime(java): Improve the recognition of literals (#14120)Aliaksei Budavei
* Emend the Unicode and octal escape sequence patterns; * Accept the (repeated) underscore separators in all numerical literals; * Recognise hexadecimal floating-point literals. (The space escape sequence '\s' will be introduced along with text blocks in another PR.) References: https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.3 https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.1 https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.2 https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.7 Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-01runtime(doc): some improvements to getregion() docs (#14122)zeertzjq
- Mention the default selection behavior - Remove useless sentence - Correct description about space padding Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-29runtime(doc,netrw): update "Last Change header", remove trailing whitespaceChristian Brabandt
Update Last-Change Header for netrw and doc/indent.txt, fix a trailing whitespace in indent.txt and make CI happy. Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-29runtime(netrw): handle file/dir symlinks specifically in tree modeChristian Brabandt
fixes: #2386 related: #3609 Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-29runtime(yaml): disable multiline_scalar detection by defaultChristian Brabandt
There have been many complaints about Yaml indenting too much, because it considers values to be multi-line by default, which leads to unintended indenting for (apparently most) users. So let's hide this feature behind the new feature flag, keep it simple and prefer single line value key pairs by default. If you want the old behaviour, set the following value: > :let g:yaml_indent_multiline_scalar = 1 If not set, it will indent the same as the previous line. closes #13845 Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-28patch 9.1.0142: getregion() can be improvedv9.1.0142Shougo Matsushita
Problem: getregion() can be improved (after v9.1.120) Solution: change getregion() implementation to use pos as lists and one optional {opt} dictionary (Shougo Matsushita) Note: The following is a breaking change! Currently, the getregion() function (included as of patch v9.1.120) takes 3 arguments: the first 2 arguments are strings, describing a position, arg3 is the type string. However, that is slightly inflexible, there is no way to specify additional arguments. So let's instead change the function signature to: getregion(pos1, pos2 [, {Dict}]) where both pos1 and pos2 are lists. This is slightly cleaner, and gives us the flexibility to specify additional arguments as key/value pairs to the optional Dict arg. Now it supports the "type" key to specify the selection type (characterwise, blockwise or linewise) and now in addition one can also define the selection type, independently of what the 'selection' option actually is. Technically, this is a breaking change, but since the getregion() Vimscript function is still quite new, this should be fine. closes: #14090 Co-authored-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-28runtime(doc): Fix typo under *kitty-terminal* in term.txtelig0n
closes: #14106 Signed-off-by: elig0n <31196036+elig0n@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-28runtime(java): Recognise _when_ clauses in _switch_ blocksAliaksei Budavei
Also: - distinguish _yield_ when used as a contextual keyword from when used qualified as a method or a method reference (as can be seen in testdir/input/java_switch.java, variables and method declarations named _yield_ will be recognised as the namesake keyword--consider picking other names for variables, and defining g:java_highlight_functions to have method names painted; since _yield_ statements can have trailing parens, they must be recognised as statements, for only qualified _yield_ method calls are supported); - recognise grouped _default_ _case_ labels; - describe primitive types for _case_ labels (JLS, §14.11, §3.10.1); - recognise some non-ASCII identifiers (see javaLambdaDef, javaUserLabel) (further improvement for better recognition of identifiers will be arranged in a separate PR). Because the arrow '->' is used in two kinds of expressions, lambda (abstractions) and _switch_, necessary changes were made for the recognition of either (and further improvement touching lambda expressions will be separately arranged). Because 'default' is used for instance method declarations in interfaces and in _switch_ labels, necessary changes were made for the recognition of either (and further improvement touching method declarations will be separately arranged). Finally, it deemed appropriate to put 'yield' in the syntax group of javaOperator rather than javaStatement, for its member 'var' is also another contextual keyword (e.g., this is valid syntax: "var var = var(test.var);"). References: https://openjdk.org/jeps/361 (Switch Expressions) https://openjdk.org/jeps/440 (Record Patterns) https://openjdk.org/jeps/441 (Pattern Matching for switch) Also, add a Java specific filetype plugin for the syntax test, so that no soft-wrapping of long indented lines occur. Otherwise the syntax scripts would miss a few lines during scrolling and verification of the screen dumps. closes: #14105 Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-28runtime(syntax-tests): simplify code and allow filetype optionsChristian Brabandt
The whole testdir/runtest.vim is a bit of a mess. So this is an attempt to improving the current state. First of all, let's move most of the code into a single RunTest() function so that it's easier to run this manually. Then, let's add the possibility to customize filetype specific tests by applying filetype specific options. We will make use of it in the next commit, where the provided java file uses tabs, which cause line wrapping which will then cause the scrolling to miss some lines when redrawing (see #14105) related: #14105 Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-27runtime(sh): Update ftplugin, fix #14101 (#14102)dkearns
Add the 'b' flag to 'comments', so that the shebang line is not detected as comment. Fixes #14101. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-27runtime(vim): Update base-syntax, improve :echo highlighting (#14103)dkearns
- Normalise behaviour of :echo commands and improve expression matching. - Allow continued argument lines. - Refine string interpolation groups. - Remove duplicated :menu and :map generated commands that are handled specially later in the file. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-27runtime(debian): update Debian syntax files (#14098)James McCoy
* debversions.vim: Move lunar to unsupported release * debsources: Add word boundaries around keyword match patterns Co-authored-by: James Addison <jay@jp-hosting.net> Signed-off-by: James Addison <jay@jp-hosting.net> Signed-off-by: James McCoy <jamessan@jamessan.com> Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-26runtime(vim): Update syntax file, improve :substitute matching (#14093)dkearns
- Differentiate between :substitute and substitute(), fixes #13883. - Match all allowed :substitute delimiters. - Remove leading context from :substitute matches. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-25runtime(doc): Fix typo in usr_41.txtDoug Kearns
closes: #14092 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-25runtime(doc): fix inconsistent indent (#14089)zeertzjq
Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-25patch 9.1.0136: Vim9: need more test for exists()v9.1.0136Yegappan Lakshmanan
methods Problem: Vim9: need more test for exists() Solution: Add test for exists() with class/objct variables and methods (Yegappan Lakshmanan) closes: #14088 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-24runtime(doc): clarify ':set[l] {option}<' behaviourMatt Ellis
closes: #14062 Signed-off-by: Matt Ellis <m.t.ellis@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-24patch 9.1.0133: MS-Windows: ligatures not rendering correctlyv9.1.0133Erik S. V. Jansson
Problem: font ligatures don't render correctly in the Win32 GUI-version of gvim even when set rop=type:directx is used. Setting guiligatures also doesn't make any difference. This leads to broken font ligatures when the cursor passes through them. It does not recover from this, and they remain broken until you re-render the whole buffer (e.g. by using Ctrl+L). Solution: the problem is that we only re-draw the current and previous character in gui_undraw_cursor() and only have the special case for GTK when it comes to rendering ligatures. So let's enable gui_adjust_undraw_cursor_for_ligatures() to also happen for Win32 GUI if guiligatures is setup correctly (all this does is expand the range of gui_undraw_cursor() with ligature characters). related: #9181 related: #12901 closes: #14084 Signed-off-by: Erik S. V. Jansson <caffeineviking@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-24runtime(doc) Update help text for matchbufline() and matchstrlist()Yegappan Lakshmanan
closes: #14080 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-24runtime(tutor): small fixes to the zh tutor (#14081)dragonish
dragonish <no.web.developer@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-22runtime(spec): Recognize SourceLicense tag name in RPM spec syntax (#14046)Petr Pisar
rpm-4.19.0 added a new SourceLicense tag. It is used at the same place as License tag. This patch adds the new tag name into a Vim syntax file to be highligted the same way as the License tag. Note that it has to be defined in the syntax file before Source\d* regexp. Otherwise it's not recognized by Vim. Signed-off-by: Petr Písař <ppisar@redhat.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-22patch 9.1.0126: Internal error when using upper-case mark in getregion()v9.1.0126zeertzjq
Problem: Internal error when passing mark in another buffer to getregion(). Solution: Don't allow marks in another buffer (zeertzjq) closes: #14076 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Internal error when passing mark in another buffer to getregion()
2024-02-22runtime(vim): Update base-syntax, fix :unabbrev highlighting (#14077)dkearns
Fixes issue #7876 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-22runtime(java): add syntax support for Java switch expressions (#9124)Nick Hanley
Signed-off-by: Nick Hanley <nicholasjhanley@gmail.com> Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-21runtime(doc): clarify expand() for :terminal windowsChristian Brabandt
While adding to the documentation, also mention the rolled-back key-translation strategy in version9.txt closes: #14069 Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-21patch 9.1.0122: Some minor issues with the getregion() functionv9.1.0122Maxim Kim
Problem: Some minor issues with the getregion() function Solution: Fix examples in the help, use OP_NOP op_type and MBLOCK as motion_type in f_getreg(), update vim syntax to for getregion() (Maxim Kim) ``` :xnoremap <CR> \ <Cmd>echow getregion('v', '.', mode())<CR> ``` `echo` while in visual mode has no visible effect, thus people trying example might be frustrated as it looks like nothing happens. So the option is to change it to `echow` or `echom`. With `echom` it is again has no visible effect but one can at least inspect `:messages`. On the other hand `echow` showes selected text in a popup window. ``` Can also be used as a |method|: > '.'->getregion("'a', 'v') ``` Here is the typo, which makes example invalid, should be `("'a", ...` closes: #14064 Signed-off-by: Maxim Kim <habamax@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-21runtime(tmux): Update tmux syntax (#14065)Eric Pruitt
Signed-off-by: Eric Pruitt <eric.pruitt@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-21patch 9.1.0120: hard to get visual region using Vim scriptv9.1.0120Shougo Matsushita
Problem: hard to get visual region using Vim script Solution: Add getregion() Vim script function (Shougo Matsushita, Jakub Łuczyński) closes: #13998 closes: #11579 Co-authored-by: =?UTF-8?q?Jakub=20=C5=81uczy=C5=84ski?= <doubleloop@o2.pl> Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com> Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-20patch 9.1.0117: Stop split-moving from firing WinNew and WinNewPre autocommandsv9.1.0117Sean Dewar
Problem: win_splitmove fires WinNewPre and possibly WinNew when moving windows, even though no new windows are created. Solution: don't fire WinNew and WinNewPre when inserting an existing window, even if it isn't the current window. Improve the accuracy of related documentation. (Sean Dewar) Likewise, before this patch, WinClosed was not fired anyway (even for :wincmd H/J/K/L, which also didn't fire WinNew, but did still fire WinNewPre), despite documentation saying windows are "closed". Note that :wincmd T actually indeed works by creating a new window (and closing the old one), unlike the others. This also fixes issues where WinNewPre is fired when split-moving while curwin doesn't yet have a frame or entry in the window list, causing many things to not work (it's not considered valid at that point). This was guaranteed when using :wincmd H/J/K/L. Because WinNewPre is no longer fired when split-moving, this makes restoring the previous window layout on failure easier, as we can be sure that frames are not resized from WinNewPre autocommands if win_split_ins fails. This allows us to use a different strategy in the following commit. -- In my opinion, this leaves questions about the current usefulness of WinNewPre. A motivation described in #10635 states how creating a new window can steal room from other windows, and how WinNewPre will be useful for detecting that, but this is also true when inserting an existing window, which now doesn't fire it. Maybe the autocommand should be changed to have a better name? There are also other issues I found with the current implementation of WinNewPre that need addressing: - it allows switching windows and tabpages, which can cause incorrect windows to be split/moved, and big problems when switching tabpages. - it fires before win_split_ins checks for room, before it makes any changes to window sizes or before it considers allocating a new window. This should be changed or documented. I hope to address some of this stuff in a different PR, if possible. related: #14038 Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-20runtime(doc): Add a place holder section for version 9.2 (#14060)Yegappan Lakshmanan
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-19runtime(filetype): Modula-2 files with priority not detected (#14055)dkearns
Problem: Modula-2 files with a specified priority are not detected. Solution: Match the priority syntax in module header lines when performing heuristic content detection. Disable the :defcompile debug line. This was accidentally left enabled in commit 68a8947. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-19runtime(misc): announce adoption of various runtime filesChristian Brabandt
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-18runtime(vim): Distinguish Vim9 constructor definitions from the :new ex ↵Aliaksei Budavei
command (#14050) With the arrival of Vim9 classes, the syntax must allow for _new_ constructors; multiple constructor definitions are supported for a class, provided distinct suffix-names are used. Currently, the defined constructors match either vimCommand or vimFunctionError (for any newBar). For example: ------------------------------------------------------------ vim9script class Foo def new() enddef def newBar() enddef endclass ------------------------------------------------------------ Since every constructor is required to bear a lower-cased _new_ prefix name, it should suffice to distinguish them from functions, and so there are no new highlight or syntax groups introduced. Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: h-east <h.east.727@gmail.com> Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-18patch 9.1.0115: Using freed memory with full tag stack and user datav9.1.0115zeertzjq
Problem: Using freed memory with full tag stack and user data (Konstantin Khlebnikov) Solution: Clear the user data pointer of the newest entry. (zeertzjq, Konstantin Khlebnikov) fixes: neovim/neovim#27498 closes: #14053 Co-authored-by: Konstantin Khlebnikov koct9i@gmail.com Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Konstantin Khlebnikov koct9i@gmail.com Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-18runtime(doc): Fix typo in testing.txt (#14054)h_east
Signed-off-by: h-east <h.east.727@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-15runtime(less): update "Last Change:" headerChristian Brabandt
Commit 103f1dfb7df350650a5d7caadb0364bd79e9d25b forgot to update the "Last Change:" header. So update it now. Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-15runtime(less): reset readonly setting when disabling less modeChristian Brabandt
While at it, also do the unmap only if a specific key has been mapped. There are some keys that are only selectively mapped and it would cause an error if we are trying to unmap such a key (e.g. z when your foldmethod is not manual). fixes: #14040 Signed-off-by: Christian Brabandt <cb@256bit.org>