aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds.c
Commit message (Collapse)AuthorAge
...
* Merge pull request #5613 from jamessan/vim-7.4.2183James McCoy2017-01-01
|\ | | | | 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
| * lintJames McCoy2016-12-28
| |
| * vim-patch:7.4.2225James McCoy2016-12-28
| | | | | | | | | | | | | | 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
* | vim-patch:7.4.1970 (#5850)lonerover2016-12-31
|/ | | | | | | | 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
* 'inccommand': Introduce CMDPREVIEW state.Justin M. Keyes2016-11-15
| | | | | | | 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.
* inccommand=nosplit: Jump to first match.Justin M. Keyes2016-11-15
| | | | | | Call update_topline() to adjust the current viewport. Closes #5597
* 'inccommand': Detect "non-interactive", "too slow".Justin M. Keyes2016-11-15
| | | | | | | | | | | | | | | | | | | | | 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
* 'inccommand': Simplify cursor placement logic.Justin M. Keyes2016-11-11
| | | | | Remove the inner for-loop; just use the column of the first in-line match.
* 'inccommand': buftype=nofile, restore cursor/viewJustin M. Keyes2016-11-10
| | | | | | | - 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
* Merge #5561 'inccommand'Justin M. Keyes2016-11-09
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * 'inccommand': Preserve curbuf->b_u_newhead.Justin M. Keyes2016-11-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * perf: do_sub(): avoid work, avoid screen updatesJustin M. Keyes2016-11-08
| | | | | | | | | | - Don't fill matched_lines if not showing a preview (!eap->is_live). - Encapsulate: Move cursor placement logic to show_sub().
| * 'inccommand': preserve 'modified'Justin M. Keyes2016-11-08
| | | | | | | | | | During the live preview, the buffer-local 'modified' flag should not be changed.
| * 'inccommand': rename 'incsubstitute'Justin M. Keyes2016-11-08
| | | | | | | | | | | | | | | | | | 'inccommand' allows us to expand the feature to other commands, such as: :cdo :cfdo :global Also rename "IncSubstitute" highlight group to "Substitute".
| * 'inccommand': format line numbers as "|123| "Justin M. Keyes2016-11-08
| | | | | | | | This matches what Quickfix traditionally does.
| * 'inccommand': set buffer name to [Preview]Justin M. Keyes2016-11-08
| | | | | | | | | | | | [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.
| * 'inccommand': disable 'cursorline', 'spell' in previewJustin M. Keyes2016-11-08
| |
| * 'inccommand': preserve b:changedtickJustin M. Keyes2016-11-08
| |
| * lintJustin M. Keyes2016-11-08
| |
| * 'inccommand': reworkJustin M. Keyes2016-11-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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)
| * LintedKillTheMule2016-10-30
| |
| * Incsubsitution featureKillTheMule2016-10-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | lintJustin M. Keyes2016-10-30
| |
* | ex_global: Catch CTRL-C even if it is mapped.Justin M. Keyes2016-10-30
|/ | | | | Problem: If CTRL-C is mapped, it does not interrupt :global output. Solution: clear `mapped_ctrl_c` during :global.
* Merge #5500Justin M. Keyes2016-10-26
|\ | | | | | | Closes #5246
| * Fix lint errors.Grzegorz Milka2016-10-23
| |
| * vim-patch:7.4.2312Grzegorz Milka2016-10-23
| | | | | | | | | | | | | | | | 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
* | vim-patch:7.4.2128 (#5517)Michael Ennen2016-10-26
|/ | | | | | Problem: Memory leak when saving for undo fails. Solution: Free allocated memory. (Hirohito Higashi) https://github.com/vim/vim/commit/1e2258297bb31720bfbeb234f2dae4d1b3b04fbd
* main.c: "BufReadCmd term://": Skip existing terminal.Justin M. Keyes2016-10-12
| | | | | | | | | 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.
* terminal: Move re-edit detection to do_ecmd(). #5445Harm te Hennepe2016-10-12
| | | | Closes #4784
* doc: minor comment tweaksJustin M. Keyes2016-09-28
|
* vim-patch 7.4.1266Michael Ennen2016-09-18
| | | | | | | | Problem: A BufAdd autocommand may cause an ml_get error (Christian Brabandt) Solution: Increment RedrawingDisabled earlier. https://github.com/vim/vim/commit/ab9fc7e0cf22bcee119b62d3433cac60f405e645
* vim-patch:7.4.1913 (#5260)Jurica Bradarić2016-09-04
| | | | | | | 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
* vim-patch:7.4.1900 (#5259)Jurica Bradarić2016-09-04
| | | | | | 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
* perf: Disable clipboard in do_cmdline().Justin M. Keyes2016-08-25
| | | | | | | | | | | 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
* ops.c: Rename start_global_changes().Justin M. Keyes2016-08-25
|
* ex_cmds: Factor pieces of functionality out of do_subJames McCoy2016-08-20
| | | | | | | | | * 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.
* lintJames McCoy2016-08-20
|
* vim-patch:7.4.2219James McCoy2016-08-20
| | | | | | | | | | | 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
* coverity/150263: s/STRCPY/STRLCPY/, bounds check (#5036)J Phani Mahesh2016-07-20
|
* lintJames McCoy2016-07-08
|
* vim-patch:7.4.1551James McCoy2016-07-08
| | | | | | | Problem: Cannot generate help tags in all doc directories. Solution: Make ":helptags ALL" work. https://github.com/vim/vim/commit/6bef5306e4f2cacb3a93667992c2312d4b293c9d
* os/fs: Rename os_file_exists to os_path_exists (#4973)Daniel Xu2016-07-06
| | | | Because the old name did not indicate that the function would return true on directories as well.
* Fix warnings with gcc 6.1Björn Linse2016-05-19
| | | | The intentional behavior of do_sub was checked in vim
* vim-patch:7.4.1728Michael Ennen2016-05-17
| | | | | | | | | patch 7.4.1728 Problem: The help for functions require a space after the "(". Solution: Make CTRL-] on a function name ignore the arguments. (Hirohito Higashi) https://github.com/vim/vim/commit/81edd171a9465cf99cede4fa4a7b7bca3d538b0f
* vim-patch:7.4.1568Michael Ennen2016-05-17
| | | | | | | | patch 7.4.1568 Problem: Using CTRL-] in help on option in parentheses doesn't work. Solution: Skip the "(" in "('". (Hirohito Higashi) https://github.com/vim/vim/commit/00f9e0dbbd3472db217d56639fad9346b9eb3b82
* *: Fix new linter errorsZyX2016-05-01
| | | | 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.
* Merge pull request #4632 from KillTheMule/vim-7.4.822Justin M. Keyes2016-04-25
|\ | | | | vim-patch:7.4.822
| * vim-patch:7.4.822KillTheMule2016-04-23
| | | | | | | | | | | | | | | | | | | | 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
* | Merge #4303 'vim-patch:7.4.{951,1143,1144}'.Justin M. Keyes2016-04-25
|\ \ | |/ |/|