Commit Graph

7098 Commits

Author SHA1 Message Date
Michael Ennen
6c5dd6827f vim-patch:7.4.1875
Problem:    Comparing functions and partials doesn't work well.
Solution:   Add tests. (Nikolai Pavlov)  Compare the dict and arguments in the
            partial.

8e759ba865
2016-12-12 10:17:35 -05:00
Michael Ennen
b42347da45 vim-patch:7.4.1862 Mark as NA 2016-12-12 10:17:35 -05:00
Michael Ennen
537cee4883 vim-patch:7.4.1860
Problem:    Using a partial for timer_start() may cause a crash.
Solution:   Set the copyID in timer objects. (Ozaki Kiichi)

e3188e2615
2016-12-12 10:17:35 -05:00
Michael Ennen
c52856af2c vim-patch:7.4.1842
Problem:    get() works for Partial but not for Funcref.
Solution:   Accept Funcref.  Also return the function itself. (Nikolai Pavlov)

03e19a04ac
2016-12-12 10:17:35 -05:00
Michael Ennen
02c58d8a07 vim-patch:7.4.1839
Problem:    Cannot get the items stored in a partial.
Solution:   Support using get() on a partial.

2bbf8eff6f
2016-12-12 10:17:35 -05:00
Michael Ennen
c82dc7a6fd vim-patch:7.4.1836
Problem:    When using a partial on a dictionary it always gets bound to that
            dictionary.
Solution:   Make a difference between binding a function to a dictionary
            explicitly or automatically.

1d429610bf
2016-12-12 10:17:35 -05:00
Michael Ennen
eb337c9949 vim-patch:7.4.1720 Mark as NA 2016-12-12 10:17:35 -05:00
Michael Ennen
25438f149f vim-patch:7.4.1719
Problem:    Leaking memory when there is a cycle involving a job and a
            partial.
Solution:   Add a copyID to job and channel.  Set references in items referred
            by them.  Go through all jobs and channels to find unreferenced
            items.  Also, decrement reference counts when garbage collecting.

107e1eef1d
2016-12-12 10:17:35 -05:00
Michael Ennen
e97e24c77e vim-patch:7.4.1718
Problem:    Coverity: not using return value of set_ref_in_item().
Solution:   Use the return value.

d56374e25d
2016-12-12 10:17:35 -05:00
Michael Ennen
0645787741 vim-patch:7.4.1715
Problem:    Double free when a partial is in a cycle with a list or dict.
            (Nikolai Pavlov)
Solution:   Do not free a nested list or dict used by the partial.

ddecc25947
2016-12-12 10:17:35 -05:00
Michael Ennen
c6bc1e7bab vim-patch:7.4.1645
Problem:    When a dict contains a partial it can't be redefined as a
            function. (Nikolai Pavlov)
Solution:   Remove the partial when overwriting with a function.

c5fbe8af4c
2016-12-12 10:17:35 -05:00
Michael Ennen
04f328f1ae vim-patch:7.4.1644 Mark as NA 2016-12-12 10:17:35 -05:00
Michael Ennen
9d91218213 vim-patch:7.4.1639
Problem:    Invoking garbage collection may cause a double free.
Solution:   Don't free the dict in a partial when recursive is FALSE.

5f436fcf99
2016-12-12 10:17:35 -05:00
Michael Ennen
1945013eb7 vim-patch:7.4.1638
Problem:    When binding a function to a dict the reference count is wrong.
Solution:   Decrement dict reference count, only reference the function when
            actually making a copy. (Ken Takata)

e4eb6ff089
2016-12-12 10:17:35 -05:00
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