Commit Graph

6775 Commits

Author SHA1 Message Date
James McCoy
49f73e5275
vim-patch:7.4.1894
Problem:    Cannot get the window ID for a mouse click.
Solution:   Add v:mouse_winid.

511972d810
2016-11-15 22:00:25 -05:00
James McCoy
defa86b08a
vim-patch:7.4.1892
Problem:    balloon eval only gets the window number, not the ID.
Solution:   Add v:beval_winid.

c9721bdc63
2016-11-15 21:48:08 -05:00
James McCoy
c91e9c1c7a Merge pull request #5611 from jamessan/vim-7.4.2174
vim-patch:7.4.2174
2016-11-15 14:57:57 -05:00
Shougo
c69cfd7d1c vim-patch:8.0.0035 (#5609)
Problem:    Order of matches for 'omnifunc' is messed up. (Danny Su)
Solution:   Do not set compl_curr_match when called from complete_check().
            (closes vim/vim#1168)

472e85970e
2016-11-15 17:59:55 +01:00
James McCoy
12ed735719 lint 2016-11-15 11:50:54 -05:00
James McCoy
9d9d93aee3 vim-patch:7.4.2174
Problem:    Adding duplicate flags to 'whichwrap' leaves commas behind.
Solution:   Also remove the commas. (Naruhiko Nishino)

c8ce615299
2016-11-15 11:48:37 -05:00
James McCoy
10c72cd365
vim-patch.sh: Remove "set -o pipefail"
grep 2.26 changed its behavior when redirecting its output to /dev/null
such that it exits as soon as one match is found.  This causes sed to
get a SIGPIPE which, due to "set -o pipefail", falsely implies that the
patch is not applied.

Removing "set -o pipefail" preserves the good exit status from grep.
2016-11-15 07:53:01 -05:00
Justin M. Keyes
d28d108648 CheckHealth: Fix version comparison.
Compare numbers instead of strings.
2016-11-15 13:15:40 +01:00
Justin M. Keyes
01ef6fc3d2 Merge #5607 from justinmk/icm
'inccommand': auto-disable if too slow; fix other behaviors
2016-11-15 09:12:47 +01:00
Justin M. Keyes
35231312d7 'inccommand': Add tests. 2016-11-15 05:01:25 +01:00
Justin M. Keyes
3f7a2d785d 'inccommand': Introduce CMDPREVIEW state.
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.
2016-11-15 04:22:24 +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
91507c271e 'inccommand': Detect "non-interactive", "too slow".
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
2016-11-15 04:22:24 +01:00
James McCoy
0c799a8f10 Merge pull request #5606 from jamessan/vim-7.4.1658
vim-patch:7.4.1658
2016-11-14 16:16:18 -05:00
James McCoy
0b686e9b61 lint 2016-11-14 14:16:40 -05:00
James McCoy
9d2985ecba vim-patch:7.4.1658
Problem:    A plugin does not know when VimEnter autocommands were already
            triggered.
Solution:   Add the v:vim_did_enter variable.

1473551a44
2016-11-14 14:16:40 -05:00
James McCoy
4539d867d4 Merge pull request #5603 from jamessan/remove-flaky-term-resize-test
test: window_spec: Remove flaky terminal resize test
2016-11-13 19:54:14 -05:00
James McCoy
5e1dc26f74
test: window_spec: Remove flaky terminal resize test 2016-11-13 18:47:03 -05:00
Justin M. Keyes
598f5af58b Merge #5582 from justinmk/icm
'inccommand': Support :smagic/:snomagic. Less jumping around.
2016-11-12 13:32:48 +01:00
Tommy Allen
84eed76b55 CheckHealth: Include v:throwpoint in error message (#5575)
* health.vim: Include v:throwpoint in error message

* health/provider.vim: Check for ruby executable

* health/provider.vim: Combine subprocess stdout and stderr

* test: Updated CheckHealth test
2016-11-12 11:59:15 +01:00
James McCoy
7e48c23a50 vim-patch:7.4.1634 (#5594)
Problem:    Vertical movement after CTRL-A ends up in the wrong column.
            (Urtica Dioica)
Solution:   Set curswant when appropriate. (Hirohito Higashi)

8e08125d3a
2016-11-12 11:32:23 +01:00
James McCoy
c5bc0ea04c vim-patch:7.4.1614 (#5593)
Problem:    Still quickfix test in old style.
Solution:   Turn test 10 into a new style test.

7eba3d2cbf
2016-11-12 11:30:18 +01:00
James McCoy
05d1211424 Merge pull request #5592 from jamessan/vim-7.4.1591
vim-patch:7.4.1591
2016-11-11 16:01:13 -05:00
James McCoy
7baa96b717 vim-patch:7.4.1591
Problem:    The quickfix title is truncated.
Solution:   Save the command before it is truncated. (Anton Lindqvist)

5584df65a0
2016-11-11 11:37:42 -05: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
0213e99aaf Merge #5561 'inccommand'
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>
2016-11-09 03:19:22 +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
21dfbfbb9a perf: do_sub(): avoid work, avoid screen updates
- Don't fill matched_lines if not showing a preview (!eap->is_live).
- Encapsulate: Move cursor placement logic to show_sub().
2016-11-08 21:22:24 +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
e4e7b2d239 lint 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
Marco Hinz
bd33f1165b CheckHealth: ignore non-existing markdownCodeBlock group (#5570)
People using [1] would experience an error, because their markdown syntax
doesn't define the markdownCodeBlock group.

[1]: https://github.com/plasticboy/vim-markdown

Closes #5569
2016-11-08 19:01:15 +01:00
Tommy Allen
3089c86f4e CheckHealth: timeout system() calls (#5565) 2016-11-08 14:34:03 +01:00
Björn Linse
9147331e21 Merge pull request #2905 from bfredl/utf8
Only allow encoding=utf-8 and simplify multibyte code
2016-11-05 18:12:14 +01:00
Björn Linse
4ab3fe8eaa encoding: update documentation 2016-11-05 14:49:24 +01:00
Björn Linse
b3ece5c81c encoding: update tests
Change shada reencoding tests to check for
correct handling of UTF-8 and binary strings.

Delete enc=latin1 json tests.
2016-11-05 14:49:24 +01:00
Björn Linse
18f56c8e90 encoding: delete non-UTF-8 implementations of multibyte functions
Deleted documentation was duplicated at specific utf_ implementation
2016-11-05 14:49:24 +01:00
Björn Linse
5072ab9e5b encoding: cleanup mbyte.c given fixed encoding=utf-8
Eliminate mb_init():
Set "enc_utf" and "has_mbyte" early. Eliminate "enc_unicode" and "enc_latin1like".
init_chartab() and screenalloc() are already invoked elsewhere
in the initialization process.
The EncodingChanged autocmd cannot be triggered.
At initialization, there is no spellfiles to reload
2016-11-05 14:49:24 +01:00
Björn Linse
4804001aff encoding: only allow encoding=utf-8 2016-11-05 14:49:23 +01:00
Marco Hinz
32d9c19e29 Health: introduce help links (#5557)
We can now use help links like in normal help pages. The bars around them will
be concealed as well.

* Health: link string "SUCCESS" to ModeMsg

So far we linked "SUCCESS" to the Function highlight group.

The newly introduced healthHelp group links to Idenfifier as it does for links
in normal help pages.

Now the problem is that the Function group links again to Identifier as well, so
both, "SUCCESS" and help links, would use the same colors.

* Health: don't use Markdown code blocks

Every line indented by more than 4 spaces would lose its highlighting otherwise.

* Health: add helper health#help_to_link()
2016-11-04 11:03:05 +01:00
James McCoy
01f1028496
Merge pull request #5524 from brcolow/vim-7.4.1967
vim-patch:7.4.1967
2016-11-02 20:06:23 -04:00