Skip to content

Commit 6fc791c

Browse files
committed
Merge branch 'vim'
2 parents 946e219 + 7fc9842 commit 6fc791c

39 files changed

+582
-238
lines changed

.hgignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@ src/testdir/lua.vim
5555
src/testdir/small.vim
5656
src/testdir/tiny.vim
5757
src/testdir/test*.out
58+
src/testdir/test.log

.hgtags

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2530,3 +2530,24 @@ dc78a26f6f64bb1330b9027559ce0c8fe54ba1de v7-3-1189
25302530
4c42efb4c0982d305ec9ee99bb3bddfaeec2cf87 v7-3-1191
25312531
07b9c48a30e973833ee70d38633934f6fc2177d8 v7-3-1192
25322532
8b46c37c4b843039e5a543be98978e79ff6f3d31 v7-3-1193
2533+
91136a41f83f3716e7ccb4f2402216ea215a4acf v7-3-1194
2534+
4837fd61be52d420c69fcde0621cd5ecc298d2b6 v7-3-1195
2535+
56fbf60e94766a202ee71749eea19a862695c92f v7-3-1196
2536+
2fc1f3346bfb3229f35455101a5944e6785a02af v7-3-1197
2537+
517fa1a34c7cf1c8fb04d43976ad6c381f48cebd v7-3-1198
2538+
be2973afe77045bd749c63c46ea02f61efa55862 v7-3-1199
2539+
2945fe016b936c9e3a89db48692495c83f1843a1 v7-3-1200
2540+
d8f65e6238fa2bac706f1a4868e8d38ad71ded64 v7-3-1201
2541+
1707ddb6f5aed99b69fff8a66dc3eb8ab40d7f46 v7-3-1202
2542+
ba328b4a990ee460cc907ec59aabee8d872b7768 v7-3-1203
2543+
0792cc5133ce1f37ad9e1d49804100b28d0a391b v7-3-1204
2544+
d02448031708fca0df590f46f850e33acc9f9651 v7-3-1205
2545+
8dd2769ab75c07d88feb49d1dd489a1282854217 v7-3-1206
2546+
6ae32a64e153d7275058d965e0c1c12d106bc7de v7-3-1207
2547+
784e342ddcaeb260ffaab5f0dd30ec5db832842e v7-3-1208
2548+
afb00cc8caacb8969705ffae0316bb9c01156e7f v7-3-1209
2549+
7155782d94fb88e47e252b159dd677c31a3f14e8 v7-3-1210
2550+
1cf02fbe6281c8efe63f866470b6c44d5835125c v7-3-1211
2551+
81e623ff2e554695c372b7b06bd826c6298bb8b5 v7-3-1212
2552+
ae05437a744a3b6f87d6f3304a19e5256849bb1c v7-3-1213
2553+
bcb84438bb5bf27101b25ffb2c2267ab6ff0e946 v7-3-1214

runtime/doc/autocmd.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*autocmd.txt* For Vim version 7.3. Last change: 2013 May 19
1+
*autocmd.txt* For Vim version 7.3. Last change: 2013 Jun 15
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -513,9 +513,9 @@ CursorHold When the user doesn't press a key for the time
513513
CursorHoldI Just like CursorHold, but in Insert mode.
514514

515515
*CursorMoved*
516-
CursorMoved After the cursor was moved in Normal mode.
517-
Also when the text of the cursor line has been
518-
changed, e.g., with "x", "rx" or "p".
516+
CursorMoved After the cursor was moved in Normal or Visual
517+
mode. Also when the text of the cursor line
518+
has been changed, e.g., with "x", "rx" or "p".
519519
Not triggered when there is typeahead or when
520520
an operator is pending.
521521
For an example see |match-parens|.

runtime/doc/if_lua.txt

Lines changed: 75 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ The Lua Interface to Vim *lua* *Lua*
1010
2. The vim module |lua-vim|
1111
3. List userdata |lua-list|
1212
4. Dict userdata |lua-dict|
13-
5. Buffer userdata |lua-buffer|
14-
6. Window userdata |lua-window|
15-
7. The luaeval function |lua-luaeval|
13+
5. Funcref userdata |lua-funcref|
14+
6. Buffer userdata |lua-buffer|
15+
7. Window userdata |lua-window|
16+
8. The luaeval function |lua-luaeval|
1617

1718
{Vi does not have any of these commands}
1819

@@ -110,9 +111,31 @@ input range are stored in "vim.firstline" and "vim.lastline" respectively. The
110111
module also includes routines for buffer, window, and current line queries,
111112
Vim evaluation and command execution, and others.
112113

113-
vim.list() Returns an empty list (see |List|).
114-
115-
vim.dict() Returns an empty dictionary (see |Dictionary|).
114+
vim.list([arg]) Returns an empty list or, if "arg" is a Lua
115+
table with numeric keys 1, ..., n (a
116+
"sequence"), returns a list l such that l[i] =
117+
arg[i] for i = 1, ..., n (see |List|).
118+
Non-numeric keys are not used to initialize
119+
the list. See also |lua-eval| for conversion
120+
rules. Example: >
121+
:lua t = {math.pi, false, say = 'hi'}
122+
:echo luaeval('vim.list(t)')
123+
:" [3.141593, 0], 'say' is ignored
124+
<
125+
vim.dict([arg]) Returns an empty dictionary or, if "arg" is a
126+
Lua table, returns a dict d such that d[k] =
127+
arg[k] for all string keys k in "arg" (see
128+
|Dictionary|). Number keys are converted to
129+
strings. Keys that are not strings are not
130+
used to initialize the dictionary. See also
131+
|lua-eval| for conversion rules. Example: >
132+
:lua t = {math.pi, false, say = 'hi'}
133+
:echo luaeval('vim.dict(t)')
134+
:" {'say': 'hi'}, numeric keys ignored
135+
<
136+
vim.funcref({name}) Returns a Funcref to function {name} (see
137+
|Funcref|). It is equivalent to Vim's
138+
"function".
116139

117140
vim.buffer([arg]) If "arg" is a number, returns buffer with
118141
number "arg" in the buffer list or, if "arg"
@@ -131,9 +154,9 @@ Vim evaluation and command execution, and others.
131154

132155
vim.type({arg}) Returns the type of {arg}. It is equivalent to
133156
Lua's "type" function, but returns "list",
134-
"dict", "buffer", or "window" if {arg} is a
135-
list, dictionary, buffer, or window,
136-
respectively. Examples: >
157+
"dict", "funcref", "buffer", or "window" if
158+
{arg} is a list, dictionary, funcref, buffer,
159+
or window, respectively. Examples: >
137160
:lua l = vim.list()
138161
:lua print(type(l), vim.type(l))
139162
:" userdata list
@@ -229,7 +252,40 @@ Examples:
229252
<
230253

231254
==============================================================================
232-
5. Buffer userdata *lua-buffer*
255+
5. Funcref userdata *lua-funcref*
256+
257+
Funcref userdata represent funcref variables in Vim. Funcrefs that were
258+
defined with a "dict" attribute need to be obtained as a dictionary key
259+
in order to have "self" properly assigned to the dictionary (see examples
260+
below.) A funcref "f" has the following properties:
261+
262+
Properties
263+
----------
264+
o "#f" is the name of the function referenced by "f"
265+
o "f(...)" calls the function referenced by "f" (with arguments)
266+
267+
Examples:
268+
>
269+
:function I(x)
270+
: return a:x
271+
: endfunction
272+
:let R = function('I')
273+
:lua i1 = vim.funcref('I')
274+
:lua i2 = vim.eval('R')
275+
:lua print(#i1, #i2) -- both 'I'
276+
:lua print(i1, i2, #i2(i1) == #i1(i2))
277+
:function Mylen() dict
278+
: return len(self.data)
279+
: endfunction
280+
:let mydict = {'data': [0, 1, 2, 3]}
281+
:lua d = vim.eval('mydict'); d.len = vim.funcref('Mylen')
282+
:echo mydict.len()
283+
:lua l = d.len -- assign d as 'self'
284+
:lua print(l())
285+
<
286+
287+
==============================================================================
288+
6. Buffer userdata *lua-buffer*
233289

234290
Buffer userdata represent vim buffers. A buffer userdata "b" has the following
235291
properties and methods:
@@ -281,7 +337,7 @@ Examples:
281337
<
282338

283339
==============================================================================
284-
6. Window userdata *lua-window*
340+
7. Window userdata *lua-window*
285341

286342
Window objects represent vim windows. A window userdata "w" has the following
287343
properties and methods:
@@ -313,7 +369,7 @@ Examples:
313369
<
314370

315371
==============================================================================
316-
7. The luaeval function *lua-luaeval* *lua-eval*
372+
8. The luaeval function *lua-luaeval* *lua-eval*
317373

318374
The (dual) equivalent of "vim.eval" for passing Lua values to Vim is
319375
"luaeval". "luaeval" takes an expression string and an optional argument and
@@ -325,7 +381,13 @@ returns the result of the expression. It is semantically equivalent in Lua to:
325381
return chunk(arg) -- return typval
326382
end
327383
<
328-
Note that "_A" receives the argument to "luaeval". Examples: >
384+
Note that "_A" receives the argument to "luaeval". Lua numbers, strings, and
385+
list, dict, and funcref userdata are converted to their Vim respective types,
386+
while Lua booleans are converted to numbers. An error is thrown if conversion
387+
of any of the remaining Lua types, including userdata other than lists, dicts,
388+
and funcrefs, is attempted.
389+
390+
Examples: >
329391
330392
:echo luaeval('math.pi')
331393
:lua a = vim.list():add('newlist')

runtime/doc/indent.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*indent.txt* For Vim version 7.3. Last change: 2013 Jun 12
1+
*indent.txt* For Vim version 7.3. Last change: 2013 Jun 13
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -745,7 +745,7 @@ You can set the indent for the first line after <script> and <style>
745745
"inc" auto indent + one indent step
746746

747747
Many tags increase the indent for what follows per default (see "Add Indent
748-
Tags" below in this script). You can add further tags with: >
748+
Tags" in the script). You can add further tags with: >
749749
750750
:let g:html_indent_inctags = "html,body,head,tbody"
751751
@@ -757,19 +757,19 @@ Default value is empty for both variables. Note: the initial "inctags" are
757757
only defined once per Vim session.
758758

759759
User variables are only read when the script is sourced. To enable your
760-
changes during a session, without reloaind the html file, you can manually
760+
changes during a session, without reloading the HTML file, you can manually
761761
do: >
762762
763763
:call HtmlIndent_CheckUserSettings()
764764
765765
Detail:
766766
Calculation of indent inside "blocktags" with "alien" content:
767767
BLOCKTAG INDENT EXPR WHEN APPLICABLE ~
768-
<script> : {customizable} if first line of block
769-
: cindent(v:lnum) if attributes empty or contain "java"
770-
: -1 else (vbscript, tcl, ...)
771-
<style> : {customizable} if first line of block
772-
: GetCSSIndent() else
768+
<script> : {customizable} if first line of block
769+
: cindent(v:lnum) if attributes empty or contain "java"
770+
: -1 else (vbscript, tcl, ...)
771+
<style> : {customizable} if first line of block
772+
: GetCSSIndent() else
773773
<!-- --> : -1
774774

775775

runtime/doc/tags

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6730,6 +6730,7 @@ lua-buffer if_lua.txt /*lua-buffer*
67306730
lua-commands if_lua.txt /*lua-commands*
67316731
lua-dict if_lua.txt /*lua-dict*
67326732
lua-eval if_lua.txt /*lua-eval*
6733+
lua-funcref if_lua.txt /*lua-funcref*
67336734
lua-list if_lua.txt /*lua-list*
67346735
lua-luaeval if_lua.txt /*lua-luaeval*
67356736
lua-vim if_lua.txt /*lua-vim*

runtime/doc/todo.txt

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*todo.txt* For Vim version 7.3. Last change: 2013 Jun 12
1+
*todo.txt* For Vim version 7.3. Last change: 2013 Jun 15
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -36,9 +36,6 @@ not be repeated below, unless there is extra information.
3636

3737
--- Python interface
3838

39-
Test 87 fails.
40-
Test 86 fails on some systems.
41-
4239
Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
4340

4441
Win32: The Python interface only works with one version of Python, selected at
@@ -54,30 +51,6 @@ Does not work, tests fail.
5451

5552
--- bug fixes
5653

57-
:wviminfo does not write old history entries. (Roland Eggner, 2013 Jun 5)
58-
Another message Jun 6.
59-
60-
Patch to avoid wrong error message for 1.0[0]. (Yasuhiro Matsumoto, 2013 May
61-
1)
62-
63-
Patch for if_lua. (Luis Carvalho, 2012 Aug 26, update Aug 29, another Aug 30,
64-
then Sep 1, reminder Oct 14)
65-
66-
Patch for if_perl. (Ike Devolder, May 27)
67-
68-
Patch to check if 'foldexpr' sets did_emsg. (Christian Brabandt, 2013 Mar 20)
69-
70-
Patch for 'backupcopy' default behavior for symlinks on Windows. (David Pope,
71-
2012 Mar 21, update Mar 31)
72-
With fix for memory leak: Ken Takata, 2012 Aug 24
73-
Another update Sep 24.
74-
Also patch from Joerg Bornemann, 2013 Apr 30.
75-
76-
Undo problem: line not removed as expected when using setline() from Insert
77-
mode. (Israel Chauca, 2010 May 13, more in second msg)
78-
Break undo when CTRL-R = changes the text? Or save more lines?
79-
Patch by Christian Brabandt, 2012 Nov 16.
80-
8154
Do allow real tags above the !_TAG entries. Undo older patch. Issue 90.
8255

8356
Matches might be highlighted correctly. Inefficient patch by Christian

0 commit comments

Comments
 (0)