| Commit message (Collapse) | Author | Age |
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Main points:
- Replace `char_u` with `char` in some cases.
- Remove `str[len] = NUL` hack in some cases when `str` may be considered
`const`.
|
|/
|
|
|
|
|
|
| |
Problem: Using submatch() in a lambda passed to substitute() is verbose.
Solution: Use a static list and pass it as an optional argument to the
function. Fix memory leak.
https://github.com/vim/vim/commit/df48fb456fb6bf63d94cad9b302ff01d8ee8d311
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Internally used commands for CTRL-Z and mouse click end up in
history. (Matthew Malcomson)
Solution: Use do_cmdline_cmd() instead of stuffing them in the readahead
buffer. (James McCoy, closes vim/vim#1395)
https://github.com/vim/vim/commit/25b0e6b701a7a8dfcb4f60e217360a5c75053d8c
Closes #5966
Closes #5967
|
|
|
|
|
|
|
|
| |
`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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
| |
Problem: "gd" hangs in some situations. (Eric Biggers)
Solution: Remove the SEARCH_START flag when looping. Add a test.
https://github.com/vim/vim/commit/23c60f21b07b04351d846e6fbf4f4abd9aa09345
|
|
|
|
|
|
|
| |
Problem: Passing cookie to a callback is clumsy.
Solution: Change function() to take arguments and return a partial.
https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
|
| |
|
|
|
|
|
|
|
|
| |
Problem: "gD" does not find match in first column of first line. (Gary
Johnson)
Solution: Accept match at the cursor.
https://github.com/vim/vim/commit/1538fc34fae3fae39773ca43f6ff52401fce61d8
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`lib/queue.h` implements a basic queue. `event/queue.c` implements
a specialized data structure on top of lib/queue.h; it is not a "normal"
queue.
Rename the specialized multi-level queue implemented in event/queue.c to
"multiqueue", to avoid confusion when reading the code.
Before this change one can eventually notice that "macros (uppercase
symbols) are for the normal queue, lowercase operations are for the
multi-level queue", but that is unnecessary friction for new developers
(or existing developers just visiting this part of the codebase).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In Vim's main_loop function, the main loop is
while (!cmdwin
#ifdef FEAT_CMDWIN
|| cmdwin_result == 0
#endif
)
{
...
#ifdef FEAT_EVAL
/*
* May perform garbage collection when waiting for a character, but
* only at the very toplevel. Otherwise we may be using a List or
* Dict internally somewhere.
* "may_garbage_collect" is reset in vgetc() which is invoked through
* do_exmode() and normal_cmd().
*/
may_garbage_collect = (!cmdwin && !noexmode);
#endif
/*
* If we're invoked as ex, do a round of ex commands.
* Otherwise, get and execute a normal mode command.
*/
if (exmode_active)
{
if (noexmode) /* End of ":global/path/visual" commands */
return;
do_exmode(exmode_active == EXMODE_VIM);
}
else
normal_cmd(&oa, TRUE);
}
cmdwin_result is set to 0 before calling main_loop to handle the cmdwin
window and gets changed when the user causes a command to execute
(either through pressing <CR> or <C-c>). This means that when the
cmdwin isn't active OR the user is still editing their command,
main_loop runs and main_loop calls normal_cmd with toplevel true as long
as exmode isn't active.
When the normal mode state was extracted in dae006a9, the conditions for
toplevel and may_garbage_collect were combined. Since toplevel was set
to always ignore cmdwin, the v:count(1) variables were no longer being
updated when a command was prefixed with a count in the cmdwin.
Closes #5404
|
|
|
|
|
| |
Fixes failing test: 045_folding_spec.lua
References #5299
|
|
|
|
|
|
|
|
|
|
| |
move `call_shell` to misc1.c
Move some fns to state.c
Move some fns to option.c
Move some fns to memline.c
Move `vim_chdir*` fns to file_search.c
Move some fns to new module, bytes.c
Move some fns to fileio.c
|
|
|
|
|
| |
Closes #4663
References #3310
|
|\
| |
| | |
Enable -Wconversion in ops.c
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: 'langmap' applies to the first character typed in Select mode.
(David Watson)
Solution: Check for SELECTMODE. (Christian Brabandt, closes #572)
Add the 'x' flag to feedkeys().
https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Current name is inappropriate for the following reasons:
1. It is often masked by local `loop` variables.
2. It cannot be searched for. There are many `loop` variables where `loop` is
some local variable. There are many cases when “loop” word is used in
a comment.
3. It is in any case bad idea to use a generic name as a name of the global
variable. Best if global has module prefix: this is why it is in `main.h`:
`main_loop` both stands for “a main loop” and “a loop defined in `main.*`”.
Since I have no idea how to list every occurrence of this variable method used
to rename it is “remove it from globals.h, try to compile, fix errors”. Thus if
some occurrence was hidden under false `#if` branch it was not replaced.
|
|
|
|
|
|
|
| |
Problem: "J" fails if there are not enough lines. (Christian Neukirchen)
Solution: Reduce the count, only fail on the last line.
https://github.com/vim/vim/commit/41e0f2f48f541eb2c8eb5620d3f1d270eb979154
|
|
|
|
|
|
|
|
| |
Problem: g-CTRL-G shows the word count, but there is no way to get the word
count in a script.
Solution: Add the wordcount() function. (Christian Brabandt)
https://github.com/vim/vim/commit/ed767a2073ef150971b0439a58e7ee582af6984e
|
|
|
|
| |
Originally there were 128 new errors, so I thought this is a good idea to fix
all of them. Of course, this commit also fixes many suppressed errors.
|
| |
|
|\
| |
| | |
vim-patch:7.4.822
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: More problems reported by coverity.
Solution: Avoid the warnings. (Christian Brabandt)
https://github.com/vim/vim/commit/cde885473099296c4837de261833f48b24caf87c
Applied manually. Files that do not exst anymore: gui.c gui_w16.c gui_w32.c
if_xcmdsrv.c os_unix.c
|
|/
|
|
|
|
|
|
|
|
| |
- 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`
|
| |
|
|\
| |
| | |
vim-patch:7.4.961
|
| |
| |
| |
| |
| |
| |
| | |
Problem: Test107 fails in some circunstances.
Solution: When using "zt", "zb" and "z=" recompute the fraction.
https://github.com/vim/vim/commit/9dc2ce398bb3456cc8f590ef0260459798b34d2a
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| | |
Problem: Dragging the current tab with the mouse doesn't work properly.
Solution: Take the current tabpage index into account. (Hirohito Higashi)
https://github.com/vim/vim/commit/4a4b821085847651b71d8ad9fab9f180635cb453
|
|\ \
| | |
| | | |
vim-patch:7.4.{818,883,977}
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Problem: Block-mode replace works characterwise instead of blockwise after
column 147. (Issue #422)
Solution: Set Visual mode. (Christian Brabandt)
https://github.com/vim/vim/commit/10ad1d90da8c464e1bf08bf23d92d4888378a8a1
|
| |/
| |
| |
| |
| |
| |
| |
| | |
Problem: 'linebreak' breaks c% if the last Visual selection was block.
(Chris Morganiser, Issue 389)
Solution: Handle Visual block mode differently. (Christian Brabandt)
https://github.com/vim/vim/commit/89c17c02cac7594c6bb85900d73b1dc70aa78306
|
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: "gv" after paste selects one character less if 'selection' is
"exclusive".
Solution: Increment the end position. (Christian Brabandt)
https://github.com/vim/vim/commit/d29c6fea94947b3f4b54fbd5a6f832a7d744bf27
|
|/
|
|
|
|
|
|
| |
Problem: ml_get error when using "p" in a Visual selection in the last
line.
Solution: Change the behavior at the last line. (Yukihiro Nakadaira)
https://github.com/vim/vim/commit/d009e8682686a56f7565e6e093a42cd0596e121f
|
|\
| |
| | |
vim-patch:7.4.732
|
| |
| |
| |
| |
| |
| |
| | |
Problem: The cursor line is not always updated for the "O" command.
Solution: Reset the VALID_CROW flag. (Christian Brabandt)
https://github.com/vim/vim/commit/d0d0fe09cf95bf88f643ec07d07939cbd41f8e63
|
|/
|
|
|
|
|
|
| |
Problem: Repeating a change in Visual mode does not work as expected.
(Urtica Dioica)
Solution: Make redo in Visual mode work better. (Christian Brabandt)
https://github.com/vim/vim/commit/31b259bf9571cae6408be3ef75d9485e24029be5
|
| |
|
|
|
|
| |
Currently untested and undocumented.
|
|
|
|
|
|
|
| |
Problem: Repeating CTRL-A doesn't work.
Solution: Call prep_redo_cmd(). (Hirohito Higashi)
https://github.com/vim/vim/commit/ef2b5036b3005f1ce15d146dce72379a9834c56d
|
|
|
|
|
|
|
|
| |
Problem: CTRL-A and CTRL-X do not work properly with blockwise visual
selection if there is a mix of Tab and spaces.
Solution: Add OP_NR_ADD and OP_NR_SUB. (Hirohito Higashi)
https://github.com/vim/vim/commit/d79e55016cf8268cee935f1ac3b5b28712d1399e
|
|
|
|
|
|
|
|
| |
Problem: Using "." to repeat CTRL-A in Visual mode increments the wrong
numbers.
Solution: Append right size to the redo buffer. (Ozaki Kiichi)
https://github.com/vim/vim/commit/e1edc1caba05c553fa60b1cf45a7670b1cfd63fe
|
|
|
|
|
|
|
| |
Problem: After CTRL-V CTRL-A mode isn't updated. (Hirohito Higashi)
Solution: Clear the command line or update the displayed command.
https://github.com/vim/vim/commit/0bbcb5c8efbfe5f1568f56b24ffd222d915916f6
|
|
|
|
|
|
|
| |
Problem: Still a few problems with CTRL-A and CTRL-X in Visual mode.
Solution: Fix the reported problems. (Christian Brabandt)
https://github.com/vim/vim/commit/5d1bc78a2b9fbe3e3112afcde7c80eb19d5989f4
|