From fb7285b5d7ebf572849a3e742241c3a84c721bb8 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 5 Dec 2020 22:16:13 -0500 Subject: vim-patch:8.1.2064: MS-Windows: compiler warnings for unused arguments Problem: MS-Windows: compiler warnings for unused arguments. Solution: Add UNUSED. (Yegappan Lakshmanan, closes vim/vim#4963) https://github.com/vim/vim/commit/bd67aac279adf3a1cfa11557229b44e4c2c3dcda N/A patches for version.c: vim-patch:8.1.0818: MS-Windows: cannot send large data with ch_sendraw() Problem: MS-Windows: cannot send large data with ch_sendraw(). Solution: Split write into several WriteFile() calls. (Yasuhiro Matsumoto, closes vim/vim#3823) https://github.com/vim/vim/commit/240583869ae477202494dd01ef1e8e2bac650f10 vim-patch:8.1.1131: getwinpos() does not work in the MS-Windows console Problem: getwinpos() does not work in the MS-Windows console. Solution: Implement getwinpos(). https://github.com/vim/vim/commit/16c34c37659e6afca74169969bdacb6b866548c9 vim-patch:8.2.0587: compiler warning for unused variable Problem: Compiler warning for unused variable. Solution: Add UNUSED. https://github.com/vim/vim/commit/21cfe500f322a0bea3367c677943ea6c57c282b9 vim-patch:8.2.0879: compiler warning for unused function argument Problem: Compiler warning for unused function argument. Solution: Add UNUSED. https://github.com/vim/vim/commit/f9ca08e95ff5b66a02c75334264dd86508b2a453 vim-patch:8.2.2104: build problem with Ruby 2.7 Problem: Build problem with Ruby 2.7. Solution: Adjust function declarations. (Ozaki Kiichi, closes vim/vim#7430) https://github.com/vim/vim/commit/d5a986f460019a924627d79350552f446505cffb --- src/nvim/ex_getln.c | 3 ++- src/nvim/undo.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index ed408c28e5..a0910f1394 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -4327,7 +4327,8 @@ void ExpandEscape(expand_T *xp, char_u *str, int numfiles, char_u **files, int o /// if true then it escapes for a shell command. /// /// @return [allocated] escaped file name. -char *vim_strsave_fnameescape(const char *const fname, const bool shell) +char *vim_strsave_fnameescape(const char *const fname, + const bool shell FUNC_ATTR_UNUSED) FUNC_ATTR_NONNULL_RET FUNC_ATTR_MALLOC FUNC_ATTR_NONNULL_ALL { #ifdef BACKSLASH_IN_FILENAME diff --git a/src/nvim/undo.c b/src/nvim/undo.c index a8b8f7aa50..636d00bbbf 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -1255,7 +1255,8 @@ theend: /// a bit more verbose. /// Otherwise use curbuf->b_ffname to generate the undo file name. /// "hash[UNDO_HASH_SIZE]" must be the hash value of the buffer text. -void u_read_undo(char *name, char_u *hash, char_u *orig_name) +void u_read_undo(char *name, const char_u *hash, + const char_u *orig_name FUNC_ATTR_UNUSED) FUNC_ATTR_NONNULL_ARG(2) { u_header_T **uhp_table = NULL; @@ -1273,7 +1274,7 @@ void u_read_undo(char *name, char_u *hash, char_u *orig_name) // owner of the text file or equal to the current user. FileInfo file_info_orig; FileInfo file_info_undo; - if (os_fileinfo((char *)orig_name, &file_info_orig) + if (os_fileinfo((const char *)orig_name, &file_info_orig) && os_fileinfo((char *)file_name, &file_info_undo) && file_info_orig.stat.st_uid != file_info_undo.stat.st_uid && file_info_undo.stat.st_uid != getuid()) { -- cgit From 7bb92b7787458d8bc6b5b84eb69986c77a7b2499 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 6 Dec 2020 17:51:06 -0500 Subject: vim-patch:8.2.1021: Ruby interface not tested enough MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: Ruby interface not tested enough. Solution: Add a couple more tests. (Dominique Pellé, closes vim/vim#6301) https://github.com/vim/vim/commit/a190548e9165bbae75144a3e47f01d7708b29073 --- src/nvim/testdir/test_ruby.vim | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src') diff --git a/src/nvim/testdir/test_ruby.vim b/src/nvim/testdir/test_ruby.vim index 9c74c35049..1a274d1fec 100644 --- a/src/nvim/testdir/test_ruby.vim +++ b/src/nvim/testdir/test_ruby.vim @@ -27,6 +27,19 @@ func Test_rubydo() %bwipe! endfunc +func Test_rubydo_dollar_underscore() + throw 'skipped: TODO: ' + new + call setline(1, ['one', 'two', 'three', 'four']) + 2,3rubydo $_ = '[' + $_ + ']' + call assert_equal(['one', '[two]', '[three]', 'four'], getline(1, '$')) + bwipe! + + call assert_fails('rubydo $_ = 0', 'E265:') + call assert_fails('rubydo (') + bwipe! +endfunc + func Test_rubyfile() " Check :rubyfile does not SEGV with Ruby level exception but just fails let tempfile = tempname() . '.rb' @@ -391,3 +404,14 @@ func Test_ruby_p() let messages = GetMessages() call assert_equal(0, len(messages)) endfunc + +func Test_rubyeval_error() + " On Linux or Windows the error matches: + " "syntax error, unexpected end-of-input" + " whereas on macOS in CI, the error message makes less sense: + " "SyntaxError: array length must be 2" + " Unclear why. The test does not check the error message. + call assert_fails('call rubyeval("(")') +endfunc + +" vim: shiftwidth=2 sts=2 expandtab -- cgit From c46b67333fd5ba34470166f384c0233b0696910b Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 6 Dec 2020 19:18:59 -0500 Subject: vim-patch:8.2.1296: some part of using 'smarcase' was not tested MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: Some part of using 'smarcase' was not tested. Solution: Add more tests. (Dominique Pellé, closes vim/vim#6538) https://github.com/vim/vim/commit/d66cdcd43a598825add743bc95642cd8ed705252 --- src/nvim/testdir/test_search.vim | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim index 6824c50112..8d71ada551 100644 --- a/src/nvim/testdir/test_search.vim +++ b/src/nvim/testdir/test_search.vim @@ -508,7 +508,7 @@ endfunc func Test_search_cmdline7() throw 'skipped: Nvim does not support test_override()' - " Test that an pressing in an empty command line + " Test that pressing in an empty command line " does not move the cursor if !exists('+incsearch') return @@ -1172,3 +1172,24 @@ func Test_search_special() set t_PE= exe "norm /\x80PS" endfunc + +" Test 'smartcase' with utf-8. +func Test_search_smartcase_utf8() + new + let save_enc = &encoding + set encoding=utf8 ignorecase smartcase + + call setline(1, 'Café cafÉ') + 1s/café/x/g + call assert_equal('x x', getline(1)) + + call setline(1, 'Café cafÉ') + 1s/cafÉ/x/g + call assert_equal('Café x', getline(1)) + + set ignorecase& smartcase& + let &encoding = save_enc + close! +endfunc + +" vim: shiftwidth=2 sts=2 expandtab -- cgit From 8ae34ab7802763c2bbf64c8ba99c36d159da7220 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 6 Dec 2020 00:37:33 -0500 Subject: log: use uv_gettimeofday() for Windows POSIX gettimeofday() is not portable. --- src/nvim/log.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/nvim/log.c b/src/nvim/log.c index 225e40cdb4..19203a3c2a 100644 --- a/src/nvim/log.c +++ b/src/nvim/log.c @@ -13,9 +13,6 @@ #include #include #include -#if !defined(WIN32) -# include // for gettimeofday() -#endif #include #include "auto/config.h" @@ -296,12 +293,10 @@ static bool v_do_log_to_file(FILE *log_file, int log_level, } int millis = 0; -#if !defined(WIN32) - struct timeval curtime; - if (gettimeofday(&curtime, NULL) == 0) { + uv_timeval64_t curtime; + if (uv_gettimeofday(&curtime) == 0) { millis = (int)curtime.tv_usec / 1000; } -#endif // Print the log message. int64_t pid = os_get_pid(); -- cgit