Commit Graph

104 Commits

Author SHA1 Message Date
Justin M. Keyes
fbaee922d1 doc [ci skip]
closes #9719
2019-03-26 19:55:33 +01:00
Björn Linse
be8ebba325 Allow using internal popupmenu or ext_popupmenu for wildmenu
Deprecate ext_wildmenu. ext_popupmenu already contains more state (anchor
position), and will allow further expansion (info about items).
2019-03-16 19:53:21 +01:00
Björn Linse
9a1675b065 floats: implement floating windows
Co-Author: Dongdong Zhou <dzhou121@gmail.com>
2019-03-02 16:29:50 +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
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
Björn Linse
9a1c61456b multigrid: simplify tests 2018-12-31 16:24:07 +01:00
Björn Linse
44b8e58f33 multigrid: add tests for multiline messages and tabs 2018-12-31 16:24:07 +01:00
Björn Linse
ed3da23cf4 multigrid: test refactor 2018-12-31 16:24:07 +01:00
Björn Linse
db14d78e4f multigrid: rename event to win_pos, make grid first 2018-12-31 12:44:22 +01:00
Björn Linse
f6f8f0ee76 multigrid: add msg_scroll_start and msg_scroll_reset events 2018-12-31 12:44:22 +01:00
Utkarsh Maheshwari
ebe16cd9bd multigrid: add multigrid screen tests 2018-12-31 12:44:22 +01:00
Björn Linse
1f8afe15a4 multigrid: add multigrid support to test infrastructure
make Screen explicitly tied to its session
2018-12-31 12:44:22 +01:00
Justin M. Keyes
30857030e8 doc
- develop.txt is for design/guidelines; architecture/concepts should
  live elsewhere (currently src/nvim/README.md)
- move dev-jargon to intro.txt
- replace https://neovim.io/community (deprecated) with
  https://neovim.io/#chat
- <Cmd> avoids CmdlineEnter/Leave
  https://github.com/vim/vim/issues/2889
2018-11-28 03:48:06 +01:00
Justin M. Keyes
deb18a050e
defaults: background=dark #2894 (#9205)
By historical accident, Nvim defaults to background=light. So on a dark
background, `:colorscheme default` looks completely wrong.

The "smart" logic that Vim uses is confusing for anyone who uses Vim on
multiple platforms, so rather than mimic that, pick the (hopefully) most
common default.

- Since Neovim is dark-powered, we assume most users have dark backgrounds.
- Most of the GUIs tend to have a dark background by default.

ref #6289
2018-11-20 10:52:49 +01:00
Björn Linse
c8810a51a3 tests: improve robustness of immediate successes in screen tests 2018-10-15 20:13:11 +02:00
Björn Linse
bab3b0ad45 ui: reserve the right to split a screen redraw into multiple batches. 2018-10-02 10:52:37 +02:00
Björn Linse
43823acae2 ui: rename ext_newgrid to ext_linegrid 2018-10-01 21:24:15 +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
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
Björn Linse
74937589d0 screen.lua: extend snapshot_util() to work with extension state
Simplify handling of attributes: collect new attributes in the same pass
as screen lines are rendered, instead of using two passes.
2018-09-03 10:36:55 +02:00
Björn Linse
3d88287e30 tests: introduce screen:expect{...} form 2018-08-27 15:15:49 +02:00
Björn Linse
fa4c260100 cursor_shape: use attribute ids instead of syntax ids
As attribute ids is the convention in the UI protocol
Also remove non-threadsafe calls in tui.c to syntax module.
2018-08-13 13:35:35 +02:00
Björn Linse
d183103b45 test: assert scroll region state for clear
some clients assume this, so tests should check it
2018-07-24 16:37:04 +02:00
Björn Linse
6b8cd827a9 ui: add tests for hlstate extension 2018-07-21 13:21:59 +02:00
Björn Linse
1adb01c120 ui: use line-based rather than char-based updates in screen.c
Add ext_newgrid and ext_hlstate extensions. These use predefined
highlights and line-segment based updates, for efficiency and
simplicity.. The ext_hlstate extension in addition allows semantic
identification of builtin and syntax highlights.

Reimplement the old char-based updates in the remote UI layer, for
compatibility. For the moment, this is still the default. The bulitin
TUI uses the new line-based protocol.

cmdline uses curwin cursor position when ext_cmdline is active.
2018-07-21 13:21:58 +02:00
Björn Linse
38f0ac07b5 tests/screen.lua: treat "resize" like any other event
Saves ~10 seconds in UI tests
2018-07-11 12:57:01 +02:00
Björn Linse
5d8da126d0 ui/tui: highlighting refactor
Make HlAttr contain highlighting state for both color modes (cterm and rgb).
This allows us to implement termguicolors completely in the TUI.

Simplify some logic duplicated between ui.c and screen.c. Also avoid
some superfluous highlighting reset events.
2018-02-11 10:29:32 +01:00
Björn Linse
34057045be
ui: forward relevant option updates to UIs (#7520)
also make termguicolors mutable after startup
2017-12-12 18:23:19 +01:00
Björn Linse
ba7d6a9e6b ui: fix glitch with both ext_cmdline and cmd_wildmenu 2017-12-06 09:41:51 +01:00
ZyX
36a84d8f4a functests: Fix typo 2017-06-28 13:54:04 +03:00
ZyX
476c28f433 functests: Fix screen.lua supplying dedent additional argument 2017-06-21 10:58:47 +03:00
Justin M. Keyes
4524053874 test: api: Do not truncate errors <1 MB. 2017-04-23 23:24:16 +02:00
Björn Linse
7ea5c78687 ui: use an array for mode styles 2017-04-21 12:32:38 +02:00
Björn Linse
2c5751b9b2 ui: add tests for new cursor shape modes 2017-04-21 12:32:38 +02:00
Justin M. Keyes
119f0ca854 test: helpers.execute() => helpers.feed_command() 2017-04-11 02:37:39 +02:00
Björn Linse
3b558e5d7b tests: short form screen:except(func) expects condition only. #6440
- Use this to properly test cursor shape events.
- tests: update screen_basic_spec to use `screen:expect` short form.
  Clearer than using `screen:wait` directy.
2017-04-06 01:06:39 +02:00
Justin M. Keyes
3ccd59ee82 'guicursor': enabled=false if 'guicursor' is empty
Closes #6429
Closes #6430
2017-04-04 14:19:26 +02:00
Justin M. Keyes
3a69dbfca6 api/cursor_style_set: mode descriptions 2017-04-01 23:29:10 +02:00
Justin M. Keyes
c2826a7830 'guicursor': Empty means "block cursor in all modes".
Also: update default 'guicursor' to match the documentation.
2017-04-01 23:14:05 +02:00
Matthieu Coudron
dd4a5fcbb6 tui: 'guicursor' shape #6044
Closes #2583
2017-04-01 23:14:05 +02:00
Justin M. Keyes
6be8ea0787 coverity/133845: Negative array index read. (FP)
`find_command(s->ca.cmdchar) >= 0` was established near the start of
normal_execute(). And `unshift_special(&s->ca);` "should" not ever
result in s->ca.cmdchar containing a multibyte char.

So only an assert() is needed here.
2017-01-23 15:49:37 +01:00
Justin M. Keyes
ef753a76b9 tui: Enable mode-sensitive cursor by default.
Also give NVIM_TUI_ENABLE_CURSOR_SHAPE more granularity:
0 = do not change cursor shape
1 = non-blinking ("steady") cursor with mode-sensitive shape
2 = blinking cursor with mode-sensitive shape

Note: blink state is not changed for Konsole, instead user's terminal
preference makes the decision. (Can't do that for xterm-likes, DECSCUSR
forces us to choose blink-state.)

This is a temporary step until the TUI respects 'guicursor'
Ref: https://github.com/neovim/neovim/issues/2583#issuecomment-272988384
2017-01-20 15:48:41 +01:00
James McCoy
75e6af44e0 Merge pull request #5963 from jamessan/screen-expect-clarity
test: screen: Assert expected row count matches configured screen height
2017-01-18 15:16:07 -05:00
Justin M. Keyes
2ee60e5b28 test: nvim_ui_attach() with huge dimensions. (#5974)
Also:
- Attempt to constrain wall-of-text in screen.lua.
- Windows: Enable screen_basic_spec.lua

Closes #2180
2017-01-18 20:28:35 +01:00
James McCoy
4322021bae test: screen: Assert expected row count matches configured screen height
When there is a difference in expected vs. actual row count, the user
gets a confusing message about being unable to string concat a nil value
from screen:expect.

This assert makes it clear what the problem is rather than requiring
people to dig through the code of screen:expect to determine what
happened.
2017-01-18 11:24:34 -05:00
Justin M. Keyes
97204e1cef os/shell: Throttle :! output, pulse "..." message.
Periodically skip :! spam. This is a "cheat" that works for all UIs and greatly
improves responsiveness when :! spams MB or GB of output:
    :!yes
    :!while true; do date; done
    :!git grep ''
    :grep -r '' *

After ~10KB of data is seen from a single :! invocation, output will be skipped
for ~1s and three dots "..." will pulse in the bottom-left. Thereafter the
behavior alternates at every:
    * 10KB received
    * ~1s throttled

This also avoids out-of-memory which could happen with large :! outputs.

Note: This commit does not change the behavior of execute(':!foo').
      execute(':!foo') returns the string ':!foo^M', it captures *only* Vim
      messages, *not* shell command output. Vim behaves the same way.
      Use system('foo') for capturing shell command output.

Closes #1234

Helped-by: oni-link <knil.ino@gmail.com>
2016-12-09 18:51:17 +01:00
chemzqm
3cf4b14e96 add cmdline mode to modechange of RPC and tests
use set_cursor_shape_bar for cmdline mode

fix test of screen_basic_spec.lua & screen.lua

comment fix
2016-11-30 22:20:06 +08:00
Björn Linse
4b95bb582d ui: add tests for ui_mode_change
Also fix snapshot_util() to work even if default_attr_ids is not a
proper lua array.
2016-11-25 11:37:23 +01:00
Björn Linse
c41bacc67c api/ui: add tests for popupmenu_external events
update screen.lua to use new style nvim_ui_attach
2016-08-29 10:17:31 +02:00
Björn Linse
725074aafc tests: add note to expect() message about snapshot_util() 2016-08-14 21:53:02 +02:00