| Commit message (Collapse) | Author | Age |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Fixes Lua error:
> function at line 543 has more than 60 upvalues
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Note some bugs were judged to have too ugly a fix to solve, tests to
demonstrate these problems, and the explanation behind not fixing them
are below.
describe('register . problems', function()
before_each(reset)
-- The difficulty here is: The basic requirement is that the text
-- inserted is treated as if it were typed in insert mode. This is why
-- the paste method is to enter insert mode and enter the ". register
-- into readbuf1.
-- We can't add a count into the readbuf here because the insert mode
-- count is implemented with readbuf2 which is checked for characters
-- after readbuf1.
-- Hence, the ".gp command (which adds extra characters into readbuf1
-- to emulate leaving the cursor after the text by moving the cursor
-- after inserting the text) would insert the motion characters into
-- the buffer instead of using them to move after the insert has been
-- done.
-- I could probably get this working properly with a special flag put
-- into start_redo_ins() and set in do_put(), but I think this adds
-- much more complexity than fixing this bug justifies.
pending('should not change the ". register with ".2p', function()
local orig_register = funcs.getreg('.')
feed('2".p')
eq(orig_register, funcs.getreg('.'))
end)
describe("cursor positioning after undo and redo with '.'", function()
before_each(reset)
local function make_cursor_test(macro_string)
return function()
feed(macro_string)
local afterpos = funcs.getcurpos()
local orig_string = curbuf_contents()
feed('u.')
eq(afterpos, funcs.getcurpos())
expect(orig_string)
end
end
-- The difficulty here is: setting the cursor after the end of the
-- pasted text is done by adding a motion command to the
-- stuffbuffer after the insert.
-- Modifying 'redobuff' is done in the code that handles inserting
-- text and moving around.
-- I could add a special case in ins_esc() that checks for a flag
-- set in do_put() to add the motion character to the redo buffer,
-- but I think that is starting to get way too convoluted for the
-- benefit.
pending('should be the same after ".gp and ".gpu.',
make_cursor_test('".gp'))
-- The difficulty here is: putting forwards is implemented by using
-- 'a' instead of 'i' to start insert.
-- Undoing with 'u' an insert that began with 'a' leaves the cursor
-- where the first character was inserted, not where the cursor was
-- when the 'a' was pressed.
-- We account for this the first time by saving the cursor position
-- in do_put(), but this isn't stored in redobuff for a second time
-- around.
-- We can't change how such a fundamental action as undo after
-- inserting with 'a' behaves, we could add in a special case
-- whereby we set a flag in do_put() and read it when entering
-- insert mode but this seems like way too much to fix such a minor
-- bug.
pending('should be the same after ".pu. and ".pu.u.',
make_cursor_test('".pu.'))
end)
end)
|
|/
|
|
|
|
|
|
|
|
| |
- Default to powershell.
- Avoid hardcoded "-c".
- Remove ^M character from received lines.
- pending_win32(): clear() is unnecessary and it pollutes the tests.
Closes #3973
Helped-by: Rui Abreu Ferreira <raf-ep@gmx.com>
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
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
|
|\ \ |
|
| |/
| |
| |
| |
| |
| | |
On Windows, if the nvim process has a directory open the lua process
cannot remove it. After failing once, it's safe to force `nvim` to the
top-level directory. Then try again.
|
|/
|
|
|
|
|
|
|
|
| |
Works by saving all preprocessor defines and reusing them on each run. This also
saves NVIM_HEADER_H defines. Saving other defines is needed for defines like
`Map(foo, bar)` which are sometimes used to declare types or functions. Saving
types or function declarations is not needed because they are recorded as luajit
state.
Fixes #5857
|
| |
|
| |
|
|
|
|
| |
TODO: Also spec behavior of Press-Enter prompt for these API functions.
|
|
|
|
| |
Clarify behavior of v:errmsg and the Error object.
|
|
|
|
|
| |
This is an (unsuccessful) attempt to cover #4163.
It covers other behavior, so it's worth keeping.
|
|
|
|
|
|
|
|
|
| |
os.remove() fails on empty directories in non-POSIX systems.
https://github.com/keplerproject/luafilesystem/issues/4
lfs.rmdir() "usually" works, so use it instead.
Closes #5236
|
|
|
|
|
| |
Attempt to avoid "Permission denied" on Windows potentially caused by open
filepath handle in sibling process.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|\
| |
| | |
Enable functional tests in Appveyor
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In Windows Lua's os.tmpname() returns relative paths starting with \s,
prepend them with $TEMP to generate a valid path.
In OS X os.tmpname() returns paths in '/tmp' but they should be in
'/private/tmp'. We cannot use os_name() for platform detection because
some tests use tempname() before nvim is spawned, instead use one of the
following:
1. Set SYSTEM_NAME environment variable before calling the tests, it
is set from CMAKE_SYSTEM_NAME(i.e. uname -s or 'Windows')
2. Call uname -s
3. Assume windows
|
| | |
|
|/
|
|
| |
update screen.lua to use new style nvim_ui_attach
|
|
|
|
|
|
| |
- NVIM_RPLUGIN_MANIFEST
- XDG_CONFIG_HOME
- XDG_DATA_HOME
|
| |
|
| |
|
|
|
|
| |
The test hit wait_return if x or .x.swp exists in the project root directory.
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
| |
The character class %s also matches a newline in lua, that's not really what we
want here. It works in the other cases in this function, so I left them, but
the final gsub should preserve newlines.
|
|
|
|
| |
For that, make luatest ignore the preload.lua files.
|
|
|
|
|
| |
The new version of the lua client uses libmpack as a backend, and some test
scripts had to be updated to reflect that.
|
| |
|
| |
|
|
|
|
| |
`goto` is another luajit extension not compatible with 5.1.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
On Windows the default file format is DOS i.e. newlines are \r\n
instead of \n.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
- Remove unused variables.
- Do not use helpers.nvim_feed in most cases.
- Do not use helpers.nvim and helpers.nvim_eval at all.
- Add helpers.funcs and helpers.\*meths special tables. Indexing such table
creates functions which call helpers.call or helpers.nvim (and similar) with
first argument equal to table index.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some notes:
- Replaced msgpack_unpacker usage with regular xmalloc’ed buffer. Also since
msgpack_unpack_next (as well as msgpack_unpacker_next) is not ever going to
return MSGPACK_UNPACK_EXTRA_BYTES this condition was checked manually.
Function that does return this status is msgpack_unpack, but it is marked as
obsolete.
- Zero type is checked prior to main switch in shada_read_next_item because
otherwise check would be skipped.
- Zeroing entry at the start of shada_read_next_item makes it safer.
- dedent('') does not work.
- v:oldfiles list is only replaced with bang, if it is NULL or empty.
|
| |
|
|
|
|
|
|
|
| |
Setting `msg_didout` after `call_shell` is enough as it will cause
`hit_return_msg()` to print on next line.
Close #3269
|
| |
|
| |
|