Compare commits

...

18 Commits

Author SHA1 Message Date
Bram Moolenaar
80ad3e2569 patch 8.2.2443: Vim9: no compile time error for wrong str2float argument
Problem:    Vim9: no compile time error for wrong str2float argument.
Solution:   Check argument type. (closes #7759)
2021-01-31 20:48:58 +01:00
Bram Moolenaar
f272ae12ac patch 8.2.2442: automatic GUI selection does not check for GTK 3
Problem:    Automatic GUI selection does not check for GTK 3.
Solution:   Make SKIP_GTK3 empty for automatic GUI support.  Set SKIP_GTK3 to
            YES when checking for GTK2.
2021-01-31 19:52:50 +01:00
Bram Moolenaar
c03f5c677a patch 8.2.2441: Vim9: extend() does not give an error for a type mismatch
Problem:    Vim9: extend() does not give an error for a type mismatch.
Solution:   Check the type of the second argument. (closes #7760)
2021-01-31 17:48:30 +01:00
Bram Moolenaar
853886722c patch 8.2.2440: documentation based on patches is outdated
Problem:    Documentation based on patches is outdated.
Solution:   Add changes to documentation in a patch.
2021-01-31 17:03:52 +01:00
Bram Moolenaar
3d2bb8b6f1 patch 8.2.2439: not easy to figure out what packages to get
Problem:    Not easy to figure out what packages to get when installing Vim on
            a new Ubuntu system.
Solution:   Mention explicit commands that are easy to follow.
2021-01-31 16:45:53 +01:00
Bram Moolenaar
6a12e3342d patch 8.2.2438: out of bounds compiler warning
Problem:    Out of bounds compiler warning.
Solution:   Increase the size of uf_name.
2021-01-31 14:46:00 +01:00
Bram Moolenaar
4d8479b335 patch 8.2.2437: deprecation warnings with default configuration
Problem:    Deprecation warnings with default configuration.
Solution:   Add -Wno-deprecated-declarations.
2021-01-31 14:36:06 +01:00
Bram Moolenaar
206c2a6e19 patch 8.2.2436: Vim9 script test is a bit flaky
Problem:    Vim9 script test is a bit flaky.
Solution:   Wait longer for exit callback.
2021-01-31 14:04:44 +01:00
Bram Moolenaar
3445320839 patch 8.2.2435: setline() gives an error for some types
Problem:    setline() gives an error for some types.
Solution:   Allow any type, convert each item to a string.
2021-01-31 13:08:38 +01:00
Bram Moolenaar
f2b26bcf8f patch 8.2.2434: Vim9: no error when compiling str2nr() with a number
Problem:    Vim9: no error when compiling str2nr() with a number.
Solution:   Add argument type checks. (closes #7759)
2021-01-30 23:05:11 +01:00
Bram Moolenaar
b63f3ca66d patch 8.2.2433: opening cmdline window gives error in BufLeave autocommand
Problem:    Opening cmdline window gives error in BufLeave autocommand.
Solution:   Reset cmdwin_type when triggering the autocommand.
2021-01-30 21:40:03 +01:00
Bram Moolenaar
76ab5446d5 patch 8.2.2432: libvterm tests are executed even when libtool doesn't work
Problem:    Libvterm tests are executed even when libtool doesn't work.
Solution:   Only run libvterm tests if /usr/bin/gcc exists.
2021-01-30 20:35:28 +01:00
Bram Moolenaar
ebd211c8a3 patch 8.2.2431: warning for -fno-strength-reduce with Clang 11
Problem:    Warning for -fno-strength-reduce with Clang 11.
Solution:   Adjust check for clang version number.
2021-01-30 19:33:36 +01:00
Bram Moolenaar
f8c6a17180 patch 8.2.2430: :vimgrep expands wildcards twice
Problem:    :vimgrep expands wildcards twice.
Solution:   Do not expand wildcards a second time.
2021-01-30 18:09:06 +01:00
Bram Moolenaar
59ff64079b patch 8.2.2429: :goto does not work correctly with text properties
Problem:    :goto does not work correctly with text properties. (Sam McCall)
Solution:   Add a test. (Andrew Radev)  Also use the text property size when
            computing the remaining offset. (closes #5930)
2021-01-30 17:16:28 +01:00
Bram Moolenaar
92e5df8047 patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Problem:    FocusGained does not work when 'ttymouse' is empty.
Solution:   Don't use the short mouse code if there is a longer matching code.
            (closes #7755)  Add a test.
2021-01-30 15:39:47 +01:00
Bram Moolenaar
3eb6bd9c2b patch 8.2.2427: can still switch windows for 'completefunc'
Problem:    Can still switch windows for 'completefunc'.
Solution:   Also disallow switching windows for other completions.
2021-01-29 21:47:24 +01:00
Bram Moolenaar
28976e2acc patch 8.2.2426: allowing 'completefunc' to switch windows causes trouble
Problem:    Allowing 'completefunc' to switch windows causes trouble.
Solution:   use "textwinlock" instead of "textlock".
2021-01-29 21:07:07 +01:00
35 changed files with 476 additions and 275 deletions

View File

@@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 8.2. Last change: 2020 Dec 19
*autocmd.txt* For Vim version 8.2. Last change: 2021 Jan 28
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -54,7 +54,8 @@ effects. Be careful not to destroy your text.
:au[tocmd] [group] {event} {pat} [++once] [++nested] {cmd}
Add {cmd} to the list of commands that Vim will
execute automatically on {event} for a file matching
{pat} |autocmd-patterns|.
{pat} |autocmd-patterns|.
Here {event} cannot be "*". *E1155*
Note: A quote character is seen as argument to the
:autocmd and won't start a comment.
Vim always adds the {cmd} after existing autocommands,

View File

@@ -1,4 +1,4 @@
*cmdline.txt* For Vim version 8.2. Last change: 2020 Dec 26
*cmdline.txt* For Vim version 8.2. Last change: 2021 Jan 26
VIM REFERENCE MANUAL by Bram Moolenaar

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.2. Last change: 2021 Jan 22
*eval.txt* For Vim version 8.2. Last change: 2021 Jan 31
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -293,13 +293,13 @@ is not available it returns zero or the default value you specify: >
List concatenation ~
*list-concatenation*
Two lists can be concatenated with the "+" operator: >
:let longlist = mylist + [5, 6]
:let mylist += [7, 8]
To prepend or append an item turn the item into a list by putting [] around
it. To change a list in-place see |list-modification| below.
To prepend or append an item, turn the item into a list by putting [] around
it. To change a list in-place, refer to |list-modification| below.
Sublist ~
@@ -3133,6 +3133,7 @@ append({lnum}, {text}) *append()*
text line below line {lnum} in the current buffer.
Otherwise append {text} as one text line below line {lnum} in
the current buffer.
Any type of item is accepted and converted to a String.
{lnum} can be zero to insert a line before the first one.
Returns 1 for failure ({lnum} out of range or out of memory),
0 for success. Example: >
@@ -9409,6 +9410,8 @@ setline({lnum}, {text}) *setline()*
{lnum} is used like with |getline()|.
When {lnum} is just below the last line the {text} will be
added below the last line.
{text} can be any type or a List of any type, each item is
converted to a String.
If this succeeds, FALSE is returned. If this fails (most likely
because {lnum} is invalid) TRUE is returned.

View File

@@ -8,7 +8,7 @@ Vim had built-in support for hangul, the Korean language, for users without
XIM (X Input Method). Since it didn't work well and was not maintained it was
removed in Vim 8.1.2327.
If you want this hangul input mehod you can go back to Vim 8.1.2326 or
If you want this hangul input method you can go back to Vim 8.1.2326 or
earlier. If you think this code is still useful and want to maintain it, make
a patch to add it back. However, making it work with UTF-8 encoding would be
best.

View File

@@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.2. Last change: 2021 Jan 25
*todo.txt* For Vim version 8.2. Last change: 2021 Jan 31
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -38,8 +38,6 @@ browser use: https://github.com/vim/vim/issues/1234
*known-bugs*
-------------------- Known bugs and current work -----------------------
test_autocmd failure in Windows: Something wrong with system()?
Vim9 - Make everything work:
- Add a test for profiling with nested function calls and lambda.
- Expand `=expr` in :next, :argedit, :argadd, :argdelete, :drop
@@ -186,9 +184,8 @@ Text properties:
- Popup attached to text property stays visible when text is no longer
visible. (#7736)
- Popup attached to text property stays visible when text is deleted with
"cc". (#7737) "C" works OK.
- :goto does not go to the right place when text properties are present.
(#5930)
"cc". (#7737) "C" works OK. "dd" also files in a buffer with a single
line.
- "cc" does not call inserted_bytes(). (Axel Forsman, #5763)
- Combining text property with 'cursorline' does not always work (Billie
Cleek, #5533)
@@ -249,7 +246,6 @@ Terminal emulator window:
be redrawn.
- GUI: When using ":set go+=!" a system() call causes the hit-enter prompt.
(#3327)
- GUI: hang until key typed. (#3530)
- Allow for specifying the directory, with ++cwd={dir}.
- With a vertical split only one window is updated. (Linwei, 2018 Jun 2,
#2977)
@@ -271,7 +267,9 @@ Terminal emulator window:
- When 'encoding' is not utf-8, or the job is using another encoding, setup
conversions.
Error numbers available: E653
Valgind reports memory leaks in test_options
test_arglist func Test_all_not_allowed_from_cmdwin() hangs on MS-Windows.
Mapping with partial match not executed properly in GTK. (Ingo Karkat, #7082)
@@ -284,8 +282,6 @@ Was originally written by Felipe Morales.
Adding "10" to 'spellsuggest' causes spell suggestions to become very slow.
(#4087) Did patch 8.2.2379 help?
Patch to find Python dll using registry key. (#7540)
Remove SPACE_IN_FILENAME ? It is only used for completion.
Making breakat support multibyte characters (Yasuhiro Matsumoto, #6598)
@@ -379,10 +375,6 @@ When "+ register is set then "" points to it. If another Vim grabs the "+
register, then "" doesn't contain anything. Make it still follow "+.
(#6435)
Patch to fix drawing error with DirectX. (James Grant, #5688)
Causes flicker on resizing. Workaround from Ken Takata.
How about only setting the attribute when part of the Vim window is offscreen?
File marks merging has duplicates since 7.4.1925. (Ingo Karkat, #5733)
"make test_gui" crashed in submenu_change(). Fix and remove workaround in
@@ -476,9 +468,6 @@ Help for ":argadd fname" says that if "fname" is already in the argument list
that entry is used. But instead it's always added. (#6210)
Add flag AL_FIND_ADD, if there is one argument find it in the list.
behavior of i_CTRl-R_CTRL-R differs from documentation. (Paul Desmond Parker,
#5771)
":bnext" in a help buffer is supposed to go to the next help buffer, but it
goes to any buffer, and then :bnext skips help buffers, since they are
unlisted. (#4478)
@@ -490,9 +479,6 @@ find them. (Max Kukartsev, #6218)
Enable 'termbidi' if $VTE_VERSION >= 5703 ?
Universal solution to detect if t_RS is working, using cursor position.
Koichi Iwamoto, #2126
Sound: support on Mac? Or does libcanberra work there?
Python 3.8 doesn't work. (Antonios Hadjigeorgalis, #5509)
@@ -505,15 +491,8 @@ support combining characters. (Charles Campbell) Also #4687
Output from assert_equalfile() doesn't give a hint about what's different.
Assuming the files are text, print the line with the difference.
Add "t" action to settagstack(): truncate and add new entries. (#5405)
When 'relativenumber' is set the line just below a diff change doesn't get
updated. (#6138)
Result of synID() sometimes wrong in help files. (#5252)
Status line is nut updated when splitting windows. (Marcin Szamotulski, #5496)
Problem showing a line if the number column width changes when using "o".
(Mateusz Morusiewicz, #4245)
@@ -526,9 +505,6 @@ with packages under "start". (xtal8, #1994)
Patch to add new motion ]( and ]{. (Yasuhiro Matsumoto, #5320)
Better: use the "z" prefix. or ]t) and [t(.
Modeless selection doesn't work in gvim. (#4783)
Caused by patch 8.1.1534.
Visual highlight not removed when 'display' is "lastline" and line doesn't
fit. (Kevin Lawler, #4457)
@@ -539,9 +515,6 @@ Does not build with MinGW out of the box:
- WINVER conflict, should use 0x0600 by default?
- INT_MAX not defined: need to include <limits.h> in vim.h
Crash when mixing matchadd and substitute()? (Max Christian Pohle, 2018 May
13, #2910) Can't reproduce?
Display messed up with matchparen, wrapping and scrolling. (#5638)
Screen update bug related to matchparen. (Chris Heath, 2017 Mar 4, #1532)
@@ -568,16 +541,10 @@ Patch to add the :bvimgrep command. (Christian Brabandt, 2014 Nov 12)
Updated 2016 Jun 10, #858 Update 2017 Mar 28: use <buffer>.
Better use ":bufgrep" ?
Errors found with random data:
heap-buffer-overflow in alist_add (#2472)
Improve fallback for menu translations, to avoid having to create lots of
files that source the actual file. E.g. menu_da_de -> menu_da
Include part of #3242?
When a terminal exit_cb closes the window, a following typed key is lost, if
it's in a mapping. (2018 Oct 6, #2302, #3522)
Patch to have text objects defined by arbitrary single characters. (Daniel
Thau, 2013 Nov 20, 2014 Jan 29, 2014 Jan 31)
Added tests (James McCoy, 2016 Aug 3, #958). Still needs more work.
@@ -590,11 +557,6 @@ Williams, 2018 Oct 30)
'[ mark in wrong column after put. (#4776)
"exepath('bin/cmd')" does not work while ":!bin/cmd" does work.
(Daniel Hahler, #4710) and executable('bin/cmd') returns 1
Error drawing the number column when 'cursorline' is set. (#3893)
Problem with :tlmenu: Detach item added with all modes? Issue #3563.
Add an argument to expandcmd() to expand like ":next" does.
@@ -664,9 +626,6 @@ Should we include some part of pull request #4505, not increment changedtick
in some cases? E.g. for ":write" when the changed flag was already off, the
buffer didn't change at all.
Line numbers in profile are off when function was defined with ":execute".
(Daniel Hahler, #4511)
Session file contains absolute paths when "curdir" is removed form
'sessionoptions', making it impossible to have a session with a relative path.
(#4450)
@@ -729,9 +688,6 @@ a hint about how to fix it. (#4300)
Make balloon_show() work outside of 'balloonexpr'? Users expect it to work:
#2948. (related to #1512?)
On Win32 it stops showing, because showState is already ShS_SHOWING.
balloon_show() does not work properly in the terminal. (Ben Jackson, 2017 Dec
20, #2481)
Also see #2352, want better control over balloon, perhaps set the position.
Should also be possible to add highlighting, like in the status line?
balloonexpr() on MS-Windows GUI doesn't handle accented chars? (nivaemail,
@@ -757,12 +713,6 @@ Redo only remembers the last change. Could use "{count}g." to redo an older
change. How does the user know which change? At least have a way to list
them: ":repeats". Add to history, like search history and command line history.
Incsearch test fails when locale is "C". (Dominique Pelle, #3986)
Also run all tests with C locale?
"vat" doesn't work well on XML when the closing > is on another line.
#3927
Pasting foo} causes Vim to behave weird. (John Little, 2018 Jun 17)
Related to bracketed paste. I cannot reproduce it.
@@ -781,8 +731,6 @@ Some xterm responses are not properly handled: (Markus Gömmel, 2019 Apr 1)
Using CTRL-L to add a character to the search string that contains \v,
punctuation is repeated. (Smylers, 2018 Nov 17, #3621)
ml_get error: (Israel Chauca Fuentes, 2018 Oct 17, #3550).
Using single wide base character with double wide composing character gives
drawing errors. Fill up the base character? (Dominique, #4328)
@@ -817,8 +765,6 @@ Memory leak in test_alot with pyeval() (allocating partial)
Memory leak in test_alot with expand()
Memory leaks in test_channel? (or is it because of fork())
gethostbyname() is old, use getaddrinfo() if available. (#3227)
matchaddpos() gets slow with many matches. Proposal by Rick Howe, 2018 Jul
19.
@@ -838,22 +784,15 @@ Problem with Visual yank when 'linebreak' and 'showbreak' are set.
Patch with tests, but it's not clear how it is supposed to work. (tommm, 2018
Nov 17) Asked about this, Dec 22. Christian will have a look.
Patch to fix that using "5gj" starting inside a closed fold does not work on
screen lines but on text lines. (Julius Hulsmann, #4095) Lacks a test.
home_replace() uses $HOME instead of "homedir". (Cesar Martins, 2018 Aug 9)
When the status line uses term_gettitle(), it does not get updated when the
terminal title changes. (Josh Triplett, 2018 Sep 9, #3418)
How would we know that the status line needs to be updated?
Adjust windows installer explanation of behavior. (scootergrisen, #3310)
Update for xim-input-style help (Tony Mechelynck, 2019 Jan 10).
Feedback from someone who uses this?
ml_get error. (Dominique Pelle, 2018 Sep 14, #3434)
Only output t_Cs when t_Ce is also set. do not use Cs and Ce termcap entries. (Daniel Hahler, 2018 Sep 25)
Add t_cS and t_cR for cursor color select and reset. Use Cs and Cr terminfo
values.
@@ -876,41 +815,22 @@ includes the first screen line. (2018 Aug 23, #3368)
Refactored HTML indent file. (Michael Lee, #1821)
Asked to write a test.
MS-Windows: .lnk file not resolved properly when 'encoding' is set.
(lkintact, 2018 Sep 22, #3473)
Merge checking for 'cursorline' and 'concealcursor', see neovim #9492.
Display error when a conceal match uses '\%>1l'. (#4854)
Add a windowID argument to placing a sign, so that it only shows up in one
window for the buffer.
Request to add sign_setlist() to make it faster to add a lot of signs, e.g.
when adding a sign for every quickfix entry. (#4557)
Win32 key codes are messy. Mike Williams tried to fix that, but now old
mappings no longer work. Create a new terminal for the better solution?
Compiler warnings (geeknik, 2017 Oct 26):
- signed integer overflow in do_sub() (#2249)
- signed integer overflow in get_address() (#2248)
- signed integer overflow in getdecchrs() (#2254)
- undefined left shift in get_string_tv() (#2250)
Win32 console: <F11> and <F12> typed in Insert mode don't result in normal
characters. (#3246)
'foldtext' is evaluated too often. (Daniel Hahler, #2773)
Add Native language protocol server (LSP) support. (Yegappan Lakshmanan, 2018
Oct 28)
ml_get error when using a Python script. (Yggdroot, 2017 Jun 1, #1737)
Lemonboy can reproduce (2017 Jun 5)
Also reproduced by Benjamin Doherty, 2018 Oct 4.
Simpler way: Ken Takata, Oct 6.
Add more testing of the GTK GUI.
- gtk_test_widget_click() can be used to simulate a click in a widget.
@@ -969,8 +889,6 @@ missing: --nofork, -A , -b, -h, etc.
":au * * command" should not be allowed, only use * for event when listing or
deleting autocmds, not when adding them.
Alternative manpager.vim. (Enno, 2018 Jan 5, #2529)
With 'foldmethod' "indent" and appending an empty line, what follows isn't
included in the existing fold. Deleting the empty line and undo fixes it.
(Oleg Koshovetc, 2018 Jul 15, #3214)
@@ -992,9 +910,6 @@ Python indenting: alternative way to indent arguments:
http://orchistro.tistory.com/236
Should be supported with a flag.
Starting job with cwd option, when the directory does not exist, gives a
confusing error message. (Wang Shidong, 2018 Jan 2, #2519)
Add the debug command line history to viminfo.
Add Makefiles to the runtime/spell directory tree, since nobody uses Aap.
@@ -1015,9 +930,6 @@ With foldmethod=syntax and nofoldenable comment highlighting isn't removed.
Using 'wildignore' also applies to literally entered file name. Also with
:drop (remote commands).
Inserting a line in a CompleteDone autocommand may confuse undo. (micbou,
2018 Jun 18, #3027)
Implement option_save() and option_restore():
option_restore({list}) *option_restore()*
Restore options previously saved by option_save().
@@ -1053,8 +965,6 @@ Also see #1689.
When 'virtualedit' is "all" and 'cursorcolumn' is set, the wrong column may be
highlighted. (van-de-bugger, 2018 Jan 23, #2576)
":file" does not show anything when 'shortmess' contains 'F'. (#3070)
No profile information for function that executes ":quit". (Daniel Hahler,
2017 Dec 26, #2501)
@@ -1065,9 +975,6 @@ Add script number to profile? (#3330 breaks tests).
A function defined locally and lambda's are not easily recognized.
Mention where they were defined somewhere.
Invalid range error when using BufWinLeave for closing terminal.
(Gabriel Barta, 2017 Nov 15, #2339)
ml_get errors with buggy script. (Dominique, 2017 Apr 30)
Error in emsg with buggy script. (Dominique, 2017 Apr 30)
@@ -1133,10 +1040,6 @@ line breaks. (Ken Takata, 2017 Aug 22)
The ":move" command does not honor closed folds. (Ryan Lue, #2351)
Patch to fix increment/decrement not working properly when 'virtualedit' is
set. (Hirohito Higashi, 2016 Aug 1, #923)
Was this fixed?
Cannot copy modeless selection when cursor is inside it. (lkintact, #2300)
Test_writefile_fails_conversion failure on Solaris because if different iconv
@@ -1176,9 +1079,6 @@ Patch from Christian Brabandt to preserve upper case marks when wiping out a
buffer. (2013 Dec 9)
Also fixes #2166?
Python: After "import vim" error messages only show the first line of the
stack trace. (Yggdroot, 2017 Jul 28, #1887)
Profile of a dict function is lost when the dict is deleted. Would it be
possible to collect this? (Daniel Hahler, #2350)
@@ -1189,8 +1089,6 @@ Patch to skip writing a temp file for diffing if the buffer is equal to the
existing file. (Akria Sheng, 2017 Jul 22)
Could also skip writing lines that are the same.
Patch with Files for Latvian language. (Vitolins, 2017 May 3, #1675)
MS-Windows: Opening same file in a second gvim hangs. (Sven Bruggemann, 2017
Jul 4)
@@ -1213,16 +1111,9 @@ Use gvimext.dll from the nightly build? (Issue #249)
Problem with using :cd when remotely editing a file. (Gerd Wachsmuth, 2017 May
8, #1690)
Bogus characters inserted when triggering indent while changing text.
(Vitor Antunes, 2016 Nov 22, #1269)
Using "wviminfo /tmp/viminfo" does not store file marks that Vim knows about,
it only works when merging with an existing file. (Shougo, 2017 Jun 19, #1781)
Segmentation fault with complete(). (Lifepillar, 2017 Apr 29, #1668)
Check for "pat" to be NULL in search_for_exact_line()?
How did it get NULL? Comment by Christian, Apr 30.
Is it possible to keep the complete menu open when calling complete()?
(Prabir Shrestha, 2017 May 19, #1713)
@@ -1264,9 +1155,6 @@ Wrong diff highlighting with three files. (2016 Oct 20, #1186)
Also get E749 on exit.
Another example in #1309
When deleting a mark or register, leave a tombstone, so that it's also deleted
when writing viminfo (and the delete was the most recent action). #1339
Suggestion to improve pt-br spell checking. (Marcelo D Montu, 2016 Dec 15,
#1330)
@@ -1295,9 +1183,6 @@ Check for errors E704 and E705 only does VAR_FUNC, should also do VAR_PARTIAL.
(Nikolai Pavlov, 2017 Mar 13, #1557)
Make a function to check for function-like type?
Screen updated delayed when using CTRL-O u in Insert mode.
(Barlik, #1191) Perhaps because status message?
Implement named arguments for functions with optional arguments:
func Foo(start, count = 1, all = 1)
call Foo(12, all = 0)
@@ -1333,9 +1218,6 @@ Useful to restore it. Is there another solution?
Patch for wrong cursor position on wrapped line, involving breakindent.
(Ozaki Kiichi, 2016 Nov 25)
Does this also fix #1408 ?
'cursorline' and match interfere. (Ozaki Kiichi, 2017 Jun 23, #1792)
Patch for 'cursorlinenr' option. (Ozaki Kiichi, 2016 Nov 30)
@@ -1384,7 +1266,6 @@ is used. (Filipe Brandenburger, #7322)
gets redrawn in redraw_after_callback(). #6120
- Add a separate timeout for opening a socket. Currently it's fixed at 50
msec, which is too small for a remote connection. (tverniquet, #2130)
- Problem with stderr on Windows? (Vincent Rischmann, 2016 Aug 31, #1026)
- Writing raw mode to a buffer should still handle NL characters as line
breaks. (Dmitry Zotikov, 2017 Aug 16)
- When out_cb executes :sleep, the close_cb may be invoked. (Daniel Hahler,
@@ -1500,11 +1381,6 @@ the system encoding (usually utf-8).
MS-Windows: use WS_HIDE instead of SW_SHOWMINNOACTIVE in os_win32.c?
Otherwise task flickers in taskbar.
Repeating 'opfunc' in a function only works once. (Tarmean, 2016 Jul 15, #925)
Have a way to get the call stack, in a function and from an exception.
#1125
Second problem in #966: ins_compl_add_tv() uses get_dict_string() multiple
times, overwrites the one buffer. (Nikolay Pavlov, 2016 Aug 5)
@@ -1564,10 +1440,6 @@ Mechelynck) Perhaps use exists("::tearoff") to check?
Use vim.vim syntax highlighting for help file examples, but without ":" in
'iskeyword' for syntax.
When command names are very long :command output is difficult to read. Use a
maximum for the column width? (#871)
Patcy by varmanishant, 2016 Jun 18, #876
Installation of .desktop files does not work everywhere.
It's now fixed, but the target directory probably isn't right.
Add configure check?
@@ -1584,12 +1456,6 @@ Especially useful when using 'linebreak'
":cd C:\Windows\System32\drivers\etc*" does not work, even though the
directory exists. (Sergio Gallelli, 2013 Dec 29)
In debug mode one can inspect variables, but not the function parameters
(starting with a:). (Luc Hermitte, 2017 Jan 4, #1352)
If ":bd" also closes a Tab page then the " mark is not set. (Harm te Hennepe,
2016 Apr 25, #780)
Patch to avoid redrawing tabline when the popup menu is visible.
(Christian Brabandt, 2016 Jan 28)
@@ -1640,9 +1506,6 @@ Patch to add :mapgroup, put mappings in a group like augroup.
Value returned by virtcol() changes depending on how lines wrap. This is
inconsistent with the documentation.
Value of virtcol() for '[ and '] depend on multibyte character.
(Luchr, #277)
Can we cache the syntax attributes, so that updates for 'relativenumber' and
'cursorline'/'cursorcolumn' are a lot faster? Thus store the attributes
before combining them.
@@ -2525,6 +2388,7 @@ part of standard Vim. The "1 to "9 registers are not sufficient.
6 When yanking into the unnamed registers several times, somehow make the
previous contents also available (like it's done for deleting). What
register names to use? g"1, g"2, etc.?
Also do this for the small delete register "-.
After doing "su" $HOME can be the old user's home, thus ~root/file is not
correct. Don't use it in the swap file.
@@ -3281,15 +3145,11 @@ Quickfix/Location List:
window is cleared, to avoid going back to the list of errors buffer (would
have two windows with it). Can we just remove the jump list entries for
the quickfix buffer?
- Quickfix window height is not kept with a vertical split. (Lifepillar,
2018 Jun 10, #2998)
- When an item in the quickfix list has a file name that does not exist,
behave like the item was not a match for :cnext.
- When adding an item to a new quickfix list make ":cnext" jump to that
item. Make a difference being at the first item and not having used
:cnext at all. (Afanasiy Fet, 2017 Jan 3)
- This does not work: :set cscopequickfix=a-
(Linewi, 2015 Jul 12, #914)
- When opening quickfix window, disable spell checking?
- Patch for supporting count before CR in quickfix window. (AOYAMA Shotaro,
2007 Jan 1)

View File

@@ -1,4 +1,4 @@
*various.txt* For Vim version 8.2. Last change: 2021 Jan 16
*various.txt* For Vim version 8.2. Last change: 2021 Jan 26
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -345,8 +345,9 @@ N *+clientserver* Unix and Win32: Remote invocation |clientserver|
*+clipboard* |clipboard| support compiled-in
*+clipboard_working* |clipboard| support compiled-in and working
T *+cmdline_compl* command line completion |cmdline-completion|
S *+cmdline_hist* command line history |cmdline-history|
T *+cmdline_hist* command line history |cmdline-history|
N *+cmdline_info* |'showcmd'| and |'ruler'|
S *+cmdwin* |cmdline-window| support
T *+comments* |'comments'| support
B *+conceal* "conceal" support, see |conceal| |:syn-conceal| etc.
N *+cryptv* encryption support |encryption|

View File

@@ -16933,7 +16933,7 @@ Solution: Add #ifdefs.
Files: src/screen.c
Patch 8.0.0383 (after 8.0.0382)
Problem: Misplaced #ifdef. (Christ van Willigen)
Problem: Misplaced #ifdef. (Christ van Willegen)
Solution: Split assignment.
Files: src/screen.c
@@ -19612,7 +19612,7 @@ Files: Filelist
Patch 8.0.0815
Problem: Terminal window not correctly updated when 'statusline' invokes
":sleep". (NIkolay Pavlov)
":sleep". (Nikolay Pavlov)
Solution: Clear got_int. Repeat redrawing when needed.
Files: src/terminal.c

View File

@@ -39,13 +39,53 @@ version of Vim that is small and starts up quickly, see the Makefile for how
to disable the GUI and X11. If you don't have GUI libraries and/or X11, these
features will be disabled automatically.
To built Vim on Ubuntu from scratch on a clean system using git:
Install tools required to be able to get and build Vim:
% sudo apt install git
% sudo apt install make
% sudo apt install clang
Build Vim with default features:
% git clone https://github.com/vim/vim.git
% cd vim/src
% make
Run tests to check there are no problems:
% make test
Install Vim in /usr/local:
% sudo make install
Add X windows clipboard support (also needed for GUI):
% sudo apt install libxt-dev
% make reconfig
Add GUI support (ignore compiler warnings):
% sudo apt install libgtk2.0-dev
% make reconfig
Add Python 3 support:
% sudo apt install libpython3-dev
Uncomment this line in Makefile:
"CONF_OPT_PYTHON3 = --enable-python3interp"
% make reconfig
Debugging:
% sudo apt install valgrind
Uncomment this line in Makefile:
CFLAGS = -g -Wall -Wextra -Wshadow -Wmissing-prototypes -Wunreachable-code -Wno-deprecated-declarations -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
% make reconfig
% make test_{test-name}
See output in testdir/valgrind.test_{test-name}
See the start of Makefile for more detailed instructions about how to compile
Vim.
If you need extra compiler and/or linker arguments, set $CFLAGS and/or $LIBS
before starting configure. Example:
env CFLAGS=-I/usr/local/include LIBS=-lm make
env CFLAGS=-I/usr/local/include LIBS=-lm make
This is only needed for things that configure doesn't offer a specific argument
for or figures out by itself. First try running configure without extra

View File

@@ -2294,9 +2294,12 @@ run_message_test: $(MESSAGE_TEST_TARGET)
# Run the libvterm tests.
# This works only on GNU make, not on BSD make.
# Libtool requires "gcc".
test_libvterm:
@if $(MAKE) --version 2>/dev/null | grep -qs "GNU Make"; then \
cd libvterm; $(MAKE) -f Makefile test CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"; \
if test -x "/usr/bin/gcc"; then \
cd libvterm; $(MAKE) -f Makefile test CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"; \
fi \
fi
# Run individual OLD style test.

View File

@@ -315,10 +315,10 @@ get_arglist_exp(
return FAIL;
if (wig == TRUE)
i = expand_wildcards(ga.ga_len, (char_u **)ga.ga_data,
fcountp, fnamesp, EW_FILE|EW_NOTFOUND);
fcountp, fnamesp, EW_FILE|EW_NOTFOUND|EW_NOTWILD);
else
i = gen_expand_wildcards(ga.ga_len, (char_u **)ga.ga_data,
fcountp, fnamesp, EW_FILE|EW_NOTFOUND);
fcountp, fnamesp, EW_FILE|EW_NOTFOUND|EW_NOTWILD);
ga_clear(&ga);
return i;

15
src/auto/configure vendored
View File

@@ -4482,7 +4482,7 @@ with_x_arg="$with_x"
if test -z "$CFLAGS"; then
CFLAGS="-O"
test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall"
test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall -Wno-deprecated-declarations"
fi
if test "$GCC" = yes; then
gccversion=`$CC -dumpversion`
@@ -4510,9 +4510,9 @@ if test x"$CLANG_VERSION_STRING" != x"" ; then
CLANG_VERSION=`expr $CLANG_MAJOR '*' 1000000 '+' $CLANG_MINOR '*' 1000 '+' $CLANG_REVISION`
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CLANG_VERSION" >&5
$as_echo "$CLANG_VERSION" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if clang supports -fno-strength-reduce" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if clang supports -fno-strength-reduce" >&5
$as_echo_n "checking if clang supports -fno-strength-reduce... " >&6; }
if test "$CLANG_VERSION" -ge 500002075 ; then
if test "$CLANG_MAJOR" -ge 10 -o "$CLANG_VERSION" -ge 500002075 ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
CFLAGS=`echo "$CFLAGS" | sed -e 's/-fno-strength-reduce/ /'`
@@ -9262,6 +9262,7 @@ $as_echo "no GUI support" >&6; } ;;
$as_echo "yes/auto - automatic GUI support" >&6; }
gui_auto=yes
SKIP_GTK2=
SKIP_GTK3=
SKIP_GNOME=
SKIP_MOTIF=
SKIP_ATHENA=
@@ -9523,6 +9524,8 @@ $as_echo "gtk test disabled" >&6; }
fi
if test "x$PKG_CONFIG" != "xno"; then
save_skip_gtk3=$SKIP_GTK3
SKIP_GTK3=YES
if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then
{
@@ -9666,6 +9669,8 @@ $as_echo "no" >&6; }
SKIP_MOTIF=YES
GUITYPE=GTK
else
SKIP_GTK3=$save_skip_gtk3
fi
fi
if test "x$GUITYPE" = "xGTK"; then
@@ -9778,6 +9783,8 @@ $as_echo "gtk test disabled" >&6; }
fi
if test "x$PKG_CONFIG" != "xno"; then
save_skip_gtk2=$SKIP_GTK2
SKIP_GTK2=YES
if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then
{
@@ -9924,6 +9931,8 @@ $as_echo "no" >&6; }
$as_echo "#define USE_GTK3 1" >>confdefs.h
else
SKIP_GTK2=$save_skip_gtk2
fi
fi
fi

View File

@@ -90,7 +90,7 @@ with_x_arg="$with_x"
dnl Set default value for CFLAGS if none is defined or it's empty
if test -z "$CFLAGS"; then
CFLAGS="-O"
test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall"
test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall -Wno-deprecated-declarations"
fi
if test "$GCC" = yes; then
dnl method that should work for nearly all versions
@@ -127,8 +127,9 @@ if test x"$CLANG_VERSION_STRING" != x"" ; then
dnl change the constant 500002075 below appropriately. To get the
dnl integer corresponding to a version number, refer to the
dnl definition of CLANG_VERSION above.
dnl Clang 11 reports "11", assume Clang 10 and later work like this.
AC_MSG_CHECKING(if clang supports -fno-strength-reduce)
if test "$CLANG_VERSION" -ge 500002075 ; then
if test "$CLANG_MAJOR" -ge 10 -o "$CLANG_VERSION" -ge 500002075 ; then
AC_MSG_RESULT(no)
CFLAGS=`echo "$CFLAGS" | sed -e 's/-fno-strength-reduce/ /'`
else
@@ -2447,6 +2448,7 @@ else
yes|""|auto) AC_MSG_RESULT(yes/auto - automatic GUI support)
gui_auto=yes
SKIP_GTK2=
SKIP_GTK3=
SKIP_GNOME=
SKIP_MOTIF=
SKIP_ATHENA=
@@ -2758,6 +2760,10 @@ if test -z "$SKIP_GTK2"; then
if test "x$PKG_CONFIG" != "xno"; then
dnl First try finding version 2.2.0 or later. The 2.0.x series has
dnl problems (bold fonts, --remote doesn't work).
dnl Disable checking for GTK3 here, otherwise it's found when GTK2 is not
dnl found.
save_skip_gtk3=$SKIP_GTK3
SKIP_GTK3=YES
AM_PATH_GTK(2.2.0,
[GUI_LIB_LOC="$GTK_LIBDIR"
GTK_LIBNAME="$GTK_LIBS"
@@ -2769,6 +2775,8 @@ if test -z "$SKIP_GTK2"; then
SKIP_MOTIF=YES
GUITYPE=GTK
AC_SUBST(GTK_LIBNAME)
else
SKIP_GTK3=$save_skip_gtk3
fi
fi
if test "x$GUITYPE" = "xGTK"; then
@@ -2804,6 +2812,8 @@ if test -z "$SKIP_GTK3"; then
fi
if test "x$PKG_CONFIG" != "xno"; then
save_skip_gtk2=$SKIP_GTK2
SKIP_GTK2=YES
AM_PATH_GTK(3.0.0,
[GUI_LIB_LOC="$GTK_LIBDIR"
GTK_LIBNAME="$GTK_LIBS"
@@ -2817,6 +2827,8 @@ if test -z "$SKIP_GTK3"; then
GUITYPE=GTK
AC_SUBST(GTK_LIBNAME)
AC_DEFINE(USE_GTK3)
else
SKIP_GTK2=$save_skip_gtk2
fi
fi
fi

View File

@@ -940,9 +940,9 @@ debuggy_find(
{
if (bp->dbg_val == NULL)
{
debug_oldval = typval_tostring(NULL);
debug_oldval = typval_tostring(NULL, TRUE);
bp->dbg_val = tv;
debug_newval = typval_tostring(bp->dbg_val);
debug_newval = typval_tostring(bp->dbg_val, TRUE);
line = TRUE;
}
else
@@ -953,11 +953,11 @@ debuggy_find(
typval_T *v;
line = TRUE;
debug_oldval = typval_tostring(bp->dbg_val);
debug_oldval = typval_tostring(bp->dbg_val, TRUE);
// Need to evaluate again, typval_compare() overwrites
// "tv".
v = eval_expr(bp->dbg_name, NULL);
debug_newval = typval_tostring(v);
debug_newval = typval_tostring(v, TRUE);
free_tv(bp->dbg_val);
bp->dbg_val = v;
}
@@ -966,8 +966,8 @@ debuggy_find(
}
else if (bp->dbg_val != NULL)
{
debug_oldval = typval_tostring(bp->dbg_val);
debug_newval = typval_tostring(NULL);
debug_oldval = typval_tostring(bp->dbg_val, TRUE);
debug_newval = typval_tostring(NULL, TRUE);
free_tv(bp->dbg_val);
bp->dbg_val = NULL;
line = TRUE;

View File

@@ -128,7 +128,8 @@ find_win_for_curbuf(void)
}
/*
* Set line or list of lines in buffer "buf".
* Set line or list of lines in buffer "buf" to "lines".
* Any type is allowed and converted to a string.
*/
static void
set_buffer_lines(
@@ -187,7 +188,7 @@ set_buffer_lines(
li = l->lv_first;
}
else
line = tv_get_string_chk(lines);
line = typval_tostring(lines, FALSE);
// default result is zero == OK
for (;;)
@@ -197,7 +198,8 @@ set_buffer_lines(
// list argument, get next string
if (li == NULL)
break;
line = tv_get_string_chk(&li->li_tv);
vim_free(line);
line = typval_tostring(&li->li_tv, FALSE);
li = li->li_next;
}
@@ -238,6 +240,7 @@ set_buffer_lines(
break;
++lnum;
}
vim_free(line);
if (added > 0)
{

View File

@@ -330,6 +330,18 @@ arg_string(type_T *type, argcontext_T *context)
return check_arg_type(&t_string, type, context);
}
/*
* Check "type" is a bool or number 0 or 1.
*/
static int
arg_bool(type_T *type, argcontext_T *context)
{
if (type->tt_type == VAR_ANY
|| type->tt_type == VAR_NUMBER || type->tt_type == VAR_BOOL)
return OK;
return check_arg_type(&t_bool, type, context);
}
/*
* Check "type" is a list or a blob.
*/
@@ -423,6 +435,8 @@ arg_extend3(type_T *type, argcontext_T *context)
/*
* Lists of functions that check the argument types of a builtin function.
*/
argcheck_T arg1_string[] = {arg_string};
argcheck_T arg3_string_nr_bool[] = {arg_string, arg_number, arg_bool};
argcheck_T arg1_float_or_nr[] = {arg_float_or_nr};
argcheck_T arg2_listblob_item[] = {arg_list_or_blob, arg_item_of_prev};
argcheck_T arg23_extend[] = {arg_list_or_dict, arg_same_as_prev, arg_extend3};
@@ -1548,11 +1562,11 @@ static funcentry_T global_functions[] =
ret_list_number, f_srand},
{"state", 0, 1, FEARG_1, NULL,
ret_string, f_state},
{"str2float", 1, 1, FEARG_1, NULL,
{"str2float", 1, 1, FEARG_1, arg1_string,
ret_float, FLOAT_FUNC(f_str2float)},
{"str2list", 1, 2, FEARG_1, NULL,
ret_list_number, f_str2list},
{"str2nr", 1, 3, FEARG_1, NULL,
{"str2nr", 1, 3, FEARG_1, arg3_string_nr_bool,
ret_number, f_str2nr},
{"strcharpart", 2, 3, FEARG_1, NULL,
ret_string, f_strcharpart},
@@ -9076,7 +9090,7 @@ f_str2nr(typval_T *argvars, typval_T *rettv)
what |= STR2NR_QUOTE;
}
p = skipwhite(tv_get_string(&argvars[0]));
p = skipwhite(tv_get_string_strict(&argvars[0]));
isneg = (*p == '-');
if (*p == '+' || *p == '-')
p = skipwhite(p + 1);

View File

@@ -2710,6 +2710,12 @@ do_ecmd(
*/
if (buf != curbuf)
{
#ifdef FEAT_CMDWIN
int save_cmdwin_type = cmdwin_type;
// BufLeave applies to the old buffer.
cmdwin_type = 0;
#endif
/*
* Be careful: The autocommands may delete any buffer and change
* the current buffer.
@@ -2724,6 +2730,9 @@ do_ecmd(
new_name = vim_strsave(buf->b_fname);
set_bufref(&au_new_curbuf, buf);
apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf);
#ifdef FEAT_CMDWIN
cmdwin_type = save_cmdwin_type;
#endif
if (!bufref_valid(&au_new_curbuf))
{
// new buffer has been deleted

View File

@@ -121,7 +121,6 @@ struct compl_S
static char e_hitend[] = N_("Hit end of paragraph");
# ifdef FEAT_COMPL_FUNC
static char e_complwin[] = N_("E839: Completion function changed window");
static char e_compldel[] = N_("E840: Completion function deleted text");
# endif
@@ -2199,8 +2198,6 @@ expand_by_function(
typval_T args[3];
char_u *funcname;
pos_T pos;
win_T *curwin_save;
buf_T *curbuf_save;
typval_T rettv;
int save_State = State;
@@ -2216,11 +2213,10 @@ expand_by_function(
args[2].v_type = VAR_UNKNOWN;
pos = curwin->w_cursor;
curwin_save = curwin;
curbuf_save = curbuf;
// Lock the text to avoid weird things from happening. Do allow switching
// to another window temporarily.
++textlock;
// Lock the text to avoid weird things from happening. Also disallow
// switching to another window, it should not be needed and may end up in
// Insert mode in another buffer.
++textwinlock;
// Call a function, which returns a list or dict.
if (call_vim_function(funcname, 2, args, &rettv) == OK)
@@ -2243,13 +2239,8 @@ expand_by_function(
break;
}
}
--textlock;
--textwinlock;
if (curwin_save != curwin || curbuf_save != curbuf)
{
emsg(_(e_complwin));
goto theend;
}
curwin->w_cursor = pos; // restore the cursor position
validate_cursor();
if (!EQUAL_POS(curwin->w_cursor, pos))
@@ -3226,7 +3217,7 @@ ins_compl_next(
return -1;
if (compl_leader != NULL
&& (compl_shown_match->cp_flags & CP_ORIGINAL_TEXT) == 0)
&& (compl_shown_match->cp_flags & CP_ORIGINAL_TEXT) == 0)
{
// Set "compl_shown_match" to the actually shown match, it may differ
// when "compl_leader" is used to omit some of the matches.
@@ -3842,8 +3833,6 @@ ins_complete(int c, int enable_pum)
int col;
char_u *funcname;
pos_T pos;
win_T *curwin_save;
buf_T *curbuf_save;
int save_State = State;
// Call 'completefunc' or 'omnifunc' and get pattern length as a
@@ -3865,16 +3854,11 @@ ins_complete(int c, int enable_pum)
args[1].vval.v_string = (char_u *)"";
args[2].v_type = VAR_UNKNOWN;
pos = curwin->w_cursor;
curwin_save = curwin;
curbuf_save = curbuf;
++textwinlock;
col = call_func_retnr(funcname, 2, args);
--textwinlock;
State = save_State;
if (curwin_save != curwin || curbuf_save != curbuf)
{
emsg(_(e_complwin));
return FAIL;
}
curwin->w_cursor = pos; // restore the cursor position
validate_cursor();
if (!EQUAL_POS(curwin->w_cursor, pos))

View File

@@ -2493,6 +2493,16 @@ f_count(typval_T *argvars, typval_T *rettv)
static void
extend(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg, int is_new)
{
type_T *type = NULL;
garray_T type_list;
if (!is_new && in_vim9script())
{
// Check that map() does not change the type of the dict.
ga_init2(&type_list, sizeof(type_T *), 10);
type = typval2type(argvars, &type_list);
}
if (argvars[0].v_type == VAR_LIST && argvars[1].v_type == VAR_LIST)
{
list_T *l1, *l2;
@@ -2504,7 +2514,7 @@ extend(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg, int is_new)
if (l1 == NULL)
{
emsg(_(e_cannot_extend_null_list));
return;
goto theend;
}
l2 = argvars[1].vval.v_list;
if ((is_new || !value_check_lock(l1->lv_lock, arg_errmsg, TRUE))
@@ -2514,14 +2524,14 @@ extend(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg, int is_new)
{
l1 = list_copy(l1, FALSE, get_copyID());
if (l1 == NULL)
return;
goto theend;
}
if (argvars[2].v_type != VAR_UNKNOWN)
{
before = (long)tv_get_number_chk(&argvars[2], &error);
if (error)
return; // type error; errmsg already given
goto theend; // type error; errmsg already given
if (before == l1->lv_len)
item = NULL;
@@ -2531,12 +2541,14 @@ extend(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg, int is_new)
if (item == NULL)
{
semsg(_(e_listidx), before);
return;
goto theend;
}
}
}
else
item = NULL;
if (type != NULL && check_typval_type(type, &argvars[1], 2) == FAIL)
goto theend;
list_extend(l1, l2, item);
if (is_new)
@@ -2559,7 +2571,7 @@ extend(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg, int is_new)
if (d1 == NULL)
{
emsg(_(e_cannot_extend_null_dict));
return;
goto theend;
}
d2 = argvars[1].vval.v_dict;
if ((is_new || !value_check_lock(d1->dv_lock, arg_errmsg, TRUE))
@@ -2569,7 +2581,7 @@ extend(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg, int is_new)
{
d1 = dict_copy(d1, FALSE, get_copyID());
if (d1 == NULL)
return;
goto theend;
}
// Check the third argument.
@@ -2579,19 +2591,21 @@ extend(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg, int is_new)
action = tv_get_string_chk(&argvars[2]);
if (action == NULL)
return; // type error; errmsg already given
goto theend; // type error; errmsg already given
for (i = 0; i < 3; ++i)
if (STRCMP(action, av[i]) == 0)
break;
if (i == 3)
{
semsg(_(e_invarg2), action);
return;
goto theend;
}
}
else
action = (char_u *)"force";
if (type != NULL && check_typval_type(type, &argvars[1], 2) == FAIL)
goto theend;
dict_extend(d1, d2, action);
if (is_new)
@@ -2606,6 +2620,10 @@ extend(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg, int is_new)
}
else
semsg(_(e_listdictarg), is_new ? "extendnew()" : "extend()");
theend:
if (type != NULL)
clear_type_list(&type_list);
}
/*

View File

@@ -5701,6 +5701,10 @@ ml_find_line_or_offset(buf_T *buf, linenr_T lnum, long *offp)
while ((lnum != 0 && curline < lnum) || (offset != 0 && size < offset))
{
#ifdef FEAT_PROP_POPUP
size_t textprop_total = 0;
#endif
if (curline > buf->b_ml.ml_line_count
|| (hp = ml_find_line(buf, curline, ML_FIND)) == NULL)
return -1;
@@ -5722,18 +5726,16 @@ ml_find_line_or_offset(buf_T *buf, linenr_T lnum, long *offp)
}
else
{
#ifdef FEAT_PROP_POPUP
size_t textprop_total = 0;
size_t textprop_size = 0;
char_u *l1, *l2;
#endif
extra = 0;
for (;;)
{
#ifdef FEAT_PROP_POPUP
size_t textprop_size = 0;
if (buf->b_has_textprop)
{
char_u *l1, *l2;
// compensate for the extra bytes taken by textprops
l1 = (char_u *)dp + ((dp->db_index[idx]) & DB_INDEX_MASK);
l2 = (char_u *)dp + (idx == 0 ? dp->db_txt_end
@@ -5763,7 +5765,7 @@ ml_find_line_or_offset(buf_T *buf, linenr_T lnum, long *offp)
}
}
#ifdef FEAT_PROP_POPUP
if (buf->b_has_textprop)
if (buf->b_has_textprop && lnum != 0)
{
int i;
@@ -5771,12 +5773,18 @@ ml_find_line_or_offset(buf_T *buf, linenr_T lnum, long *offp)
// lengths.
len = 0;
for (i = start_idx; i <= idx; ++i)
len += (int)STRLEN((char_u *)dp
+ ((dp->db_index[i]) & DB_INDEX_MASK)) + 1;
{
char_u *p = (char_u *)dp + ((dp->db_index[i]) & DB_INDEX_MASK);
len += (int)STRLEN(p) + 1;
}
}
else
#endif
len = text_end - ((dp->db_index[idx]) & DB_INDEX_MASK);
len = text_end - ((dp->db_index[idx]) & DB_INDEX_MASK)
#ifdef FEAT_PROP_POPUP
- (long)textprop_total
#endif
;
size += len;
if (offset != 0 && size >= offset)
{
@@ -5786,7 +5794,11 @@ ml_find_line_or_offset(buf_T *buf, linenr_T lnum, long *offp)
*offp = offset - size + len;
else
*offp = offset - size + len
- (text_end - ((dp->db_index[idx - 1]) & DB_INDEX_MASK));
- (text_end - ((dp->db_index[idx - 1]) & DB_INDEX_MASK))
#ifdef FEAT_PROP_POPUP
+ (long)textprop_total
#endif
;
curline += idx - start_idx + extra;
if (curline > buf->b_ml.ml_line_count)
return -1; // exactly one byte beyond the end

View File

@@ -12,14 +12,16 @@ float_T tv_get_float(typval_T *varp);
int check_for_string(typval_T *tv);
int check_for_nonempty_string(typval_T *tv);
char_u *tv_get_string(typval_T *varp);
char_u *tv_get_string_strict(typval_T *varp);
char_u *tv_get_string_buf(typval_T *varp, char_u *buf);
char_u *tv_get_string_chk(typval_T *varp);
char_u *tv_get_string_buf_chk(typval_T *varp, char_u *buf);
char_u *tv_get_string_buf_chk_strict(typval_T *varp, char_u *buf, int strict);
char_u *tv_stringify(typval_T *varp, char_u *buf);
int tv_check_lock(typval_T *tv, char_u *name, int use_gettext);
void copy_tv(typval_T *from, typval_T *to);
int typval_compare(typval_T *typ1, typval_T *typ2, exprtype_T type, int ic);
char_u *typval_tostring(typval_T *arg);
char_u *typval_tostring(typval_T *arg, int quotes);
int tv_islocked(typval_T *tv);
int tv_equal(typval_T *tv1, typval_T *tv2, int ic, int recursive);
int eval_option(char_u **arg, typval_T *rettv, int evaluate);

View File

@@ -6053,7 +6053,7 @@ vgr_process_args(
return FAIL;
}
// parse the list of arguments
// Parse the list of arguments, wildcards have already been expanded.
if (get_arglist_exp(p, &args->fcount, &args->fnames, TRUE) == FAIL)
return FAIL;
if (args->fcount == 0)

View File

@@ -1649,8 +1649,8 @@ typedef struct
char_u *uf_name_exp; // if "uf_name[]" starts with SNR the name with
// "<SNR>" as a string, otherwise NULL
char_u uf_name[1]; // name of function (actually longer); can
// start with <SNR>123_ (<SNR> is K_SPECIAL
char_u uf_name[4]; // name of function (actual size equals name);
// can start with <SNR>123_ (<SNR> is K_SPECIAL
// KS_EXTRA KE_SNR)
} ufunc_T;

View File

@@ -5339,6 +5339,8 @@ check_termcode(
else
#endif // FEAT_GUI
{
int mouse_index_found = -1;
for (idx = 0; idx < tc_len; ++idx)
{
/*
@@ -5376,9 +5378,24 @@ check_termcode(
}
}
key_name[0] = termcodes[idx].name[0];
key_name[1] = termcodes[idx].name[1];
break;
// The mouse termcode "ESC [" is also the prefix of
// "ESC [ I" (focus gained). Only use it when there is
// no other match. Do use it when a digit is following to
// avoid waiting for more bytes.
if (slen == 2 && len > 2
&& termcodes[idx].code[0] == ESC
&& termcodes[idx].code[1] == '['
&& !isdigit(tp[2]))
{
if (mouse_index_found < 0)
mouse_index_found = idx;
}
else
{
key_name[0] = termcodes[idx].name[0];
key_name[1] = termcodes[idx].name[1];
break;
}
}
/*
@@ -5389,7 +5406,7 @@ check_termcode(
* When there is a modifier the * matches a number.
* When there is no modifier the ;* or * is omitted.
*/
if (termcodes[idx].modlen > 0)
if (termcodes[idx].modlen > 0 && mouse_index_found < 0)
{
int at_code;
@@ -5442,6 +5459,11 @@ check_termcode(
}
}
}
if (idx == tc_len && mouse_index_found >= 0)
{
key_name[0] = termcodes[mouse_index_found].name[0];
key_name[1] = termcodes[mouse_index_found].name[1];
}
}
#ifdef FEAT_TERMRESPONSE

View File

@@ -5,6 +5,7 @@ source screendump.vim
source check.vim
func Test_setbufline_getbufline()
" similar to Test_set_get_bufline()
new
let b = bufnr('%')
hide
@@ -38,6 +39,12 @@ func Test_setbufline_getbufline()
call assert_equal(['e'], getbufline(b, 5))
call assert_equal([], getbufline(b, 6))
call assert_equal([], getbufline(b, 2, 1))
call setbufline(b, 2, [function('eval'), #{key: 123}, test_null_job()])
call assert_equal(["function('eval')",
\ "{'key': 123}",
\ "no process"],
\ getbufline(b, 2, 4))
exe "bwipe! " . b
endfunc

View File

@@ -1237,6 +1237,7 @@ func Test_cmdwin_autocmd()
augroup CmdWin
au!
autocmd BufLeave * if &buftype == '' | update | endif
autocmd CmdwinEnter * startinsert
augroup END

View File

@@ -548,7 +548,7 @@ func Test_completefunc_error()
endfunc
set completefunc=CompleteFunc
call setline(1, ['', 'abcd', ''])
call assert_fails('exe "normal 2G$a\<C-X>\<C-U>"', 'E840:')
call assert_fails('exe "normal 2G$a\<C-X>\<C-U>"', 'E578:')
" delete text when called for the second time
func CompleteFunc2(findstart, base)
@@ -562,31 +562,24 @@ func Test_completefunc_error()
call setline(1, ['', 'abcd', ''])
call assert_fails('exe "normal 2G$a\<C-X>\<C-U>"', 'E578:')
set completefunc&
delfunc CompleteFunc
delfunc CompleteFunc2
close!
endfunc
func Test_completefunc_error_not_asan()
" The following test causes an ASAN failure.
CheckNotAsan
" Jump to a different window from the complete function
func! CompleteFunc(findstart, base)
func CompleteFunc3(findstart, base)
if a:findstart == 1
return col('.') - 1
endif
wincmd p
return ['a', 'b']
endfunc
set completefunc=CompleteFunc
set completefunc=CompleteFunc3
new
call assert_fails('exe "normal a\<C-X>\<C-U>"', 'E839:')
call assert_fails('exe "normal a\<C-X>\<C-U>"', 'E565:')
close!
set completefunc&
delfunc CompleteFunc
delfunc CompleteFunc2
delfunc CompleteFunc3
close!
endfunc
" Test for returning non-string values from 'completefunc'

View File

@@ -342,7 +342,7 @@ func Test_completefunc_opens_new_window_one()
setlocal completefunc=DummyCompleteOne
call setline(1, 'one')
/^one
call assert_fails('call feedkeys("A\<C-X>\<C-U>\<C-N>\<Esc>", "x")', 'E578:')
call assert_fails('call feedkeys("A\<C-X>\<C-U>\<C-N>\<Esc>", "x")', 'E565:')
call assert_equal(winid, win_getid())
call assert_equal('onedef', getline(1))
q!
@@ -367,11 +367,9 @@ func Test_completefunc_opens_new_window_two()
setlocal completefunc=DummyCompleteTwo
call setline(1, 'two')
/^two
call assert_fails('call feedkeys("A\<C-X>\<C-U>\<C-N>\<Esc>", "x")', 'E839:')
call assert_notequal(winid, win_getid())
q!
call assert_fails('call feedkeys("A\<C-X>\<C-U>\<C-N>\<Esc>", "x")', 'E565:')
call assert_equal(winid, win_getid())
call assert_equal('two', getline(1))
call assert_equal('twodef', getline(1))
q!
endfunc
@@ -642,8 +640,8 @@ func Test_complete_func_mess()
set completefunc=MessComplete
new
call setline(1, 'Ju')
call feedkeys("A\<c-x>\<c-u>/\<esc>", 'tx')
call assert_equal('Oct/Oct', getline(1))
call assert_fails('call feedkeys("A\<c-x>\<c-u>/\<esc>", "tx")', 'E578:')
call assert_equal('Jan/', getline(1))
bwipe!
set completefunc=
endfunc

View File

@@ -2865,6 +2865,13 @@ func Test_vimgrep()
call XvimgrepTests('l')
endfunc
func Test_vimgrep_wildcards_expanded_once()
new X[id-01] file.txt
call setline(1, 'some text to search for')
vimgrep text %
bwipe!
endfunc
" Test for incsearch highlighting of the :vimgrep pattern
" This test used to cause "E315: ml_get: invalid lnum" errors.
func Test_vimgrep_incsearch()

View File

@@ -1868,6 +1868,34 @@ func Test_xx07_xterm_response()
call test_override('term_props', 0)
endfunc
func Test_focus_events()
let save_term = &term
let save_ttymouse = &ttymouse
set term=xterm ttymouse=xterm2
au FocusGained * let g:focus_gained += 1
au FocusLost * let g:focus_lost += 1
let g:focus_gained = 0
let g:focus_lost = 0
call feedkeys("\<Esc>[O", "Lx!")
call assert_equal(1, g:focus_lost)
call feedkeys("\<Esc>[I", "Lx!")
call assert_equal(1, g:focus_gained)
" still works when 'ttymouse' is empty
set ttymouse=
call feedkeys("\<Esc>[O", "Lx!")
call assert_equal(2, g:focus_lost)
call feedkeys("\<Esc>[I", "Lx!")
call assert_equal(2, g:focus_gained)
au! FocusGained
au! FocusLost
let &term = save_term
let &ttymouse = save_ttymouse
endfunc
func Test_get_termcode()
try
let k1 = &t_k1
@@ -2261,7 +2289,7 @@ func Test_cmdline_literal()
endfunc
" Test for translation of special key codes (<xF1>, <xF2>, etc.)
func Test_Keycode_Tranlsation()
func Test_Keycode_Translation()
let keycodes = [
\ ["<xUp>", "<Up>"],
\ ["<xDown>", "<Down>"],

View File

@@ -771,6 +771,36 @@ func Test_prop_byte2line()
call prop_type_delete('prop')
endfunc
func Test_prop_goto_byte()
new
call setline(1, '')
call setline(2, 'two three')
call setline(3, '')
call setline(4, 'four five')
call prop_type_add('testprop', {'highlight': 'Directory'})
call search('^two')
call prop_add(line('.'), col('.'), {
\ 'length': len('two'),
\ 'type': 'testprop'
\ })
call search('two \zsthree')
let expected_pos = line2byte(line('.')) + col('.') - 1
exe expected_pos .. 'goto'
let actual_pos = line2byte(line('.')) + col('.') - 1
eval actual_pos->assert_equal(expected_pos)
call search('four \zsfive')
let expected_pos = line2byte(line('.')) + col('.') - 1
exe expected_pos .. 'goto'
let actual_pos = line2byte(line('.')) + col('.') - 1
eval actual_pos->assert_equal(expected_pos)
call prop_type_delete('testprop')
bwipe!
endfunc
func Test_prop_undo()
new
call prop_type_add('comment', {'highlight': 'Directory'})

View File

@@ -240,19 +240,24 @@ def Test_expand()
enddef
def Test_extend_arg_types()
assert_equal([1, 2, 3], extend([1, 2], [3]))
assert_equal([3, 1, 2], extend([1, 2], [3], 0))
assert_equal([1, 3, 2], extend([1, 2], [3], 1))
assert_equal([1, 3, 2], extend([1, 2], [3], s:number_one))
g:number_one = 1
g:string_keep = 'keep'
var lines =<< trim END
assert_equal([1, 2, 3], extend([1, 2], [3]))
assert_equal([3, 1, 2], extend([1, 2], [3], 0))
assert_equal([1, 3, 2], extend([1, 2], [3], 1))
assert_equal([1, 3, 2], extend([1, 2], [3], g:number_one))
assert_equal({a: 1, b: 2, c: 3}, extend({a: 1, b: 2}, {c: 3}))
assert_equal({a: 1, b: 4}, extend({a: 1, b: 2}, {b: 4}))
assert_equal({a: 1, b: 2}, extend({a: 1, b: 2}, {b: 4}, 'keep'))
assert_equal({a: 1, b: 2}, extend({a: 1, b: 2}, {b: 4}, s:string_keep))
assert_equal({a: 1, b: 2, c: 3}, extend({a: 1, b: 2}, {c: 3}))
assert_equal({a: 1, b: 4}, extend({a: 1, b: 2}, {b: 4}))
assert_equal({a: 1, b: 2}, extend({a: 1, b: 2}, {b: 4}, 'keep'))
assert_equal({a: 1, b: 2}, extend({a: 1, b: 2}, {b: 4}, g:string_keep))
var res: list<dict<any>>
extend(res, mapnew([1, 2], (_, v) => ({})))
assert_equal([{}, {}], res)
var res: list<dict<any>>
extend(res, mapnew([1, 2], (_, v) => ({})))
assert_equal([{}, {}], res)
END
CheckDefAndScriptSuccess(lines)
CheckDefFailure(['extend([1, 2], 3)'], 'E1013: Argument 2: type mismatch, expected list<number> but got number')
CheckDefFailure(['extend([1, 2], ["x"])'], 'E1013: Argument 2: type mismatch, expected list<number> but got list<string>')
@@ -300,8 +305,7 @@ def Test_extend_dict_item_type()
var d: dict<number> = {a: 1}
extend(d, {b: 'x'})
END
CheckDefFailure(lines, 'E1013: Argument 2: type mismatch, expected dict<number> but got dict<string>', 2)
CheckScriptFailure(['vim9script'] + lines, 'E1012:', 3)
CheckDefAndScriptFailure(lines, 'E1013: Argument 2: type mismatch, expected dict<number> but got dict<string>', 2)
lines =<< trim END
var d: dict<number> = {a: 1}
@@ -326,8 +330,7 @@ def Test_extend_list_item_type()
var l: list<number> = [1]
extend(l, ['x'])
END
CheckDefFailure(lines, 'E1013: Argument 2: type mismatch, expected list<number> but got list<string>', 2)
CheckScriptFailure(['vim9script'] + lines, 'E1012:', 3)
CheckDefAndScriptFailure(lines, 'E1013: Argument 2: type mismatch, expected list<number> but got list<string>', 2)
lines =<< trim END
var l: list<number> = [1]
@@ -767,6 +770,54 @@ def Test_searchcount()
bwipe!
enddef
def Test_set_get_bufline()
# similar to Test_setbufline_getbufline()
var lines =<< trim END
new
var b = bufnr('%')
hide
assert_equal(0, setbufline(b, 1, ['foo', 'bar']))
assert_equal(['foo'], getbufline(b, 1))
assert_equal(['bar'], getbufline(b, '$'))
assert_equal(['foo', 'bar'], getbufline(b, 1, 2))
exe "bd!" b
assert_equal([], getbufline(b, 1, 2))
split Xtest
setline(1, ['a', 'b', 'c'])
b = bufnr('%')
wincmd w
assert_equal(1, setbufline(b, 5, 'x'))
assert_equal(1, setbufline(b, 5, ['x']))
assert_equal(1, setbufline(b, 5, []))
assert_equal(1, setbufline(b, 5, test_null_list()))
assert_equal(1, 'x'->setbufline(bufnr('$') + 1, 1))
assert_equal(1, ['x']->setbufline(bufnr('$') + 1, 1))
assert_equal(1, []->setbufline(bufnr('$') + 1, 1))
assert_equal(1, test_null_list()->setbufline(bufnr('$') + 1, 1))
assert_equal(['a', 'b', 'c'], getbufline(b, 1, '$'))
assert_equal(0, setbufline(b, 4, ['d', 'e']))
assert_equal(['c'], b->getbufline(3))
assert_equal(['d'], getbufline(b, 4))
assert_equal(['e'], getbufline(b, 5))
assert_equal([], getbufline(b, 6))
assert_equal([], getbufline(b, 2, 1))
setbufline(b, 2, [function('eval'), {key: 123}, test_null_job()])
assert_equal(["function('eval')",
"{'key': 123}",
"no process"],
getbufline(b, 2, 4))
exe 'bwipe! ' .. b
END
CheckDefAndScriptSuccess(lines)
enddef
def Test_searchdecl()
searchdecl('blah', true, true)->assert_equal(1)
enddef
@@ -865,8 +916,27 @@ def Test_split()
split(' aa bb ', '\W\+', true)->assert_equal(['', 'aa', 'bb', ''])
enddef
def Run_str2float()
if !has('float')
MissingFeature 'float'
endif
str2float("1.00")->assert_equal(1.00)
str2float("2e-2")->assert_equal(0.02)
CheckDefFailure(['echo str2float(123)'], 'E1013:')
CheckScriptFailure(['vim9script', 'echo str2float(123)'], 'E1024:')
endif
enddef
def Test_str2nr()
str2nr("1'000'000", 10, true)->assert_equal(1000000)
CheckDefFailure(['echo str2nr(123)'], 'E1013:')
CheckScriptFailure(['vim9script', 'echo str2nr(123)'], 'E1024:')
CheckDefFailure(['echo str2nr("123", "x")'], 'E1013:')
CheckScriptFailure(['vim9script', 'echo str2nr("123", "x")'], 'E1030:')
CheckDefFailure(['echo str2nr("123", 10, "x")'], 'E1013:')
CheckScriptFailure(['vim9script', 'echo str2nr("123", 10, "x")'], 'E1135:')
enddef
def Test_strchars()

View File

@@ -3278,7 +3278,8 @@ def Test_no_unknown_error_after_error()
while job_status(myjob) == 'run'
sleep 10m
endwhile
sleep 10m
# wait for Exit_cb() to be called
sleep 100m
END
writefile(lines, 'Xdef')
assert_fails('so Xdef', ['E684:', 'E1012:'])

View File

@@ -388,6 +388,19 @@ tv_get_string(typval_T *varp)
return tv_get_string_buf(varp, mybuf);
}
/*
* Like tv_get_string() but don't allow number to string conversion for Vim9.
*/
char_u *
tv_get_string_strict(typval_T *varp)
{
static char_u mybuf[NUMBUFLEN];
char_u *res = tv_get_string_buf_chk_strict(
varp, mybuf, in_vim9script());
return res != NULL ? res : (char_u *)"";
}
char_u *
tv_get_string_buf(typval_T *varp, char_u *buf)
{
@@ -409,10 +422,21 @@ tv_get_string_chk(typval_T *varp)
char_u *
tv_get_string_buf_chk(typval_T *varp, char_u *buf)
{
return tv_get_string_buf_chk_strict(varp, buf, FALSE);
}
char_u *
tv_get_string_buf_chk_strict(typval_T *varp, char_u *buf, int strict)
{
switch (varp->v_type)
{
case VAR_NUMBER:
if (strict)
{
emsg(_(e_using_number_as_string));
break;
}
vim_snprintf((char *)buf, NUMBUFLEN, "%lld",
(varnumber_T)varp->vval.v_number);
return buf;
@@ -903,8 +927,13 @@ typval_compare(
return OK;
}
/*
* Convert any type to a string, never give an error.
* When "quotes" is TRUE add quotes to a string.
* Returns an allocated string.
*/
char_u *
typval_tostring(typval_T *arg)
typval_tostring(typval_T *arg, int quotes)
{
char_u *tofree;
char_u numbuf[NUMBUFLEN];
@@ -912,10 +941,18 @@ typval_tostring(typval_T *arg)
if (arg == NULL)
return vim_strsave((char_u *)"(does not exist)");
ret = tv2string(arg, &tofree, numbuf, 0);
// Make a copy if we have a value but it's not in allocated memory.
if (ret != NULL && tofree == NULL)
ret = vim_strsave(ret);
if (!quotes && arg->v_type == VAR_STRING)
{
ret = vim_strsave(arg->vval.v_string == NULL ? (char_u *)""
: arg->vval.v_string);
}
else
{
ret = tv2string(arg, &tofree, numbuf, 0);
// Make a copy if we have a value but it's not in allocated memory.
if (ret != NULL && tofree == NULL)
ret = vim_strsave(ret);
}
return ret;
}

View File

@@ -750,6 +750,42 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2443,
/**/
2442,
/**/
2441,
/**/
2440,
/**/
2439,
/**/
2438,
/**/
2437,
/**/
2436,
/**/
2435,
/**/
2434,
/**/
2433,
/**/
2432,
/**/
2431,
/**/
2430,
/**/
2429,
/**/
2428,
/**/
2427,
/**/
2426,
/**/
2425,
/**/

View File

@@ -879,7 +879,7 @@ do_2string(typval_T *tv, int is_2string_any)
return FAIL;
}
}
str = typval_tostring(tv);
str = typval_tostring(tv, TRUE);
clear_tv(tv);
tv->v_type = VAR_STRING;
tv->vval.v_string = str;