Commit Graph

284 Commits

Author SHA1 Message Date
Björn Linse
ab48a3e9fd tests: add basic test for 'winhighlight` 2017-05-08 12:41:39 +02:00
Björn Linse
bfcaf36404 options: allow different highlights in windows 2017-05-08 12:41:39 +02:00
James McCoy
de50c003d5 Use vim_strchr(s, c) when c may be NUL (#6656)
As part of the refactoring in #5119, some vim_strchr() were changed to
strchr().  However, vim_strchr() behaves differently than strchr() when
c is NUL, returning NULL instead of a pointer to the NUL.

Revert the strchr() calls where it isn't known whether c is NUL, since
this causes a semantic change the surrounding code doesn't expect.  In
the case of #6650, this led to a heap overrun.

Closes #6650
2017-05-03 10:12:38 +02:00
Justin M. Keyes
d349f610ac 'guicursor': No color/blink by default
Closes #6577
2017-04-30 13:44:31 +02:00
Justin M. Keyes
7044aa6e82 api/ext_tabline: curtab should be a Tabpage handle. 2017-04-28 15:59:20 +02:00
Justin M. Keyes
6755262194 test: inccommand_spec: Avoid indeterminism. (#6592) 2017-04-26 14:51:21 +02:00
Justin M. Keyes
6944abad2f api/ext_tabline: List of Dicts. 2017-04-26 03:41:24 +02:00
Justin M. Keyes
c8e1af93de api: nvim_ui_attach(): Flatten ext_* options. 2017-04-26 03:41:24 +02:00
Justin M. Keyes
00843902d3 api/ui: externalize tabline
- Work with a bool[] array parallel to the UIWidget enum.
- Rename some functions.
- Documentation.
2017-04-26 03:41:24 +02:00
Dongdong Zhou
88023d5123 api/ui: externalize tabline 2017-04-26 02:15:31 +02: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
45aa465fba test: Cursor after :hi clear|syntax reset
Also enable tests on Windows.
2017-04-17 21:15:51 +02:00
Justin M. Keyes
119f0ca854 test: helpers.execute() => helpers.feed_command() 2017-04-11 02:37:39 +02:00
ZyX
0ac2afdec7 functests: Fix some ui/*_spec tests 2017-04-09 03:24:26 +03:00
ZyX
ddaa41dee4 functests: Fix ui/bufhl_spec 2017-04-09 03:24:26 +03:00
ZyX
88ea362c70 functests: Fix ui/screen_basic_spec 2017-04-09 03:24:23 +03:00
ZyX
65fb622000 functests: Replace execute with either command or feed_command
Hope this will make people using feed_command less likely: this hides bugs.
Already found at least two:

1. msgpackparse() will show internal error: hash_add() in case of duplicate
   keys, though it will still work correctly. Currently silenced.
2. ttimeoutlen was spelled incorrectly, resulting in option not being set when
   expected. Test was still functioning somehow though. Currently fixed.
2017-04-09 03:24:08 +03: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
e348e256f3 'guicursor': Disable by default for unknown terminals.
User can still set guicursor explicitly in init.vim.

Closes #5990
Closes #6403
2017-04-04 14:19:26 +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
Yichao Zhou
bc6d868d00 'listchars': Whitespace highlight group #6367 2017-04-03 14:10:40 +02:00
ZyX
dc75766081 tests: Fix testlint errors 2017-04-03 03:07:01 +03: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
Yichao Zhou
43a99f77a8 highlight: :match should override 'list' (#6343)
Closes #4946
2017-03-26 13:04:20 +02:00
Justin M. Keyes
a90beeadbb defaults: 'showcmd', 'belloff', 'ruler'
- Vim "unix default" of 'noshowcmd' is serving few users. And it's
  inconsistent.
- 'ruler' and 'belloff=all' improve the out-of-the-box experience.
- Continue to use 'noshowcmd' and 'noruler' by default in the functional
  tests to keep them fast.

TODO: Add a "disable slow stuff" command or mapping to address the
use-case of a very slow terminal connection.
2017-03-16 18:44:10 +01:00
James McCoy
7217360e34 vim-patch:7.4.2051
Problem:    No proper testing of trunc_string().
Solution:   Add a unittest for message.c.

502ae4ba63
2017-03-06 15:09:40 -05:00
Justin M. Keyes
937e54f865 terminal: Keep cursor position.
Let the terminal dictate the normal-mode cursor position. This will be
disorienting sometimes, but it is closer to what users expect vs always
going to the last line.
2017-03-01 14:47:49 +01:00
Matthew Malcomson
d25649fa01 undo: :earlier, g-: Set b_u_seq_cur correctly. (#6016)
Previously alternate branches were not accounted for properly, with this
change g- after an undo to a branch point works.

The current sequence number b_u_seq_cur is used in undo_time(), in
u_doit() this was calculated by subtracting one from the curhead
sequence number.

The curhead header entry represents the change that was just undone, so
the sequence number we want is that of the change we have moved to. This
is the sequence number of the undo head that is the uh_next element of
this curhead. That sequence number is not always one less than the
curhead sequence number -- there may have been an alternate branch at
this point.

Instead of subtracting one, we now directly find the sequence number of
curhead->uh_next.
2017-01-31 05:46:55 +01:00
Justin M. Keyes
25427ae892 test: Fix broken test. 2017-01-24 14:25:50 +01:00
Justin M. Keyes
a3a241d313 ci: XXX: Disable "throttle" test on Travis macOS. 2017-01-23 22:17:16 +01: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
Justin M. Keyes
3a574af3c4 ci: Disable "CTRL-C interrupts :global" test
This test is low-value, high-cost. It's slow, and sometimes crashes
luajit. It's still enabled on local runs, that's good enough.
2017-01-19 14:22:01 +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
e2b031a342 test: screen_basic: Re-enable min width/height test 2017-01-18 11:24:39 -05: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
James McCoy
f2dff86493
inccommand: Preview :sub commands only after the delimiter is present
Closes #5888
2017-01-11 21:05:02 -05:00
James McCoy
dcd77c64ef
inccommand: Suppress error reporting when previewing commands
Closes #5912
2017-01-11 21:05:02 -05:00
Justin M. Keyes
e03b43bd07 test: skip_fragile(), TEST_SKIP_FRAGILE
Let build systems define TEST_SKIP_FRAGILE to skip tests that are known to be
resource-intensive (unreliable on slow systems).

References https://github.com/neovim/neovim/pull/5488#issuecomment-265622113
2017-01-04 04:24:18 +01:00
Justin M. Keyes
cb58999007 os/shell: do_os_system(): Always show last chunk.
This ameliorates use-cases like:
    :!cat foo.txt
    :make
where the user is interested in the last few lines of output.

Try these shell-based ex-commands before/after this commit:
    :grep -r '' *
    :make
    :!yes
    :!grep -r '' *
    :!git grep ''
    :!cat foo
    :!echo foo
    :!while true; do date; done
    :!for i in `seq 1 20000`; do echo XXXXXXXXXX $i; done

In all cases the last few lines of the command should always be shown,
regardless of where throttling was triggered.
2016-12-10 01:26:34 +01: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
Justin M. Keyes
a1b0f594ea test: Disable unreliable tests on travis+ASAN_UBSAN 2016-12-07 17:22:23 +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
Justin M. Keyes
44e6ee930f build: Target luacheck HEAD.
https://github.com/mpeterv/luacheck/pull/81#issuecomment-261099606

> If you really want to use bleeding-edge version you should get the
> rockspec from master branch, not a fixed commit ...
> The correct way to install from a specific commit is cloning that
> commit and running "luarocks make" from project directory. The reason
> is that running "install" or "build" on an scm rockspec fetches
> sources from master but uses build description from the rockspec
> itself, which may be outdated.
2016-11-17 00:55:39 +01:00
Justin M. Keyes
35231312d7 'inccommand': Add tests. 2016-11-15 05:01:25 +01:00
Justin M. Keyes
708617ebb6 inccommand=nosplit: Jump to first match.
Call update_topline() to adjust the current viewport.

Closes #5597
2016-11-15 04:22:24 +01:00
Justin M. Keyes
ae9a3d3b99 'inccommand': Simplify cursor placement logic.
Remove the inner for-loop; just use the column of the first in-line
match.
2016-11-11 05:45:06 +01:00
Justin M. Keyes
795f2bb9b9 'inccommand': Restore cursor/view if cancelled.
Restore cursor position and window "view", if command is cancelled.
This is how 'incsearch' works.
2016-11-10 18:09:48 +01:00
Justin M. Keyes
2e1217da46 'inccommand': buftype=nofile, restore cursor/view
- Use a standard scratch buffer instead of a new 'buftype', functions
  like curbufIsChanged() already have special handling for scratch bufs.
- Cleanup some stuff from the previous merge.
- Add support for :smagic, :snomagic. Closes #5578
2016-11-10 15:48:00 +01:00
Justin M. Keyes
aa0e09d251 'inccommand': Preserve curbuf->b_u_newhead.
Add tests for undotree().

Helped-by: Björn Linse <bjorn.linse@gmail.com>

When "curhead" points to a valid head, the value of "newhead" is
meaningless (and really should be set to null). The undo state for
a buffer is _logically_ the enum:

  enum UndoState {
    CurrentHead(head),
    NewHead(head),
    EmptyTree
  }

nvim _represents_ this as: whenever `curbuf->b_u_curhead` is nonnull it
should be used as the current head, and `curbuf->b_u_newhead` is
ignored. If the there is a current head, then this will be redoed on the
next redo, and its parent will be undone on next undo. Only if
`b_u_curhead` is NULL, `b_u_newhead` will be used as the head to undo
(and it is not possible to redo). Also both can be NULL, to indicate an
empty undotree. (To be fair, this only strictly true when calling undo.c
from the outside, in some places _within_ a function in undo.c both
values might be meaningful)

Apparently `undotree()` breaks this non-abstraction, this _cosmetic_
issue can easily be fixed by `ex_substitute` also saving and restoring
`b_u_newhead`, but is doesn't reflect any error really how
`u_undo_and_forget` manipulates the _actual_ state of the undo tree.
2016-11-09 01:03:47 +01:00
Justin M. Keyes
f3e8ca3bf5 'inccommand': preserve 'modified'
During the live preview, the buffer-local 'modified' flag
should not be changed.
2016-11-08 21:22:24 +01:00
Justin M. Keyes
ff6ec703d5 'inccommand': Do not trigger during scripts, feedkeys(). 2016-11-08 21:22:24 +01:00
KillTheMule
527ba2b12a 'inccommand': test: scripts/feedkeys() should not trigger preview 2016-11-08 21:22:24 +01:00
Justin M. Keyes
6a3f8d48d0 'inccommand': rename 'incsubstitute'
'inccommand' allows us to expand the feature to other commands, such as:
    :cdo
    :cfdo
    :global

Also rename "IncSubstitute" highlight group to "Substitute".
2016-11-08 21:22:13 +01:00
Justin M. Keyes
1e0e301062 'inccommand': format line numbers as "|123| "
This matches what Quickfix traditionally does.
2016-11-08 21:21:46 +01:00
Justin M. Keyes
3ccf69c1de 'inccommand': set buffer name to [Preview]
[inc_sub] is less obvious for users. Also, in the future we may want to
generalize the idea of a "preview buffer", or "incremental commands"
besides :substitute.
2016-11-08 21:21:46 +01:00
Justin M. Keyes
d0689eb0b2 'inccommand': disable 'cursorline', 'spell' in preview 2016-11-08 21:21:43 +01:00
Justin M. Keyes
e31f9007e4 'inccommand': preserve b:changedtick 2016-11-08 21:21:00 +01:00
Justin M. Keyes
c04ffe866d 'inccommand': rework
- Eliminate/isolate static/global variables
- Remove special-case parameter from buflist_new()
- Remove special-case ECMD_RESERVED_BUFNR
- To determine when u_undo_and_forget() should be done, check
  b_changedtick instead of a heuristic.
- use mb_string2cells() instead of strlen() to measure the :sub patterns
- call ml_close() before buf_clear_file(). Avoids leaks caught by ASan.

Original patch by:
  Robin Elrharbi-Fleury (Robinhola)
  Audrey Rayé (Adrey06)
  Philémon Hullot (DesbyP)
  Aymeric Collange (aym7)
  Clément Guyomard (Clement0)
2016-11-08 21:20:08 +01:00
KillTheMule
561c1e39e0 Tests for incsubstitution feature 2016-10-30 10:52:05 +01:00
Justin M. Keyes
dc6cc4787c api: Establish API naming convention. (#5344)
old name:                   new name:
  --------------------------------------------------
  nvim_name_to_color          nvim_get_color_by_name
  nvim_get_current_buffer     nvim_get_current_buf
  nvim_get_current_window     nvim_get_current_win
  nvim_get_buffers            nvim_list_bufs
  nvim_get_tabpages           nvim_list_tabpages
  nvim_get_windows            nvim_list_wins
  nvim_set_current_buffer     nvim_set_current_buf
  nvim_set_current_window     nvim_set_current_win
  nvim_change_directory       nvim_set_current_dir
  nvim_tabpage_get_window     nvim_tabpage_get_win
  nvim_tabpage_get_windows    nvim_tabpage_list_wins
  nvim_win_get_buffer         nvim_win_get_buf
  nvim_report_error           nvim_err_writeln

Helped-by: Björn Linse <bjorn.linse@gmail.com>
Helped-by: ZyX <kp-pav@yandex.ru>
Helped-by: James McCoy <jamessan@jamessan.com>
2016-09-17 06:30:36 +02:00
James McCoy
c28fb221ba
Restore output_spec assertion dropped in f332eba 2016-09-14 20:59:09 -04:00
James McCoy
df99e43ba4
tests/ui: Stop the terminal job after testing
When running the tests in a contained environment, the lingering
terminal processes prevent the unmounting of the filesystems in the
contained environment.
2016-09-14 20:56:47 -04:00
Justin M. Keyes
ac819b8994 CI: Travis macOS: Skip tab left-drag tests.
These tests fail on master, so it's not a regression. Changes in #4874
(parent commit) seem to work (and pass most CI), so skipping these tests
is better than blocking the changes.
2016-09-12 03:42:51 +02:00
sach1t
c6f5d6b7e0 normal.c: Restore vim-like tab dragging. #4874
Closes #4663
References #3310
2016-09-12 03:11:26 +02:00
Björn Linse
0ade1bb706 Merge pull request #5225 from equalsraf/windows-functionaltests
Enable functional tests in Appveyor
2016-08-31 21:39:42 +02: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
Rui Abreu Ferreira
39c628d031 Mark some functional tests as pending in Windows 2016-08-26 08:21:41 +01:00
Tommy Allen
605e74327a highlight: Added QuickFixLine highlight group
- Links to Search by default

screen.c: Combine CursorLine with QuickFixLine

- HLF_QFL takes priority over HLF_CUL

docs: Updated to mention QuickFixLine
runtime: Added QuickFixLine to nvimHLGroup
tests: QuickFixLine highlight
2016-08-17 17:48:15 -04:00
Björn Linse
57ac9b0934 api: handle null string in buffer_add_highlight 2016-08-17 09:34:01 +02:00
Björn Linse
725074aafc tests: add note to expect() message about snapshot_util() 2016-08-14 21:53:02 +02:00
Björn Linse
f332eba16c tests: don't ignore highlights in terminal tests 2016-08-14 21:53:02 +02:00
Björn Linse
f282b8ecac tests: don't ignore highlights in various tests 2016-08-14 21:53:02 +02:00
Björn Linse
0a882b4818 tests: don't ignore highlights in screen_basic_spec 2016-08-14 21:53:02 +02:00
Björn Linse
82b434dd51 tests: don't ignore highlights in mouse_spec 2016-08-14 21:53:02 +02:00
Björn Linse
a63f770bcb tests: don't ignore highlights in syntax_conceal_spec 2016-08-14 21:53:02 +02:00
Björn Linse
cc657951a9 tests: don't ignore highlights in highlight_spec 2016-08-14 21:53:02 +02:00
Björn Linse
7b29fdd200 tests: don't ignore highlights in searchhl_spec 2016-08-14 21:53:02 +02:00
Björn Linse
35b47890dd tests: don't ignore highlights in bufhl_spec 2016-08-14 21:53:02 +02:00
Björn Linse
9c4a94f964 tests: remove deprecated hl_colors 2016-08-14 21:53:02 +02:00
Justin M. Keyes
d69194ca8c test: mouse_spec
- Use the default buffer text provided by before_each (avoids extra steps and
  makes the tests more consistent with each other)
- Indent
- Adjust help doc
2016-08-07 23:50:40 -04:00
sach1t
08a5f91481 test: Add tests for double, triple, and quadruple click 2016-08-07 13:21:03 -04:00
Tommy Allen
1f7304b846 mouse.c: Adjust clicked column if chars are concealed (#5087)
syntax.c: Added syn_get_concealed_id()

tests: Added tests for mouse clicks on concealed text.
2016-07-28 14:14:53 -04:00
Justin M. Keyes
ed3b3aa9cd test: output_spec
Reference: https://github.com/neovim/neovim/issues/3772#issuecomment-162334005
2016-07-14 23:28:23 -04:00
Justin M. Keyes
abeb2f020f test/highlight_spec: Test "gui" arg of synIDattr().
Also use less "regular" values for cterm colors.
2016-06-18 13:07:59 -04:00
ZyX
ff470bb853 functests: Check logs in lua code
It is otherwise impossible to determine which test failed sanitizer/valgrind
check. test/functional/helpers.lua module return was changed so that tests which
do not provide after_each function to get new check will automatically fail.
2016-06-10 21:50:49 +03:00
Björn Linse
5cc87d4dab cmdline: Redraw the cmdline after processing events
vim-patch:7.4.1603

TODO(bfredl): if we allow events in HITRETURN and ASKMORE states,
we need to add the necessary redraws as well.
2016-05-24 22:11:37 +02:00
AdnoC
582fb03f51 test/syntax: foo=NONE clears hi group 2016-05-21 01:19:39 -04:00
Yichao Zhou
723497f030 test: listchars 2016-05-20 04:04:49 -04:00
Yichao Zhou
f598bb7b3c test: cursorline, listchars 2016-05-20 04:04:48 -04:00
Yichao Zhou
9dc08dd692 test: Update to meet new expectations. 2016-05-20 03:54:21 -04:00
Justin M. Keyes
74f6460181 Merge #4633: support "special" highlight (undercurl)
Closes #2040
Closes #3370
2016-05-19 22:20:52 -04:00
AdnoC
e5eea7fa06 test: Screen also checks 'special' when testing attribute equality 2016-05-17 16:36:41 -04:00
AdnoC
724fc88597 test: Edit the special color test 2016-05-17 16:36:38 -04:00
KillTheMule
a5ac389e5c test: Add a test for the new guisp highlighting feature.
Screen.lua needed a little cosmetical adjustment to print out the color nicely.
2016-05-17 16:32:07 -04:00
AdnoC
f6a82c1d4f test: Fix tests failing 2016-05-17 16:31:56 -04:00
AdnoC
130a1a6bb2 test/syntax: Add testing for linking to cleared highlight groups 2016-05-10 16:08:57 -04:00
Justin M. Keyes
22ea7be77b Merge pull request #4540 from KillTheMule/vim-patch-1236
vim-patch: 7.4.1236
2016-05-04 22:03:37 -04:00
KillTheMule
11f41a3c8c Add test for vim-patch 7.4.672 2016-05-02 21:10:53 +02:00
pips.linux
ee4d1f2cce vim-patch:7.4.1236
Problem:    When "syntax manual" was used switching between buffers removes
            the highlighting.
Solution:   Set the syntax option without changing the value. (Anton
            Lindqvist)

885f24fbca

Patch applied cleanly to the nvim sources except for version.c.
2016-04-28 21:11:03 +02:00
bambu
5a5ef1c222 mouse: Implement horizontal scroll. #3450
- Code from Vim source.
- Removed the check for 'guioptions'
- mouse_spec.lua: test <ScrollWheelLeft> and <ScrollWheelRight>
- Move horizontal scroll logic to mouse.c
- Remove 'gui_' from the function names
- Renamed variables to be more specific (as opposed to generic p, w).
- Marked some functions as `static`
2016-04-25 01:31:44 -04:00
Thiago de Arruda
c18d5917e3 Update lua client to 0.0.1-24
The new version of the lua client uses libmpack as a backend, and some test
scripts had to be updated to reflect that.
2016-04-13 09:21:32 -03:00
Marco Hinz
88da85a3cd Tests: fix according to lualint 2016-02-29 13:48:59 +01:00
ZyX
0409cfded5 functests: Improve screen:expect error reporting 2016-02-28 08:15:52 +03:00
Marco Hinz
9a3b7fa906 Tests: fix according to lualint 2016-02-24 01:42:38 +01:00
Björn Linse
06b9d2a6f2 bufhl: add tests for adding and clearing highlights 2016-02-23 21:29:01 +01:00
Justin M. Keyes
99d4c8c29c keymap: Support <D-...> (super/command key).
Adds support for:
  - api:vim_input("<D-a>")
  - ":nnoremap <C-D-S-...>" and permutations thereof

UIs must capture the modifier and send it as "<D-...>" to vim_input().

Note: Before this commit, any arbitrary ":nnoremap <{foo}-{bar}>"
mapping could already be invoked with feedkeys("\<{foo}-{bar}>"). This
commit supports "D-" as a modifier that can be combined with "C-", "A-",
"S-" in any order.

For non-GUI (terminal) support, user must:
  :set <D-a>={CSI sequence}
then send the {CSI sequence} from their terminal. But this does not work
yet (regression #2204).

Closes #2190
2016-02-22 02:41:40 -05:00
Justin M. Keyes
79a6983c0c ui: revert "gui_running" hack
Plugins (YCM, dispatch.vim) use gui_running to decide behavior; so do
some colorschemes. Up to now, nvim lied about gui_running for the
benefit of colorschemes and the detriment of all _other_ plugins that
check this condition. That's counterproductive: a user employs at most
_one_ colorscheme but may use many other plugins which expect the Vim
legacy semantics of gui_running.

Moreover, colorschemes usually don't _need_ to check gui_running: they
can instead set cterm{fg,bg} and gui{fg,bg} in the same :highlight call.

It is reasonable for users who want "true color" to modify their
colorscheme once (or request upstream to do so) in order to avoid
running into quirks in any other plugins.

Closes #2782
2016-02-03 01:21:59 -05:00
ZyX
ad5cb87d7a eval: Add +tablineat feature 2016-02-01 21:40:46 +03:00
ZyX
3f314d40be functests: Improve tabline click tests 2016-02-01 21:40:46 +03:00
Jurica Bradaric
a118abca77 Add eol to listchars for mouse specification tests
This is consistent with VIM behavior. When showing a visual selection,
VIM only extends it past the last character if eol is in listchars (even
if nolist is set).
2016-01-19 08:47:49 +01:00
Justin M. Keyes
22a928aeac test: change CI_TARGET reference to CI
Travis defines[1] $CI for its builds, whereas $CI_TARGET is
a Neovim-specific env var from 6483a198e4
that lost prominence in d2eb4a9346.

[1] https://docs.travis-ci.com/user/environment-variables/
2016-01-01 23:58:42 -05:00
Marco Hinz
d9fbc1865b test/functional: clean up according to luacheck (part 2) 2015-11-23 13:57:21 +01:00
Marco Hinz
4a69e55f39 test/functional: clean up according to luacheck (part 1) 2015-11-23 13:57:21 +01:00
ZyX
ec1ca54d59 functests: Do not forget about -i argument
Target: make all tests run with chmod -x ~/.config/nvim ~/.local/share/nvim.
2015-10-23 15:56:51 +03:00
Thiago de Arruda
5d185c7772 test: Add basic tests for the TUI
The tests use `termopen` to spawn nvim and verify the TUI.
2015-10-01 15:22:49 -03:00
Thiago de Arruda
1143b416ab tui: Don't use 'pastetoggle' for automatic pasting
Add a new special key that can be used by UIs to toggle the 'paste' option and
use it in the TUI instead of the user's 'pastetoggle' value.

Close #2843 #2092
2015-10-01 15:22:48 -03:00
John Szakmeister
625f8ec07f Disable a broken functional test.
No one has taken a real interest in fixing this, so let's disable it for
now.  The issue crops up most on the QB OS X node, but it has
periodically occurred under other nodes too.
2015-10-01 07:01:13 -04:00
Björn Linse
c8aaabc09c api: vim_err_write: add tests for multiline handling 2015-09-16 21:42:57 +02:00
Felipe Morales
45121a267f defaults: set 'laststatus' to 2. #2876 2015-08-24 00:48:32 -04:00
Felipe Morales
be29de1fa2 defaults: set 'listchars' to "tab:> ,trail:-,nbsp:+". #2872
Re: https://github.com/neovim/neovim/issues/2676
2015-08-22 13:48:48 -04:00
Robin Allen
d5b5063622 Notify attached UIs whenever menus change
This adds a redraw notification "update_menu" which is sent whenever
Vim's menus are changed by the :menu command and friends.
2015-08-21 14:23:50 +01:00
Omar Sandoval
f79025b9de tui: Use underline cursor in Replace mode
This is a port of my original contribution to Vim, added in 7.4.687
(https://github.com/vim/vim/commit/v7-4-687). The TUI code has been
heavily refactored (see esp. 25ceadab37),
so this required some translation, but the logic is the same.
2015-07-26 23:45:41 -04:00
Omar Sandoval
fa48fc667a api: Simplify UI API on mode change
Currently, there are two functions in the UI API that are called when
the mode changes: insert_mode() and normal_mode(). These can be folded
into a single mode_change() entrypoint which can do whatever it wants
based on the mode it is passed, limited to INSERT and NORMAL for now.
2015-07-26 23:38:35 -04:00
Björn Linse
7a6bf3f418 Add ui test for default title (with/without filename) #3091 2015-07-23 22:35:42 +02:00
Thiago de Arruda
e85c9966b8 test: Increase determinism in screen_basic_spec tests 2015-07-16 23:08:09 -03:00
Lucas Hoffmann
7e7d78b2a6 doc: Fix some typos and trailing whitespace. #2875 2015-06-21 00:34:51 -04:00
Justin M. Keyes
9ebb5c681b defaults: enable 'hlsearch' by default. #2859
Also update the documentation regarding the option.

Re: https://github.com/neovim/neovim/issues/2676
2015-06-20 16:40:03 -04:00
Felipe Morales
b90378dfb0 options: Enable &wildmenu, use "list:longest,full" for &wildmode by default #2677 2015-05-17 15:24:31 -04:00
Clinton McKay
89d0e23624 test/ui: Add concealing tests. #2055 2015-05-09 17:21:54 +02:00
Michael Reed
98b3dc0571 vim-patch:7.4.659 + test
Problem:    When 'ruler' is set the preferred column is reset. (Issue 339)
Solution:   Don't set curswant when redrawing the status lines.

https://code.google.com/p/vim/source/detail?r=v7-4-659

Helped-by: David Bürgin <676c7473@gmail.com>
Based on #2347 by @pvinis
2015-05-01 16:45:02 -04:00
Marco Hinz
6fb66f4416 UI test: visual selection after left click in tabline 2015-04-28 14:16:37 +02:00
Marco Hinz
6449921943 UI test: left click in tabline 2015-04-28 14:16:37 +02:00
David Bürgin
af863d46a9 vim-patch:7.4.532 #2504
Problem:    When using 'incsearch' "2/pattern/e" highlights the first match.
Solution:   Move the code to set extra_col inside the loop for count.  (Ozaki
            Kiichi)

https://github.com/vim/vim/releases/tag/v7-4-532
2015-04-27 01:46:43 -04:00
Thiago de Arruda
3a20a9847e test/ui: Fix indeterminism in screen_basic_spec 2015-04-03 09:05:04 -03:00
Björn Linse
1e7624d2a0 tests/ui: warn when the correct state was seen temporarily.
Helped-by: Thiago de Arruda <tpadilha84@gmail.com>
2015-04-03 09:05:04 -03:00
Björn Linse
e5c4c4bca2 test/ui: add redraw debug util 2015-04-03 09:05:04 -03:00
Thiago de Arruda
2aa2513b8e test: Add terminal tests
- Modify tty-test to allow easier control over the terminal
- Add a new directory with various terminal tests/specifications
- Remove a pending job/pty test.
- Flush stdout in Screen:snapshot_util() (avoid waiting for the test to finish)
- Replace libuv sigwinch watcher by a sigaction handler. libuv randomly fails to
  deliver signals on OSX. Might be related to the problem fixed by
  @bbcddc55ee1e5605657592644be0102ed3a5f104 (under the hoods, libuv uses a pipe
  to deliver signals to the main thread, which might be blocking in some
  situations)
2015-03-25 18:57:36 -03:00
Thiago de Arruda
47e90ea1c5 test: Extract code to spawn nvim into the "spawn" helper function
This is can be used for spawning nvim outside a test context. Also refactor
screen.lua to use this function when loading the color map(It is better because
the GDB/VALGRIND environment variables are ignored)
2015-03-24 12:46:15 -03:00
Björn Linse
cf88f33eec tests/ui: cleanup ignores in screen_basic_spec 2015-03-19 23:09:56 +01:00
Björn Linse
93d01bf12e tests/ui: test hlsearch and incsearch 2015-03-19 23:09:56 +01:00
Thiago de Arruda
8b7b71f474 ui: Refactor so that busy state won't be the default
Even though assuming nvim is busy most times is simpler, it has a problem: A lot
of unnecessary busy_start/busy_stop notifications are sent to the UI. That's
because in the majority of scenarios almost no time is spent between
`event_poll` calls.

This restores the normal behavior which is to call busy_start only when nvim is
going to perform some task that can take a significant amount of time. Also
improve the usage of buffering in the TUI when changing the cursor state.
2015-03-18 14:16:23 -03:00
Thiago de Arruda
5199456471 test: Only display cursor marker in screen tests if nvim is not busy 2015-03-16 08:29:57 -03:00
Thiago de Arruda
c546875daf ui: Replace cursor_{on,off} by busy_{stop,start}
Switching cursor off is only necessary in two occasions:

- When redrawing to avoid terminal flickering
- When the editor is busy

The first can now be handled by the TUI, so most calls to ui_cursor_off can be
removed from the core.

So, before this commit it was only necessary to switch the cursor off to notify
the user that nvim was running some long operation. Now the cursor_{on,off}
functions have been replaced by busy_{stop,start} which can be handled in a
UI-specific way(turning the cursor off or showing a busy indicator, for
example).

To make things even more simpler, nvim is always busy except when waiting for
user input or other asynchronous events: It automatically switches to a non-busy
state when the event loop is about to be entered for more than 100 milliseconds.

`ui_busy_start` can be called when its not desired to change the busy state in
the event loop (As its now done by functions that perform blocking shell
invocations).
2015-03-15 10:30:59 -03:00