Commit Graph

6934 Commits

Author SHA1 Message Date
Michael Ennen
bae31b764a vim-patch:7.4.1608
Problem:    string() doesn't handle a partial.
Solution:   Make a string from a partial.

5c29154b52
2016-12-12 10:17:35 -05:00
Michael Ennen
3213b28c01 vim-patch:7.4.1607
Problem:    Comparing a function that exists on two dicts is not backwards
            compatible. (Thinca)
Solution:   Only compare the function, not what the partial adds.

f0e86a0dbd
2016-12-12 10:17:35 -05:00
Michael Ennen
5241ca7d7a vim-patch:7.4.1606
Problem:    Having type() handle a Funcref that is or isn't a partial
            differently causes problems for existing scripts.
Solution:   Make type() return the same value. (Thinca)

953cc7fb13
2016-12-12 10:17:35 -05:00
Michael Ennen
34a7814219 vim-patch:7.4.1605
Problem:    Catching exception that won't be thrown.
Solution:   Remove try/catch.

3905e291fe
2016-12-12 10:17:35 -05:00
Michael Ennen
86706011a6 vim-patch:7.4.1590
Problem:    Warning for shadowed variable. (Christian Brabandt)
Solution:   Move the variable into a local block.

3f242a844e
2016-12-12 10:17:35 -05:00
Michael Ennen
531249a4ac vim-patch:7.4.1589
Problem:    Combining dict and args with partial doesn't always work.
Solution:   Use the arguments from the partial.

9e63f61cb0
2016-12-12 10:17:35 -05:00
Michael Ennen
cf2701b269 vim-patch:7.4.1586
Problem:    Nesting partials doesn't work.
Solution:   Append arguments. (Ken Takata)

8a1bb04637
2016-12-12 10:17:35 -05:00
Michael Ennen
27b2fb944a vim-patch:7.4.1585
Problem:    Partial is not recognized everywhere.
Solution:   Check for partial in trans_function_name(). (Yasuhiro Matsumoto)
            Add a test.

d22a18928e
2016-12-12 10:17:35 -05:00
Michael Ennen
e2258598ca vim-patch:7.4.1582
Problem:    Get E923 when using function(dict.func, [], dict). (Kent Sibilev)
            Storing a function with a dict in a variable drops the dict if the
            function is script-local.
Solution:   Translate the function name.  Use dict arg if present.

6f2e4b36c9
2016-12-12 10:17:35 -05:00
Michael Ennen
5cf0c99755 vim-patch:7.4.1581
Problem:    Using ":call dict.func()" where the function is a partial does
            not work.  Using "dict.func()" where the function does not take a
            Dictionary does not work.
Solution:   Handle partial properly in ":call". (Yasuhiro Matsumoto)

65639032bb
2016-12-12 10:17:35 -05:00
Michael Ennen
2c1b4c7f3c vim-patch:7.4.1580
Problem:    Crash when using function reference. (Luchr)
Solution:   Set initial refcount. (Ken Takata)

7a5c46a9df
2016-12-12 10:17:35 -05:00
Michael Ennen
529482d684 vim-patch:7.4.1577
Problem:    Cannot pass "dict.Myfunc" around as a partial.
Solution:   Create a partial when expected.

ab1fa3955f
2016-12-12 10:17:35 -05:00
Michael Ennen
f90551b0e6 vim-patch:7.4.1564
Problem:    An empty list in function() causes an error.
Solution:   Handle an empty list like there is no list of arguments.

346418c624
2016-12-12 10:17:35 -05:00
Michael Ennen
66922d89cc vim-patch:7.4.1563
Problem:    Partial test fails on windows.
Solution:   Return 1 or -1 from compare function.

790500a8e6
2016-12-12 10:17:34 -05:00
Michael Ennen
521e45f2a8 vim-patch:7.4.1559
Problem:    Passing cookie to a callback is clumsy.
Solution:   Change function() to take arguments and return a partial.

1735bc988c
2016-12-12 10:17:34 -05:00
James McCoy
75c18b6aaa Merge pull request #5756 from jamessan/viminfo-leak
option.c: Update free_oldval after adjusting opt_idx for shada/viminfo
2016-12-12 06:55:23 -05:00
James McCoy
8995a15b20 Merge pull request #5757 from jamessan/vim-7.4.1867
vim-patch:7.4.1867
2016-12-12 06:55:11 -05:00
James McCoy
2d3c835534
vim-patch:7.4.1867
Problem:    Memory leak in test_matchstrpos.
Solution:   Free the string before overwriting. (Yegappan Lakshmanan)

3c809343c7
2016-12-11 23:21:51 -05:00
James McCoy
79c711670c
option.c: Update free_oldval after adjusting opt_idx for shada/viminfo
Previously, free_oldval was set immediately on entering
did_set_string_option.  However, opt_idx hadn't been adjusted to account
for diverting 'viminfo' manipulation to 'shada'.

Therefore, the code which determines whether to free the old value was
looking at the flags for 'viminfo' while the code which sets whether a
value was allocated was modifying the flags for 'shada'.  This led to a
leak of any values set for 'viminfo'.

Updating free_oldval once opt_idx has been adjusted for the
'viminfo'/'shada' handling ensures the check/set values are consistent.

Closes #5698
2016-12-11 23:17:50 -05:00
Justin M. Keyes
29e651515f Merge #5752 from justinmk/doc
doc: api_info(), typval_encode.h
2016-12-11 02:04:33 +01:00
Justin M. Keyes
0fe89fc9d7 Merge #5750 from justinmk/jobstart
jobstart(): Return -1 if cmd is non-executable
2016-12-11 01:38:17 +01:00
Justin M. Keyes
19848dce50 doc: README.md: update appveyor URL 2016-12-11 01:32:28 +01:00
Justin M. Keyes
100a8d40db CheckHealth: more precise check for sensible.vim
Closes #5751
2016-12-11 01:26:49 +01:00
Justin M. Keyes
cc7c42ed5d po: Remove E902 message 2016-12-11 01:14:22 +01:00
Justin M. Keyes
d32888073f test: jobstart() 2016-12-11 01:14:22 +01:00
Aaron Williamson
c8d5e9230e jobstart(): Return -1 if cmd is not executable. #5671
Closes #5465
2016-12-10 16:01:27 +01:00
Rafael Bodill
f344e40699 ex_docmd.c: Save/restore winminheight/winminwidth. #5717
Fix session load with winminheight/winminwidth >1.

Problem:  Vim temporarily sets winheight/winwidth to 1 while loading
          session. If user has his minimum window size set higher, this
          causes an error.
Solution: Temporarily set winminheight/winminwidth, and restore the
          original values (in the right order) when finishing session read.
          The order of the compound 'set' command is important, if it is
          wrong there will be an error.
2016-12-10 04:05:07 +01:00
Shougo
2380747ff2 vim-patch:7.4.1909 (#5748)
Problem:    Doubled semicolons.
Solution:   Reduce to one. (Dominique Pelle)

945ec093cd
2016-12-10 13:40:29 +01:00
Shougo
26f8cdedc3 vim-patch:7.4.1897 (#5747)
Problem:    Various typos, long lines and style mistakes.
Solution:   Fix the typos, wrap lines, improve style.

fd89d7ea81
2016-12-10 13:39:28 +01:00
Justin M. Keyes
7c513d646d Merge #5396 from justinmk/tui-throttle
throttle shell output to maintain responsiveness
2016-12-10 02:18:15 +01:00
Justin M. Keyes
4abe9afbf6 out_data_decide_throttle(): timeout instead of hard limit.
Instead of managing max_visits, check the time every N visits. This avoids edge
cases where max_visits is large but the chunk frequency slowed down, which would
causing the "..." pulse to show for a very long time. It's more important to
show output at reasonable intervals than to avoid calling os_hrtime().
2016-12-10 01:26:34 +01:00
Justin M. Keyes
ea154dfdb2 out_data_decide_throttle(): Avoid too-small final chunk. 2016-12-10 01:26:34 +01:00
Justin M. Keyes
cb58999007 os/shell: do_os_system(): Always show last chunk.
This ameliorates use-cases like:
    :!cat foo.txt
    :make
where the user is interested in the last few lines of output.

Try these shell-based ex-commands before/after this commit:
    :grep -r '' *
    :make
    :!yes
    :!grep -r '' *
    :!git grep ''
    :!cat foo
    :!echo foo
    :!while true; do date; done
    :!for i in `seq 1 20000`; do echo XXXXXXXXXX $i; done

In all cases the last few lines of the command should always be shown,
regardless of where throttling was triggered.
2016-12-10 01:26:34 +01:00
Marco Hinz
5082af415f Health: rework syntax (#5744)
- By re-enabling code blocks (every line that doesn't begin with a "-" and is
  indented by at least 4 spaces), we prevent the Markdown syntax to evaluate "_"
  as beginning for italic text.

  That's the case for `:CheckHealth deoplete` for instance. It would output:

    $ cat /tmp/log_{PID}

  Since the deoplete check gets run first, almost all of the following
  `:CheckHealth` output would be italic.

- Since we re-enable code blocks, we now have to tell our custom syntax that it
  can be part of markdownCodeBlock as well. Otherwise there would be no
  highlithing for our keywords ERROR, INFO, etc. after 4 spaces of indent.

- Since we do the above anyway, we make it work for mkdListItemLine as well.
  That's a highlight group from `plasticboy/vim-markdown` opposed to the shipped
  markdown syntax (which essentially is `tpope/vim-markdown`). Before this patch
  there was no highlighting at all in the `:CheckHealth` output.
2016-12-09 19:54:24 +01:00
Justin M. Keyes
97204e1cef os/shell: Throttle :! output, pulse "..." message.
Periodically skip :! spam. This is a "cheat" that works for all UIs and greatly
improves responsiveness when :! spams MB or GB of output:
    :!yes
    :!while true; do date; done
    :!git grep ''
    :grep -r '' *

After ~10KB of data is seen from a single :! invocation, output will be skipped
for ~1s and three dots "..." will pulse in the bottom-left. Thereafter the
behavior alternates at every:
    * 10KB received
    * ~1s throttled

This also avoids out-of-memory which could happen with large :! outputs.

Note: This commit does not change the behavior of execute(':!foo').
      execute(':!foo') returns the string ':!foo^M', it captures *only* Vim
      messages, *not* shell command output. Vim behaves the same way.
      Use system('foo') for capturing shell command output.

Closes #1234

Helped-by: oni-link <knil.ino@gmail.com>
2016-12-09 18:51:17 +01:00
Justin M. Keyes
043f85210a tui: "backpressure": Drop messages to avoid flooding.
Closes #1234

multiqueue:
- Implement multiqueue_size()
- Rename MultiQueueItem.parent to MultiQueueItem.parent_item, to avoid confusion
  with MultiQueue.parent.
2016-12-09 18:51:17 +01:00
Shougo Matsushita
7da7ff7c5c vim-patch:7.4.1758, 7.4.1759, 7.4.1692 #5640
vim-patch:7.4.1758

Problem:    Triggering CursorHoldI when in CTRL-X mode causes problems.
Solution:   Do not trigger CursorHoldI in CTRL-X mode. Add "!" flag to
            feedkeys() (test with that didn't work though).

245c41070c

vim-patch:7.4.1759

Problem:    When using feedkeys() in a timer the inserted characters are not
            used right away.
Solution:   Break the wait loop when characters have been added to typebuf.
            use this for testing CursorHoldI.

40b1b5443c

vim-patch:7.4.1692
Problem:    feedkeys('i', 'x') gets stuck, waits for a character to be typed.
Solution:   Behave like ":normal". (Yasuhiro Matsumoto)
2016-12-09 17:46:14 +01:00
Justin M. Keyes
880ce887ed ci: Update appveyor artifact path. 2016-12-09 17:09:17 +01:00
Marco Hinz
ae9f1938ea Health: match syntax keyword case exactly (#5741)
This prevents the string "error" within error messages to be highlighted as
healthError.
2016-12-09 16:47:29 +01:00
James McCoy
4a2d2248e8 Merge pull request #5736 from jamessan/vim-7.4.1754
vim-patch:7.4.1754
2016-12-09 09:42:23 -05:00
Marco Hinz
20995c7960 Remove g:python{,3}_host_skip_check (#5738)
This option simplifies the configuration options:

1) `g:python{,3}_host_prog` is not set.

    Neovim tries its best to find a suitable interpreter. This means calling
    exepath(), potentially multiple times, and a system('python -c ...') with
    the first found interpreter, to get the Python version.

2) `g:python{,3}_host_prog` is set.

    Avoids everything of the above. No safety checks, no training wheels. Fast
    host startup time!
2016-12-09 15:08:18 +01:00
James McCoy
ddfac951ea Merge pull request #5705 from brcolow/vim-7.4.1835
vim-patch:7.4.[1835,1956]
2016-12-08 10:43:17 -05:00
James McCoy
7775fb7dff lint 2016-12-08 10:36:24 -05:00
James McCoy
d1473880bc vim-patch:7.4.1754
Problem:    When 'filetype' was set and reloading a buffer which does not
            cause it to be set, the syntax isn't loaded. (KillTheMule)
Solution:   Remember whether the FileType event was fired and fire it if not.
            (Anton Lindqvist, closes vim/vim#747)

c3691332f7
2016-12-08 10:27:32 -05:00
James McCoy
49d2952658 Merge pull request #5659 from brcolow/vim-7.4.1685
vim-patch:7.4.[1685,2163,2217,2269],8.0.00[33,40]
2016-12-08 09:18:51 -05:00
Justin M. Keyes
adf29cef72 syntax.c: Update color names. (#5733)
Closes #5178
2016-12-08 01:01:12 +01:00
Justin M. Keyes
ff99cbfc02 Merge #5488 from justinmk/test-fix-mouse-drag
test: Disable unreliable test on travis+ASAN_UBSAN
2016-12-07 23:55:18 +01:00
Justin M. Keyes
8da23cb919 Merge #5729 from jamessan/vim-7.4.1751
vim-patch:7.4.1751,8d8aa0a
2016-12-07 18:47:10 +01:00
Justin M. Keyes
933c873cae test: Handle SIGHUP in tty-test fixture.
Closes #5727
2016-12-07 17:22:37 +01:00
Justin M. Keyes
a1b0f594ea test: Disable unreliable tests on travis+ASAN_UBSAN 2016-12-07 17:22:23 +01:00