| Commit message (Collapse) | Author | Age |
... | |
|
|
|
| |
References #3042
|
|
|
|
|
|
|
|
|
|
| |
Add xstrlcat function.
Closes #3042
References #988
References #1069
coverity: 71530, 71531, 71532
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Abuse NOTDONE to give some nuance to the return value of readfile(), so
that open_buffer() can distinguish between "failed, lol" and "failed
because the path is a directory".
Before this change, Vim *already* creates a new buffer when a directory
is edited. So there is no reason it should not raise BufEnter, that was
an implementation detail of ye olde readfile().
Most of the changes in this commit merely preserve the old semantics.
The "implicit" change that we actually are interested in, is this line
in `open_buffer()`, where `retval` being non-FAIL allows EVENT_BUFENTER
to be applied:
apply_autocmds_retval(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf, &retval);
References https://github.com/vim/vim/issues/1353
|
|
|
|
| |
Closes #5912
|
|
|
|
|
|
|
|
|
|
| |
Problem: When a file gets a name when writing it 'acd' is not effective.
(Dan Church)
Solution: Invoke DO_AUTOCHDIR after writing the file. (Allen Haim, closes
vim/vim#777, closes vim/vim#803) Add test_autochdir() to enable 'acd' before
"starting" is reset.
https://github.com/vim/vim/commit/5c71994f4ee5f87d4cce990dbc9684c70b1e108b
|
|\
| |
| | |
vim-patch:7.4.2183,7.4.2194,7.4.2201,7.4.2204,0952131,7.4.2215,7.4.2225,7.4.2226,7.4.2272,7.4.2273,7.4.2277,7.4.2294
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Problem: Crash when placing a sign in a deleted buffer.
Solution: Check for missing buffer name. (Dominique Pelle). Add a test.
https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
|
|/
|
|
|
|
|
|
| |
Problem: Using ":insert" in an empty buffer sets the jump mark. (Ingo
Karkat)
Solution: Don't adjust marks when replacing the empty line in an empty
buffer. (closes vim/vim#892)
https://github.com/vim/vim/commit/70e136e1d86ea1d795774824c7b712245912946d
|
|
|
|
|
|
|
| |
Command "live preview" is fundamentally a non-recursive concept
("preview of a preview" is not useful). Maintaining this as a
global is less awkward and closer to what we actually want to
express, vs adorning exarg_T, CommandLineState, etc.
|
|
|
|
|
|
| |
Call update_topline() to adjust the current viewport.
Closes #5597
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
command_line_changed:
- Check (current_SID == 0) instead of KeyTyped
- We want to update during mappings (KeyTyped is false then).
- Check vpeekc_any()
- Avoids unnecessary work.
- Avoids triggering live preview during macros.
- Caveat: This makes the redraw "stutter" if user spams (holds a key)
in the replace pattern. But that scenario is not important.
- Update screen if the command is changed to a non-live command.
(`s->live` goes from true => false) => clears the preview
command_line_execute:
- Let CTRL-C cancel live preview
do_sub:
- Enforce a time limit ('redrawtime').
- Unset 'inccommand' if time limit is reached.
Closes #5602
Closes #5585
|
|
|
|
|
| |
Remove the inner for-loop; just use the column of the first in-line
match.
|
|
|
|
|
|
|
| |
- 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
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Initial work by:
Robin Elrharbi-Fleury (Robinhola)
Audrey Rayé (Adrey06)
Philémon Hullot (DesbyP)
Aymeric Collange (aym7)
Clément Guyomard (Clement0)
Major revisions by:
KillTheMule
Björn Linse <bjorn.linse@gmail.com>
Justin M. Keyes <justinkz@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| | |
- Don't fill matched_lines if not showing a preview (!eap->is_live).
- Encapsulate: Move cursor placement logic to show_sub().
|
| |
| |
| |
| |
| | |
During the live preview, the buffer-local 'modified' flag
should not be changed.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
'inccommand' allows us to expand the feature to other commands, such as:
:cdo
:cfdo
:global
Also rename "IncSubstitute" highlight group to "Substitute".
|
| |
| |
| |
| | |
This matches what Quickfix traditionally does.
|
| |
| |
| |
| |
| |
| | |
[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.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- 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)
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Originally implemented by
* Clement0
* DesbyP
* aym7
* Adrey06
* Robinhola
in #4811. Major reworkings and bug
fixes by
* bfredl
Most tests suggested by ZyX-l, suggestions for improvements by oni-link.
|
| | |
|
|/
|
|
|
| |
Problem: If CTRL-C is mapped, it does not interrupt :global output.
Solution: clear `mapped_ctrl_c` during :global.
|
|\
| |
| |
| | |
Closes #5246
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Crash when autocommand moves to another tab. (Dominique Pelle)
Solution: When navigating to another window halfway the :edit command go
back to the right window.
https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
|
|/
|
|
|
|
| |
Problem: Memory leak when saving for undo fails.
Solution: Free allocated memory. (Hirohito Higashi)
https://github.com/vim/vim/commit/1e2258297bb31720bfbeb234f2dae4d1b3b04fbd
|
|
|
|
|
|
|
|
|
| |
Check `exists('b:term_title')` to avoid the BufReadCmd for already-initialized
:terminal buffers.
Move the test for `:argadd`.
Add a test for `:edit<CR>`.
Tweak comments and code style.
|
|
|
|
| |
Closes #4784
|
| |
|
|
|
|
|
|
|
|
| |
Problem: A BufAdd autocommand may cause an ml_get error (Christian
Brabandt)
Solution: Increment RedrawingDisabled earlier.
https://github.com/vim/vim/commit/ab9fc7e0cf22bcee119b62d3433cac60f405e645
|
|
|
|
|
|
|
| |
Problem: When ":doautocmd" is used modelines are used even when no
autocommands were executed. (Daniel Hahler)
Solution: Skip processing modelines. (closes vim/vim#854)
https://github.com/vim/vim/commit/1610d052413e0ed664498853a47acc2d677a22d1
|
|
|
|
|
|
| |
Problem: Using CTRL-] in the help on "{address}." doesn't work.
Solution: Recognize an item in {}. (Hirohito Higashi, closes vim/vim#814)
https://github.com/vim/vim/commit/28b942a064dd486cc241894b625ab72f5a5c6d1b
|
|
|
|
|
|
|
|
|
|
|
| |
For any script--not just `:global` commands--there is no reason to
update the system clipboard until the script is finished, so disable it
during do_cmdline().
Before this change, 'clipboard=unnamedplus' causes scripted editing to
be extremely slow (e.g. `:normal` in a while-loop).
Closes #3534
|
| |
|
|
|
|
|
|
|
|
|
| |
* sub_joining_lines: Optimization for :%s/\n//
* sub_grow_buf: Allocation of buffer to contain replacement text
* sub_parse_flags: Parse {flags} from :s command into subflags_T
Although this doesn't reduce do_sub's size enough to satisfy lint, it
covers the more straightforward pieces.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Recursive call to substitute gets stuck in sandbox. (Nikolai
Pavlov)
Solution: Handle the recursive call. (Christian Brabandt, closes vim/vim#950)
Add a test.
https://github.com/vim/vim/commit/f5a39447a8ebe162ee62caa2ee502cd0e65eecaa
Closes #5118
|
| |
|
| |
|
|
|
|
|
|
|
| |
Problem: Cannot generate help tags in all doc directories.
Solution: Make ":helptags ALL" work.
https://github.com/vim/vim/commit/6bef5306e4f2cacb3a93667992c2312d4b293c9d
|
|
|
|
| |
Because the old name did not indicate that the function
would return true on directories as well.
|