Commit Graph

12615 Commits

Author SHA1 Message Date
Justin M. Keyes
ee21fe3d2a TUI: force italics in tmux
tmux users are encouraged to use "tmux-256color" instead of the old
"screen-256color". Put this in your .tmux.conf :

    if-shell 'infocmp tmux-256color' 'set -g default-terminal "tmux-256color"' 'set -g default-terminal "screen-256color"'

If default-terminal is "tmux-256color" AND tmux finds its terminfo, THEN
it will enable italics (regardless of whether the terminfo contains
sitm/ritm).

OTHERWISE tmux "emulates screen", which means it emits italics as
"reverse". That's unfortunate, but it's an acceptable compromise that
allows Nvim to support italics in tmux by default in compatible (and
increasingly-common) configurations.

Test case:

    tmux
    nvim -u NORC +'hi Comment cterm=italic' CMakeLists.txt

ref #9598
2019-02-11 10:52:30 +01:00
Justin M. Keyes
2beb731ed4 TUI: italics in Terminal.app (nsterm)
This is the conservative approach, requiring TERM=nsterm as recommended
at `:help $TERM`.  It won't work with Terminal.app's default of
TERM=xterm-256color, nor in tmux.

Test case:

    TERM=nsterm nvim -u NORC +'hi Comment cterm=italic' CMakeLists.txt

closes #9598
2019-02-11 10:51:52 +01:00
Björn Linse
b3ce0019a7
Merge pull request #7466 from bfredl/ext_messages
ui: implement ext_messages to externalize all messages in msg area
2019-02-10 14:55:12 +01:00
Björn Linse
51fc54325c ui: implement ext_messages
Co-Author: Dongdong Zhou <dzhou121@gmail.com>
2019-02-10 13:36:46 +01:00
Björn Linse
3ff1228f78
Merge pull request #9272 from bfredl/createbuf
api: add nvim_create_buf to create a new empty buffer.
2019-02-09 15:01:06 +01:00
Marco Hinz
c9d01ff7db
doc: 'fillchars' is local to window
This was forgotten in 352811fe5 since the commit was originally meant to only
change 'listchars'.
2019-02-09 12:21:24 +01:00
Björn Linse
891ed14f13 api: add nvim_create_buf to create a new empty buffer.
Loading existing files into a buffer is non-trivial and requires a window.
Creating an unnamed emtpy buffer is trivial and safe though, thus worth a
special case.

Change nvim_buf_set_option to use aucmd_prepbuf. This is necessary
to allow some options to be set on a not yet displayed buffer, such
as 'buftype' option.

vim-patch:7.4.1858: Add BLN_NEW to enforce buflist_new creating new buffer
2019-02-09 11:48:45 +01:00
Björn Linse
f6faeea41c
Merge pull request #9586 from bfredl/screencleanup
screen: cleanup allocation and scrolling
2019-02-07 21:41:45 +01:00
Björn Linse
be8058cfe4 screen: cleanup allocation, clearing and validation
grid_xx functions shouldn't randomly be called when the screen is not valid.
Nvim deterministically initializes a default screen early in main(), so the
default grid can be assumed to be allocated.
2019-02-07 17:56:02 +01:00
Björn Linse
6e9ea5adce screen: simplify scrolling code
Since the separation between internal screen and TUI, internal scroll
cannot FAIL. Delete the conditions for this.
2019-02-07 17:56:02 +01:00
Björn Linse
fa2580f953
Merge pull request #9571 from bfredl/pum_transparent
UI: implement 'pumblend' option for semi-transparent popupmenu
2019-02-07 17:52:58 +01:00
Björn Linse
37f8df8824 UI: implement 'pumblend' option for semi-transparent popupmenu
Why?

- Because we can.
- Because the TUI is just another GUI™
- Because it looks kinda nice, and provides useful context like 1 out of 100
  times

Complies with "don't pay for what you don't use".

Some crashes for resizing were unfolded, add tests for those.
2019-02-07 16:43:51 +01:00
Justin M. Keyes
ed0e96cd28 man.vim: set 'linebreak'
closes #9583
2019-02-06 22:18:34 +01:00
Björn Linse
c9b7f0c249
Merge pull request #9581 from bfredl/alwaysrgb
UI: always use contrete colors for default_colors_set
2019-02-05 20:59:07 +01:00
Björn Linse
baf93d9606 UI: always use contrete colors for default_colors_set
But add an escape hatch needed for external TUI, so it still can use
terminal emulator defaults.
2019-02-05 19:41:38 +01:00
Justin M. Keyes
36378c33c6
Merge #9560 from justinmk/Wmissing-prototypes 2019-02-04 19:40:14 +01:00
Justin M. Keyes
45f25f7e0b build: PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES
On Travis CI, -Wmissing-prototypes gives strange error:

    In file included from ../src/nvim/eval.c:5965:
    /home/travis/build/neovim/neovim/build/src/nvim/auto/funcs.generated.h.gperf:215:1: error: conflicting types for 'find_internal_func_gperf'
    find_internal_func_gperf (register const char *str, register unsigned int len)
    ^
    ../src/nvim/eval.c:5962:20: note: previous declaration is here
    const VimLFuncDef *find_internal_func_gperf(register const char *str,
                   ^
2019-02-04 13:16:59 +01:00
Justin M. Keyes
f2c6164b04 build: -Wmissing-prototypes
ref #343

Though I don't see a strong benefit, it isn't too much of a burden, and
maybe avoids confusion in some cases.
2019-02-04 04:00:20 +01:00
Justin M. Keyes
4386814b04 build: set compiler options in one place
- add_definitions() is preferred to CMAKE_C_FLAGS.
2019-02-04 02:57:18 +01:00
Marco Hinz
91688b4883 options: set 'scrollback' to -1 by default #9563
Makes the 'scrollback' option more consistent (same default for all buffers) and future-proof.

- Default to -1 for all buffers, but treat it as an implementation detail.
- Document range of 1 - 100_000.
- New terminal buffer by default sets scrollback=10_000 if the global default is -1.
- Existing terminal buffer: On entering terminal-mode or on refresh, if the user explicitly did `:set[local] scbk=-1`, the local value goes to 100_000 (max). (This is undocumented on purpose. Users should work with explicit values in the range of 1-100_000.)
2019-02-04 02:53:23 +01:00
Marco Hinz
70f6939fd4 events: add "Signal" event #9564
..which gets triggered when SIGUSR1 is sent to the nvim process.

Closes #9562
2019-02-04 02:39:05 +01:00
Björn Linse
da88278f27
Merge pull request #9579 from bfredl/pum_fix
popupmenu: fix alignment of kind and extra after #9530
2019-02-03 22:17:28 +01:00
Justin M. Keyes
08155e2b53
Merge #9578 'vim-patch:8.0.{1045,1073,1077,1114}' 2019-02-03 21:36:32 +01:00
Björn Linse
81ac8e9015 popupmenu: fix alignment of kind and extra after #9530 2019-02-03 20:43:23 +01:00
Justin M. Keyes
01b4efe9d9
rename ui_is_external to ui_has (#9576) 2019-02-03 16:42:44 +01:00
Jan Edmund Lazo
5a40abe2d5 vim-patch:8.0.1114: default for 'iminsert' is annoying
Problem:    Default for 'iminsert' is annoying.
Solution:   Make the default always zero. (Yasuhiro Matsumoto, closes vim/vim#2071)
4cf56bbc85
2019-02-03 09:52:13 -05:00
Jan Edmund Lazo
45fadf7323 vim-patch:8.0.1077: no debugger making use of the terminal window
Problem:    No debugger making use of the terminal window.
Solution:   Add the term debugger plugin.  So far only displays the current
            line when stopped.
fe386641b0
2019-02-03 08:51:11 -05:00
Jan Edmund Lazo
c1ef241390 vim-patch:8.0.1073: may get an endless loop if 'statusline' changes a highlight
Problem:    May get an endless loop if 'statusline' changes a highlight.
Solution:   Do not let evaluating 'statusline' trigger a redraw.
ba2929b6af
2019-02-03 08:32:51 -05:00
Björn Linse
79a0ea2bec
Merge pull request #9530 from bfredl/pum_float
Implement popupmenu as a floating grid internally to reduce flicker
2019-02-02 21:27:09 +01:00
Björn Linse
0f96a21e3f multigrid: reset win scrolling after swap message 2019-02-02 16:31:49 +01:00
Björn Linse
bfe2435459 tests/ui: add test for popupmenu redrawing in various situations
Many of these are handled by the compositor. Check that it causes
no glitches.
2019-02-02 16:31:49 +01:00
Björn Linse
69bdc4f072 ui/compositor: add redraws needed due to intersected doublewidth chars. 2019-02-02 16:31:49 +01:00
Björn Linse
2405cf8255 vim-patch:8.1.0792: bad display if opening cmdline window from Insert completion 2019-02-02 16:31:49 +01:00
Björn Linse
2c01e79dc4 Reduce pum redraws from edit.c by delaying undisplay of pum
This makes it possible for the compositor to compare the old pum with
the new position, and only clear what is necessary.
2019-02-02 16:31:49 +01:00
Björn Linse
31cbd34d97 UI: add "compositor" layer to merge grids for TUI use in a correct way
Initially we will use this for the popupmenu, floating windows will
follow soon

NB: writedelay + compositor is weird, we need more flexible
redraw introspection.
2019-02-02 16:31:49 +01:00
Jan Edmund Lazo
29db365e4c vim-patch:8.0.1045: running tests may pollute shell history
Problem:    Running tests may pollute shell history. (Manuel Ortega)
Solution:   Make $HISTFILE empty.
6a8691d483
2019-02-02 07:38:53 -05:00
KillTheMule
f89d0d8230 inccommand: auto-disable if folding is slow #9568
Fixes #9557
2019-02-01 01:40:01 +01:00
Justin M. Keyes
ada82f3482
Merge #9565 from justinmk/test 2019-01-31 22:27:12 +01:00
Justin M. Keyes
a494910aa1 test: adjust timer_spec 2019-01-31 22:26:32 +01:00
Justin M. Keyes
d4750100b0 test: improve reliability of ":terminal topline" test
- Avoid using platform-specific shell, it failed in MINGW_64 env.
- tty-test.c echos our input, which is exactly what we need for this test.
- Test fails correctly if 894f6bee54 is reverted.
2019-01-31 22:26:32 +01:00
Andrew Pyatkov
894f6bee54 :terminal : set topline based on window height #8325
closes #8324
closes #8556
2019-01-29 03:00:48 +01:00
Marco Hinz
28f87c505d
Merge #9539 "options: make 'listchars' and 'fillchars' local to window" 2019-01-28 00:45:59 +01:00
Justin M. Keyes
7e6980a161
doc [ci skip] (#9553) 2019-01-27 15:06:11 +01:00
Björn Linse
8171e96b96
Merge pull request #9551 from bfredl/multiterm
Fix :terminal resizing, and some multigrid size cleanup
2019-01-27 14:15:08 +01:00
Björn Linse
de16c0bf64 screen: simplify wp->w_lines allocation logic 2019-01-27 12:07:06 +01:00
Björn Linse
30bd1c1e85 terminal: handle size when switching buffers in window 2019-01-27 12:07:06 +01:00
Björn Linse
2ab70cb55c window/ui: reorganize size variables, fix terminal window size with multigrid.
wp->w_height_inner now contains the "inner" size, regardless if the
window has been drawn yet or not. It should be used instead of
wp->w_grid.Rows, for stuff that is not directly related to accessing
the allocated grid memory, such like cursor movement and terminal size
2019-01-27 12:07:06 +01:00
Björn Linse
80b75bc99a screen: remove superfluous default_grid indirection for global size
This was changed by mistake in multigrid PR.
default_grid.Rows rather corresponds to the old screen_Rows
2019-01-27 12:07:06 +01:00
Björn Linse
d9406f4b64 terminal: simplify sizing logic 2019-01-27 12:07:06 +01:00
ckelsel
f2398a766e vim-patch:8.0.0413: menu test fails on MS-Windows #8173
Problem:    Menu test fails on MS-Windows using gvim.
Solution:   First delete the English menus.
a1c8ecfda9
2019-01-27 01:35:00 +01:00