summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2024-02-28patch 9.1.0141: Put in Visual mode wrong if it replaces fold markerv9.1.0141zeertzjq
Problem: Put in Visual mode wrong if it replaces fold marker. Solution: Temporarily disable folding during put in Visual mode. (zeertzjq) fixes: #14097 closes: #14100 Signed-off-by: zeertzjq <zeertzjq@outlook.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-28translation(sr): Update Serbian translation (#14107)Ivan Pešić
Signed-off-by: Ivan Pešić <27575106+eevan78@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-27translation(it): Update Italian translationAntonio Giovanni Colombo
Signed-off-by: Antonio Giovanni Colombo <azc100@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-27patch 9.1.0140: cursor on wrong row after 1 char 'below' virtual text when ↵v9.1.0140Dylan Thacker-Smith
EOL is shown Problem: The cursor screen row was incorrectly being calculated when the cursor follows a 1 character text_align 'below' virtual text line, resulting in the cursor being shown on the wrong line. This was caused by a cell size of 2 instead of 1 being used for the EOL character, which propagated to the calculation of space for putting the 'below' virtual text on its own line. (rickhowe) Solution: Fix the size used for the EOL character in calculating the cursor's screen position (Dylan Thacker-Smith) fixes: #11959 related: #12028 closes: #14096 Signed-off-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com> 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-26patch 9.1.0139: MS-Windows: ligatures map cleared on startupv9.1.0139Erik S. V. Jansson
Problem: MS-Windows: ligatures map cleared on startup Solution: Don't clear the ligatures_map, if the guiligatures option has already been set (Erik S. V. Jansson) If guiligatures is set from a .vimrc it's possible that it will be cleared on start-up (e.g. in Win32 that's what happens). So don't clear the ligatures map if gui_set_ligatures() has already been called (e.g. after setting 'ligatures' from .vimrc) closes: #14094 Signed-off-by: Erik S. V. Jansson <caffeineviking@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-26patch 9.1.0138: too many STRLEN calls when getting a memlinev9.1.0138John Marriott
Problem: too many STRLEN calls when getting a memline Solution: Optimize calls to STRLEN(), add a few functions in memline.c that return the byte length instead of relying on STRLEN() (John Marriott) closes: #14052 Signed-off-by: John Marriott <basilisk@internode.on.net> 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-26patch 9.1.0137: <Del> in cmdline mode doesn't delete composing charsv9.1.0137zeertzjq
Problem: <Del> in cmdline mode doesn't delete composing chars Solution: Use mb_head_off() and mb_ptr2len() (zeertzjq) closes: #14095 Signed-off-by: zeertzjq <zeertzjq@outlook.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.0135: Insufficient testing for 'delcombine'v9.1.0135zeertzjq
Problem: Insufficient testing for 'delcombine'. Solution: Add test for both Normal and Insert modes without Arabic. (zeertzjq) closes: #14086 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-24patch 9.1.0134: CI: Test_term_gettitle() is flaky on MacOS 14v9.1.0134Christian Brabandt
Problem: Test_term_gettitle() is flaky on MacOS 14 and Github runners Solution: Skip the test on Github CI closes: #14085 It fails with this: '^\\[No Name\\] - VIM\\d*$' does not match 'e] - VIM' It is not clear why term_gettitle() only get's the last part of the expected title (perhaps there is a Carriage return in there or the terminal window is too small?) So let's just skip this test for now. 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-24patch 9.1.0132: "C" doesn't include composing chars with 'virtualedit'v9.1.0132zeertzjq
Problem: using "C" and 've=all' set, doesn't include composing chars when changing a line, keeps the composing chars for whatever is typed afterwards. Solution: Use mb_head_off() and mb_ptr2len() instead of mb_tail_off(). (zeertzjq) closes: #14083 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-24patch 9.1.0131: buffer-completion may not always find all matchesv9.1.0131Christian Brabandt
Problem: buffer-completion code too complicated and does not always find all matches (irisjae) Solution: do not try to anchor pattern to beginning of line or directory-separator, always return all matches Note: we are considering the non-fuzzy buffer-matching here. Currently, the buffer-completion code makes 2 attempts to match a pattern against the list of available patterns. First try is to match the pattern and anchor it to either the beginning of the file name or at a directory-separator (// or \\). When a match is found, Vim returns the matching buffers and does not try to find a match anywhere within a buffer name. So if you have opened two buffers like /tmp/Foobar.c and /tmp/MyFoobar.c using `:b Foo` will only complete to the first filename, but not the second (the same happens with `getcompletion('Foo', 'buffer')`). It may make sense, that completion priorities buffer names at directory boundaries, but it inconsistent, may cause confusion why a certain buffer name is not completed when typing `:b Foo<C-D>` which returns only a single file name and then pressing Enter (to switch to that buffer), Vim will error with 'E93: More than one match for Foo'). Similar things may happen when wiping the /tmp/Foobar.c pattern and afterwards the completion starts completing other buffers. So let's simplify the code and always match the pattern anywhere in the buffer name, do not try to favor matches at directory boundaries. This is also simplifies the code a bit, we do not need to run over the list of buffers several times, but only twice. fixes #13894 closes: #14082 Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-24patch 9.1.0130: [security]: UAF if win_split_ins autocommands delete "wp"v9.1.0130Sean Dewar
Problem: heap-use-after-free in win_splitmove if Enter/Leave autocommands from win_split_ins immediately closes "wp". Solution: check that "wp" is valid after win_split_ins. (Sean Dewar) closes: #14078 Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-24patch 9.1.0129: Fix truncation of text_wrap 'wrap' virt text after EOL list charv9.1.0129Dylan Thacker-Smith
Problem: Virtual text with text_wrap 'wrap' was effectively being truncated by a break conditional on the EOL list character being added to the screen line. (BigPeet) Solution: Remove the condition that was leading to the early break and instead fix a similar but incorrectly written outer condition that checks if there is more to add at the end of the screen line. (Dylan Thacker-Smith) Also, related: - update comment in win_line() - remove no longer necessary at_end_str variable in win_line() fixes: #12725 closes: #14079 Co-authored-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Dylan Thacker-Smith <dylan.ah.smith@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.0128: win_gotoid() may abort even when not switching a windowv9.1.0128Sean Dewar
Problem: win_gotoid() checks for textlock and other things when switching to a window that is already current (after v9.1.0119) Solution: return early with success when attempting to switch to curwin (Sean Dewar) Other potential causes of E565 from win_gotoid after v9.1.0119 should be correct. Plugins can consider using win_execute() instead if they wish to temporarily switch windows during textlock. fixes: #14073 closes: #14074 Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-22patch 9.1.0127: Naming a non-pointer variable "oap" is strangev9.1.0127zeertzjq
Problem: Naming a non-pointer variable "oap" is strange. Solution: Rename it to "oa". Also prevent using freed memory in case of memory allocation failure. (zeertzjq) closes: #14075 Signed-off-by: zeertzjq <zeertzjq@outlook.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-21patch 9.1.0125: unused init of text_prop_idxs in win_line()v9.1.0125Dylan Thacker-Smith
Problem: unused init of text_prop_idxs in win_line Solution: Remove it, fix typo (Dylan Thacker-Smith) Later use of text_prop_idxs treats it as empty, incrementing text_props_active as new elements are added to this array, so remove this unused conditional initialization when text_props_active is 0. closes: #14063 Signed-off-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-21patch 9.1.0124: display of below/right virtual text with non-virtual text ↵v9.1.0124Dylan Thacker-Smith
overlap Problem: Virtual text with text_align 'right'/'below' wasn't being used when a non-virtual text property overlaps with the end of the line. This was because the non-virtual text property had a higher priority, preventing the virtual text from being used. Solution: Fix the sorting of text properties so virtual text properties have a higher priority than non-virtual text properties. (Dylan Thacker-Smith) related: #14063 Signed-off-by: Dylan Thacker-Smith <dylan.ah.smith@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.0123: MS-Windows: system() may deadlockv9.1.0123GuyBrush
Problem: MS-Windows: system() may deadlock when calling binaries that expect stdin Solution: Ignore the SHELL_EXPAND flag (GuyBrush) This happens on binaries that expect stdin. For example: :echo system("xxd") will cause a deadlock. SHELL_EXPAND is a flag devoted to support the linux implementation of the backtick-expansion mechanism. On linux backtic-expansion relies in the function mch_expand_wildchars() (os_unix.c) that delegates on each specific shell (bash, sh, csh, zsh) the expansion. Basically it composes a shell command that does the expansion and redirects the output to a file and call_shell() it. On windows backtick-expansion is performed by Vim itself. On linux SHELL_EXPAND modifies how mch_call_shell_fork() (os_unix.c) works. This function: - relies on posix fork() to spawn a child process to execute a external command. - Child and parent process communicate using pipes (or pseudoterminal if available). User input (type ahead content) is processed in a loop only if !(SHELL_EXPAND || SHELL_COOKED). Though signals are used to detect Ctrl-C in all cases (the input loop is not necessary to interrupt the function). In the backtick-expansion the external command is the shell command that provides the expansion. For the child redirection: - SHELL_EXPAND replaces stdin, stdout & stderr to /dev/null. This is why the shell command composed includes redirection (otherwise output would be lost). - !SHELL_EXPAND replaces stdin, stdout & stderr with the parent created pipes (or pseudoterminal). Note that the use of SIGINT signal prevents mch_call_shell_fork() from hanging vim. On Windows mch_system_piped() (os_win32.c) (which is only used when the GUI is running) mimics mch_call_shell_fork() (os_unix.c). Win32 lacks fork() and relies on CreateProcessW() and only has pipe support (not pseudoterminal) which makes the implementation much different. But, the key idea is that windows lacks signals, the OS provides support for console apps but gvim is not one. The only way of detecting a Ctrl-C is actually processing user input (type ahead content). By ignoring the user input under SHELL_EXPAND the function can hang gvim. Ignoring SHELL_EXPAND flag has no consequence in Windows because as mentioned above it is only meaningful in linux. closes: #13988 Signed-off-by: GuyBrush <miguel.barro@live.com> 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.0121: Infinite loop or signed overflow with 'smoothscroll'v9.1.0121Sean Dewar
Problem: infinite loop in win_update with 'smoothscroll' set when window width is equal to textoff, or signed integer overflow if smaller. Solution: don't revalidate wp->w_skipcol in that case, as no buffer text is being shown. (Sean Dewar) Don't instead reset w_skipcol; that would lose the scroll position within the line, which may be undesirable if the window is made wider later. Also include changes from the splitmove PR #14042 that I (in my infinite Git wisdom) forgot to commit. This includes a change to Test_window_split_no_room to ensure it doesn't fail for some screen sizes. Move Test_smoothscroll_in_zero_width_window to test_scroll_opt.vim, as that file feels more appropriate. closes: #14068 Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.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.0119: can move away from cmdwin using win_splitmove()v9.1.0119Sean Dewar
Problem: can switch windows while textlocked via f_win_gotoid and f_win_splitmove (which also allows switching in the cmdwin). Solution: Check text_or_buf_locked in f_win_splitmove() (Sean Dewar) While at it, call text_or_buf_locked() in f_win_gotoid() instead of testing for cmdwin_type() (which text_buf_locked() does and in addition will also verify that the buffer is not locked). closes: #14042 Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-20patch 9.1.0118: Use different restoration strategy in win_splitmovev9.1.0118Sean Dewar
Problem: saving and restoring all frames to split-move is overkill now that WinNewPre is not fired when split-moving. Solution: defer the flattening of frames until win_split_ins begins reorganising them, and attempt to restore the layout by undoing our changes. (Sean Dewar) This also means we no longer must allocate. related: #14042 Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.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-20patch 9.1.0116: win_split_ins may not check available roomv9.1.0116Sean Dewar
Problem: win_split_ins has no check for E36 when moving an existing window Solution: check for room and fix the issues in f_win_splitmove() (Sean Dewar) win_split_ins has no check for E36 when moving an existing window, allowing for layouts with many overlapping zero-sized windows to be created (which may also cause drawing issues with tablines and such). f_win_splitmove also has some bugs. So check for room and fix the issues in f_win_splitmove. Handle failure in the two relevant win_split_ins callers by restoring the original layout, and factor the common logic into win_splitmove. Don't check for room when opening an autocommand window, as it's a temporary window that's rarely interacted with or drawn anyhow, and is rather important for some autocommands. Issues fixed in f_win_splitmove: - Error if splitting is disallowed. - Fix heap-use-after-frees if autocommands fired from switching to "targetwin" close "wp" or "oldwin". - Fix splitting the wrong window if autocommands fired from switching to "targetwin" switch to a different window. - Ensure -1 is returned for all errors. Also handle allocation failure a bit earlier in make_snapshot (callers, except win_splitmove, don't really care if a snapshot can't be made, so just ignore the return value). Note: Test_smoothscroll_in_zero_width_window failed after these changes with E36, as it was using the previous behaviour to create a zero-width window. I've fixed the test such that it fails with UBSAN as expected when v9.0.1367 is reverted (and simplified it too). related: #14042 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-19CI: install gnudiff and enable `Test_diffmode` on macos-14 runner again (#14056)Linda_pp
Signed-off-by: rhysd <lin90162@yahoo.co.jp> 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>