Commit Graph

11996 Commits

Author SHA1 Message Date
MichaHoffmann
affef0aab8 add func_attr_printf in :
log.c
message.c
strings.c

fixed some printf warnings in:

src/nvim/undo.c
src/nvim/eval.c
src/nvim/eval/encode.c
src/nvim/eval/typval.c
src/nvim/ex_getln.c
src/nvim/fileio.c
src/nvim/lua/executor.c
src/nvim/main.c
src/nvim/regexp_nfa.c
src/nvim/shada.c
src/nvim/spellfile.c
src/nvim/tui/terminfo.c
src/nvim/garray.h
2018-09-24 21:28:04 +02:00
Jan Edmund Lazo
044cd242e7 vim-patch:8.1.0428: the :suspend command is not tested (#9043)
Problem:    The :suspend command is not tested.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3472)
3b30168f04
2018-09-24 01:59:42 +02:00
Daniel Hahler
248478f5a0 vim-patch:8.1.0429: no test for :lcd with 'shellslash' (#9041)
Problem:    No test for :lcd with 'shellslash'.
Solution:   Add a test. (Daniel Hahler, closes vim/vim#3475)
c75878c923

Related NA patch:
vim-patch:8.1.0343
2018-09-23 21:46:21 +02:00
Björn Linse
1a1164339a
Merge pull request #9039 from blueyed/undercurl
tui: code consistency in update_attrs
2018-09-23 20:30:56 +02:00
Daniel Hahler
535ef67ef0 minor: tui: update_attrs: code consistency 2018-09-23 19:34:39 +02:00
Justin M. Keyes
f8f83579ff
Merge #9034 'swapfile: always show dialog' 2018-09-23 18:51:39 +02:00
Daniel Hahler
d3c90cbbb4 vim-patch:8.0.1557: printf() does not work with only one argument (#9038)
Problem:    printf() does not work with only one argument. (Daniel Hahler)
Solution:   Allow using just the format. (Ken Takata, closes vim/vim#2687)
c71807db9c
2018-09-23 17:15:17 +02:00
Justin M. Keyes
990c147de3 test: Do not load entire log-file into memory
With DEBUG-level logging, after `make test`, log file could be 1+ GB.
2018-09-23 15:58:02 +02:00
Justin M. Keyes
22c83a4de9 swapfile: Always show swap dialog (E325)
If swapfile dialog prompts for input, it must be displayed to the user.

fix #8840
fix #9027
2018-09-23 15:58:01 +02:00
Justin M. Keyes
c3d24368a1 shortmess+=F: Hide :bnext, :bprev fileinfo messages 2018-09-23 15:58:01 +02:00
Jan Edmund Lazo
9183e2c67e vim-patch:8.1.0389: :behave command is not tested (#9030)
Problem:    :behave command is not tested.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3429)
da1f71d75f
2018-09-23 10:55:06 +02:00
Justin M. Keyes
eee93f36d8
Merge #9031 from janlazo/vim-8.1.0414 2018-09-23 10:53:57 +02:00
Michael Hoffmann
197d907e09 func_attr.h: FUNC_ATTR_PRINTF 2018-09-23 10:49:20 +02:00
Jan Edmund Lazo
bcc174e6df vim-patch:8.0.0370: invalid memory access when setting wildchar empty
Problem:    Invalid memory access when setting wildchar empty.
Solution:   Avoid going over the end of the option value. (Dominique Pelle,
            closes vim/vim#1509)  Make option test check all number options with
            empty value.
a12e40351d
2018-09-23 00:59:11 -04:00
Jan Edmund Lazo
fe191d95a2 vim-patch:8.0.0368: not all options are tested with a range of values
Problem:    Not all options are tested with a range of values.
Solution:   Generate a test script from the source code.
2f5463df01
2018-09-22 17:12:07 -04:00
Jan Edmund Lazo
a52c38d790 vim-patch:8.1.0414: v:option_old is cleared when using :set in OptionSet autocmd
Problem:    v:option_old and v:option_new are cleared when using :set in
            OptionSet autocmd. (Gary Johnson)
Solution:   Don't trigger OptionSet recursively.
3f3fb0b147
2018-09-22 17:10:16 -04:00
Justin M. Keyes
2b06c32a23
Merge #8898 from justinmk/vim-8.1.0310
vim-patch:8.1.0310: file info msg with 'F' in 'shortmess'
2018-09-22 18:53:16 +02:00
Björn Linse
c236e80cf3
Merge pull request #9024 from bfredl/embed_ui2
always wait for UI with --embed, unless --headless is supplied
2018-09-22 10:20:23 +02:00
Björn Linse
4da5cb38d3 startup: always wait for UI with --embed, unless --headless also is supplied 2018-09-22 10:18:28 +02:00
Yichao Zhou
7f990741f7 TUI: Reset cursor color when applicable #8572
Resets the TUI cursor color if:
- current 'guicursor' mode does not specify a highlight group
- cursor highlight group has "inverse" or "reverse" flag
- on Nvim exit

We interpret,  "inverse" to mean "default cursor".

Example:

    hi Cursor guifg=bg guibg=fg
    set termguicolors
    set guicursor=n-v-c-sm:block,i-ci-ve:ver25-Cursor,r-cr-o:hor20

    * When the cursor shape is block, its color will be "inverse"
    * When the cursor shape is I-beam, its color will be `hi Cursor`.

This is useful e.g. to prevent `set listchars=eol:¬` causing your cursor
color to a low contrast color in insert mode because you cursor are
often at EOL in insert mode.

close #8572
2018-09-22 03:07:21 +02:00
Justin M. Keyes
28b5a637b5 test/old: test_options: Accommodate Nvim default 2018-09-21 22:35:20 +02:00
Justin M. Keyes
efbc33cbbc vim-patch:8.1.0310: file info msg with 'F' in 'shortmess'
Problem:    File info message not always suppressed with 'F' in 'shortmess'.
            (Asheq Imran)
Solution:   Save and restore msg_silent. (Christian Brabandt, closes vim/vim#3221)
2f0f871159

ref #8840
ref #9027
2018-09-21 22:35:09 +02:00
Justin M. Keyes
4fa3492a6f Merge #9023 2018-09-21 21:59:54 +02:00
KunMing Xie
ac4d5d9935 vim-patch:8.0.0682: no test for synIDtrans() (#8966)
Problem:    No test for synIDtrans().
Solution:   Add a test. (Dominique Pelle, closes vim/vim#1796)
0b2eef24bc
2018-09-21 10:27:50 +02:00
Justin M. Keyes
dc256e376d man.vim: Fix very long justified lines #9023
When nroff justifies a line, it fills the line with whitespace to meet
$MANWIDTH.  With $MANWIDTH=9999, that of course results in nonsense (and
behaves poorly with 'cursorline' option).

To work around that, instead of trying to hard-justify the lines, just
replace the mega-whitespace with a fixed size of 10 spaces.

Perhaps N/Vim needs a "soft justify" feature?
2018-09-21 10:17:37 +02:00
Doron Behar
9081cad514 man.vim: Ignore $MANWIDTH, use soft wrap #9023
fix #9017
close #9023
2018-09-21 10:17:37 +02:00
Justin M. Keyes
ecdd2df88a
shell/logging: Fix E730 with verbose system({List}) #9009
ref https://github.com/neovim/neovim/issues/9001#issuecomment-421843790

Steps to reproduce:
    :set verbose=9
    :call system(['echo'])
    E730: using List as a String
2018-09-21 09:20:04 +02:00
Justin M. Keyes
ad6bbe4468
Merge #9022 from janlazo/vim-8.0.1215 2018-09-21 08:20:20 +02:00
Jan Edmund Lazo
01b2fa53f4 lint 2018-09-21 00:05:06 -04:00
Jan Edmund Lazo
300a7a4cf4 replace fallthrough comment with macro
Follow-up of vim-patch:8.0.1215
2018-09-21 00:05:06 -04:00
Björn Linse
e55ebae373
Merge pull request #9021 from bfredl/embed_fix
startup: don't erase screen on `:hi Normal` during startup (for non-newgrid UIs)
2018-09-20 15:20:40 +02:00
Jan Edmund Lazo
6a329b0548 vim-patch:8.0.1215: newer gcc warns for implicit fallthrough
Problem:    Newer gcc warns for implicit fallthrough.
Solution:   Consistently use a FALLTHROUGH comment. (Christian Brabandt)
2f40d129bf
2018-09-20 06:59:04 -04:00
Björn Linse
5487624730 startup: don't erase screen on :hi Normal during startup
NB: existing `color default` test was actually enough to trigger the bug,
when ext_newgrid=false is used. I created the `:hi Normal` test as
I thought the builtin colors wouldn't set Normal (unless 'bg' is changed)
But as the root cause actually comes from `:hi Normal`, it makes sense
to still add the separate test (if `color default` here gets optimized to
become a no-op, or something).
2018-09-20 12:25:31 +02:00
Daniel Hahler
47d74bf32f doc: test/README.md (#9020)
- testdir location
- no old style tests are left in the fixed list in the Makefile

[ci skip]
2018-09-20 09:37:53 +02:00
Justin M. Keyes
8b60253ce7
cleanup/TUI: remove old unused code #9013
- Checks for ECHOE, ICANON were left over from Vim code. We already
  reference the symbols elsewhere without checking.
- newline_on_exit, intr_char: Both are vestigial remnants of Vim 4.x,
  not implemented in Nvim. intr_char is a termios/stty feature, it's
  probably not useful because users have other ways to configure their
  terminals.
2018-09-19 07:59:09 +02:00
Justin M. Keyes
d0401e827b
Merge #9014 from justinmk/log-more 2018-09-19 07:55:46 +02:00
Justin M. Keyes
7c00b9efca log: RPC, input, other events 2018-09-19 01:11:09 +02:00
Justin M. Keyes
b9bcfa9bc8 log: rename do_log to logmsg 2018-09-19 00:58:25 +02:00
Justin M. Keyes
a316258d2c test: system_spec: remove redundant clear() 2018-09-19 00:49:18 +02:00
Björn Linse
809fff94e6
Merge pull request #8754 from bfredl/embed_ui
startup: make --embed wait for first request so embedding UI can display startup messages
2018-09-18 20:52:13 +02:00
Björn Linse
bd8d43c6fe startup: wait for embedder before executing startup commands and files
Give embeders a chance to set up nvim, by processing a request before
startup. This allows an external UI to show messages and prompts from
--cmd and buffer loading (e.g. swap files)
2018-09-18 19:22:16 +02:00
Justin M. Keyes
32ad52ae04
TUI: Skip redundant "stop" event (macOS kernel panic) (#9007)
When the TUI suspends (:suspend, CTRL-z) it calls tui_terminal_stop (but
does NOT set `ui->data=NULL`, so `tui_is_stopped` returns false). If the
host terminal dies, it sends SIGCONT, SIGHUP (usually in that order):

    ERROR 2018-09-16T19:30:17.065 25821 suspend_event:1153: SIGCONT
    ERROR 2018-09-16T19:30:17.065 25821 on_signal:162: SIGHUP
    ERROR 2018-09-16T19:30:17.155 25821 on_signal:162: SIGHUP

Race: if SIGHUP is handled before SIGCONT, it calls ui_builtin_stop()
which schedules tui_stop before the TUI was resumed?

libuv uv_close() aborts if the handle is already closed/closing.
Somehow that causes macOS to panic. #8075

    Assertion failed: (!uv__is_closing(handle)), function uv_close, file src/unix/core.c, line 117.

    Thread 0:: Dispatch queue: com.apple.main-thread
    0   libsystem_kernel.dylib        	0x00007fff67d69ec2 kevent + 10
    1   libuv.1.dylib                 	0x000000010609304d uv__io_poll + 892
    2   libuv.1.dylib                 	0x0000000106083904 uv_run + 339
    3   nvim                          	0x0000000105e76f7b loop_poll_events + 74
    4   nvim                          	0x0000000105fa5f51 ui_bridge_stop + 206
    5   nvim                          	0x0000000105fa4c00 ui_builtin_stop + 50
    6   nvim                          	0x0000000105f26ee9 mch_exit + 29
    7   nvim                          	0x0000000105eda84a getout + 518
    8   nvim                          	0x0000000105e778b3 multiqueue_process_events + 77
    9   nvim                          	0x0000000105f24c5a os_breakcheck + 49
    10  nvim                          	0x0000000105eb7ea3 auto_next_pat + 463
    11  nvim                          	0x0000000105eb7603 apply_autocmds_group + 1289
    12  nvim                          	0x0000000105eb0e8d apply_autocmds + 36
    13  nvim                          	0x0000000105f5a412 screenalloc + 1892
    14  nvim                          	0x0000000105f5b223 screen_resize + 190
    15  nvim                          	0x0000000105fa52e3 ui_refresh + 257
    16  nvim                          	0x0000000105e8c3d9 do_cmdline + 6614
    17  nvim                          	0x0000000105f03a72 normal_execute + 3996
    18  nvim                          	0x0000000105f89925 state_enter + 164
    19  nvim                          	0x0000000105efe08d normal_enter + 125
    20  nvim                          	0x0000000105ed9ffd main + 6858
    21  libdyld.dylib                 	0x00007fff67c19115 start + 1

    Thread 1 Crashed:
    0   libsystem_kernel.dylib        	0x00007fff67d68e3e __pthread_kill + 10
    1   libsystem_pthread.dylib       	0x00007fff67ea7150 pthread_kill + 333
    2   libsystem_c.dylib             	0x00007fff67cc5312 abort + 127
    3   libsystem_c.dylib             	0x00007fff67c8d368 __assert_rtn + 320
    4   libuv.1.dylib                 	0x00000001060835bf uv_close + 247
    5   nvim                          	0x0000000105fa0ebb tui_terminal_stop + 221
    6   nvim                          	0x0000000105f9ff3d tui_stop + 14
    7   nvim                          	0x0000000105e778b3 multiqueue_process_events + 77
    8   nvim                          	0x0000000105fa0c89 tui_main + 302
    9   libsystem_pthread.dylib       	0x00007fff67ea46c1 _pthread_body + 340
    10  libsystem_pthread.dylib       	0x00007fff67ea456d _pthread_start + 377
    11  libsystem_pthread.dylib       	0x00007fff67ea3c5d thread_start + 13

TODO:
- Set `ui->data = NULL` to flag UI as "stopped"? But loop_poll_events
  drains *all* fast_events, so could skip some events...
2018-09-18 08:16:38 +02:00
Justin M. Keyes
0a4d7ce669
Merge pull request #9011 from janlazo/vim-8.0.1428
vim-patch:8.0.{1428,1443}
2018-09-18 07:21:24 +02:00
Jan Edmund Lazo
58559a2249 vim-patch:8.0.1443: compiler complains about uninitialized variable
Problem:    Compiler complains about uninitialized variable. (Tony Mechelynck)
Solution:   Assign a value to the variable.
059fd01021
2018-09-17 22:40:29 -04:00
Jan Edmund Lazo
a00247e147 vim-patch:8.0.1428: compiler warning on 64 bit MS-Windows system
Problem:    Compiler warning on 64 bit MS-Windows system.
Solution:   Change type from "int" to "size_t". (Mike Williams)
200ea8ffaa
2018-09-17 22:38:10 -04:00
Björn Linse
8de87c7b1c
Merge pull request #8180 from bfredl/eol_text
support "virtual text" annotations (currently after EOL only)
2018-09-17 15:36:10 +02:00
Björn Linse
45f53b370b buffer: add support for virtual text annotations 2018-09-17 10:41:29 +02:00
Justin M. Keyes
398b9fde85
Merge #9008 from janlazo/vim-8.0.1416 2018-09-17 10:40:48 +02:00
Jan Edmund Lazo
a0ada7dac4 lint 2018-09-16 20:55:59 -04:00
Jan Edmund Lazo
0b60372792 vim-patch:8.0.1417: test doesn't search for a sentence
Problem:    Test doesn't search for a sentence. Still fails when searching for
            start of sentence. (Dominique Pelle)
Solution:   Add paren. Check for MAXCOL in dec().
1bd999f982
2018-09-16 20:55:46 -04:00