Commit Graph

11807 Commits

Author SHA1 Message Date
Björn Linse
edb26f2c65 tui: eliminate scrolling region data structure
The scrolling region is always local to a single grid_scroll event, use
local variables and parameters instead.

The invocation of reset_scroll_region in grid_resize is cargo-culted to use
margin reset under exactly the same circumstances, not sure if it is necessary
though.
2018-09-27 08:50:48 +02:00
Björn Linse
1b8939d233 tui: eliminate grid->attrs, use indexed cell->attr
remove dead ugrid_put
2018-09-26 19:30:21 +02:00
Justin M. Keyes
fc18fad74f
Merge #9053 from janlazo/vim-8.1.0433 2018-09-26 08:13:21 +02:00
Jan Edmund Lazo
c6350e4150 vim-patch:8.1.0436: can get the text of inputsecret() with getcmdline()
Problem:    Can get the text of inputsecret() with getcmdline(). (Tommy Allen)
Solution:   Don't return the text.
ee91c33570
2018-09-25 23:13:29 -04:00
Jan Edmund Lazo
28ac4a99f2 vim-patch:8.1.0433: mapping can obtain text from inputsecret()
Problem:    Mapping can obtain text from inputsecret(). (Tommy Allen)
Solution:   Disallow CTRL-R = and CTRL-\ e when using inputsecret().
31cbadf74b
2018-09-25 23:09:51 -04:00
Josh Triplett
8240b8b596 terminal: Redraw statusline on title change #8973
The statusline may incorporate b:term_title, so redraw it when that
title changes.

Introduce a new function status_redraw_buf to redraw windows associated
with the current buffer.
2018-09-25 08:47:48 +02:00
Justin M. Keyes
7862c3ae3e
Merge #9047 from jamessan/log-crash 2018-09-25 08:07:51 +02:00
Christian Duerr
7bff9a5de8 TUI: Alacritty supports DECSCUSR (#9048)
Alacritty may set TERM to"alacritty" or "alacritty-direct" if it finds its terminfo.
2018-09-25 07:54:25 +02:00
James McCoy
d59bf058ab
log: Assert that we haven't started freeing memory before logging
This is to catch situations like the previous commit, which somehow
avoided detection by any of the CI builds.
2018-09-24 22:56:24 -04:00
James McCoy
1bd916df35
os_unix: Log exit code before freeing all memory
When building with -DEXITFREE, the ILOG call would result in a crash
trying to access VV_PROGPATH, which had already been released:

    (gdb) bt
    #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
    #1  0x00007f8f761082f1 in __GI_abort () at abort.c:79
    #2  0x00007f8f760ffa8a in __assert_fail_base (fmt=0x7f8f76253ec8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
        assertion=assertion@entry=0x1c74280 <.str.8> " ,\t\n", file=file@entry=0x1c73fe2 "256]'", line=line@entry=610,
        function=function@entry=0x1c742e0 <.str.9+32> "") at assert.c:92
    #3  0x00007f8f760ffb02 in __GI___assert_fail (assertion=0x1c74280 <.str.8> " ,\t\n", file=0x1c73fe2 "256]'", line=610,
        function=0x1c742e0 <.str.9+32> "") at assert.c:101
    #4  0x00000000012d87c1 in vim_getenv (name=0x2f5a460 <get_special_key_name.string+64> "NVIM_LOG_FILE") at ../src/nvim/os/env.c:608
    #5  0x00000000012d6538 in expand_env_esc (srcp=0x1c2f4e0 <.str.10+32> "",
        dst=0x2f5a460 <get_special_key_name.string+64> "NVIM_LOG_FILE", dstlen=4095, esc=false, one=false, prefix=0x0)
        at ../src/nvim/os/env.c:351
    #6  0x00000000012d85af in expand_env_esc (srcp=0x625000000100 "\004", dst=0x7ffeed88cf40 "", dstlen=32766, esc=237, one=136,
        prefix=0x60200401c8b4 <error: Cannot access memory at address 0x60200401c8b4>) at ../src/nvim/os/env.c:472
    #7  0x0000000000eb4274 in do_log_to_file (log_file=0x0, log_level=0, context=0x0, func_name=0x0, line_num=0, eol=false, fmt=0x0)
        at ../src/nvim/log.c:254
    #8  0x0000000000eb305b in open_log_file () at ../src/nvim/log.c:164
    #9  0x0000000000eb2cc6 in logmsg (log_level=<error reading variable: Cannot access memory at address 0x268>,
        context=<error reading variable: Cannot access memory at address 0x260>,
        func_name=<error reading variable: Cannot access memory at address 0x258>,
        line_num=<error reading variable: Cannot access memory at address 0x254>,
        eol=<error reading variable: Cannot access memory at address 0x253>,
        fmt=<error reading variable: Cannot access memory at address 0x248>) at ../src/nvim/log.c:109
    #10 0x00000000013022c7 in mch_free_acl (aclent=0x4f59100) at ../src/nvim/os_unix.c:132
    #11 0x0000000000efddac in getout (exitval=0) at ../src/nvim/main.c:681
    #12 0x0000000000c1bb3e in ex_quit (eap=0x7ffeed88cd00) at ../src/nvim/ex_docmd.c:6067
    #13 0x0000000000bab781 in do_one_cmd (cmdlinep=0x7ffeed88f180, flags=10, cstack=0x7ffeed88f1a0, fgetline=0x0, cookie=0x0)
        at ../src/nvim/ex_docmd.c:2228
    #14 0x0000000000b8de6d in do_cmdline (cmdline=0x7ffeed891ae2 "quit", fgetline=0x0, cookie=0x0, flags=10)
        at ../src/nvim/ex_docmd.c:592
    #15 0x0000000000b94036 in do_cmdline_cmd (cmd=0x7ffeed891ae2 "quit") at ../src/nvim/ex_docmd.c:268
    #16 0x0000000000efb900 in exe_commands (parmp=0x7ffeed890900) at ../src/nvim/main.c:1699
    #17 0x0000000000ee96b2 in main (argc=11, argv=0x7ffeed890fa8) at ../src/nvim/main.c:524
2018-09-24 22:56:19 -04:00
Justin M. Keyes
59b2e6d35d
deps: revert to jemalloc 4.5.0 (#9035)
- Since the jemalloc upgrade to 5.1.0, I'm seeing weird behavior such as
  infinite loops inside jemalloc routines.
- VimR maintainer reported major performance regression correlated with
  jemalloc 5.1.0.

ref https://github.com/neovim/neovim/pull/7808

reverts 765515010f
2018-09-25 00:06:52 +02:00
Justin M. Keyes
200c8b9cca
build: Unify USE_BUNDLED, USE_BUNDLED_DEPS (#9046)
It's confusing that the Makefile uses a different name than CMake.
2018-09-24 23:18:48 +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