Mirror of the Vim source from https://github.com/vim/vim
Revision | 9032e466829601e6c56046813d0a9a00946a1d10 (tree) |
---|---|
Zeit | 2006-01-30 09:14:18 |
Autor | vimboss |
Commiter | vimboss |
updated for version 7.0189
@@ -1,7 +1,7 @@ | ||
1 | 1 | " Vim completion script |
2 | 2 | " Language: C |
3 | 3 | " Maintainer: Bram Moolenaar <Bram@vim.org> |
4 | -" Last Change: 2005 Dec 18 | |
4 | +" Last Change: 2006 Jan 29 | |
5 | 5 | |
6 | 6 | |
7 | 7 | " This function is used for the 'omnifunc' option. |
@@ -55,7 +55,7 @@ | ||
55 | 55 | |
56 | 56 | " Only one part, no "." or "->": complete from tags file. |
57 | 57 | " When local completion is wanted CTRL-N would have been used. |
58 | - return map(taglist('^' . base), 'v:val["name"]') | |
58 | + return map(taglist('^' . base), 's:Tag2item(v:val)') | |
59 | 59 | endif |
60 | 60 | |
61 | 61 | " Find the variable items[0]. |
@@ -106,7 +106,7 @@ | ||
106 | 106 | " type, add a "." or "->". |
107 | 107 | if len(res) == 1 && res[0]['match'] == items[-1] && len(s:SearchMembers(res, [''])) > 0 |
108 | 108 | " If there is a '*' before the name use "->". |
109 | - if match(res[0]['tagline'], '\*\s*' . res[0]['match']) > 0 | |
109 | + if match(res[0]['tagline'], '\*\s*' . res[0]['match'] . '\>') > 0 | |
110 | 110 | let res[0]['match'] .= '->' |
111 | 111 | else |
112 | 112 | let res[0]['match'] .= '.' |
@@ -116,6 +116,25 @@ | ||
116 | 116 | return map(res, 'v:val["match"]') |
117 | 117 | endfunc |
118 | 118 | |
119 | +" | |
120 | +" Turn the tag info "val" into an item for completion. | |
121 | +" "val" is is an item in the list returned by taglist(). | |
122 | +function! s:Tag2item(val) | |
123 | + if has_key(a:val, "kind") && a:val["kind"] == 'v' | |
124 | + if len(s:SearchMembers([{'match': a:val["name"], 'dict': a:val}], [''])) > 0 | |
125 | + " If there is a '*' before the name use "->". This assumes the command | |
126 | + " is a search pattern! | |
127 | + if match(a:val['cmd'], '\*\s*' . a:val['name'] . '\>') > 0 | |
128 | + return a:val["name"] . '->' | |
129 | + else | |
130 | + return a:val["name"] . '.' | |
131 | + endif | |
132 | + endif | |
133 | + endif | |
134 | + return a:val["name"] | |
135 | +endfunction | |
136 | + | |
137 | + | |
119 | 138 | " Find composing type in "lead" and match items[0] with it. |
120 | 139 | " Repeat this recursively for items[1], if it's there. |
121 | 140 | " Return the list of matches. |
@@ -236,18 +255,34 @@ | ||
236 | 255 | function! s:SearchMembers(matches, items) |
237 | 256 | let res = [] |
238 | 257 | for i in range(len(a:matches)) |
239 | - let line = a:matches[i]['tagline'] | |
240 | - let e = matchend(line, '\ttypename:') | |
241 | - if e > 0 | |
242 | - " Use typename field | |
243 | - let name = matchstr(line, '[^\t]*', e) | |
258 | + let typename = '' | |
259 | + if has_key(a:matches[i], 'dict') | |
260 | + "if a:matches[i].dict['name'] == "gui" | |
261 | + "echomsg string(a:matches[i].dict) | |
262 | + "endif | |
263 | + if has_key(a:matches[i].dict, 'typename') | |
264 | + let typename = a:matches[i].dict['typename'] | |
265 | + endif | |
266 | + let line = "\t" . a:matches[i].dict['cmd'] | |
267 | + else | |
268 | + let line = a:matches[i]['tagline'] | |
269 | + let e = matchend(line, '\ttypename:') | |
270 | + if e > 0 | |
271 | + " Use typename field | |
272 | + let typename = matchstr(line, '[^\t]*', e) | |
273 | + endif | |
274 | + endif | |
275 | + if typename != '' | |
244 | 276 | call extend(res, s:StructMembers(name, a:items)) |
245 | 277 | else |
246 | 278 | " Use the search command (the declaration itself). |
247 | 279 | let s = match(line, '\t\zs/^') |
248 | 280 | if s > 0 |
249 | - let e = match(line, a:matches[i]['match'], s) | |
281 | + let e = match(line, '\<' . a:matches[i]['match'] . '\>', s) | |
250 | 282 | if e > 0 |
283 | + "if a:matches[i].dict['name'] == "gui" | |
284 | + "echomsg strpart(line, s, e - s) | |
285 | + "endif | |
251 | 286 | call extend(res, s:Nextitem(strpart(line, s, e - s), a:items)) |
252 | 287 | endif |
253 | 288 | endif |
@@ -1,4 +1,4 @@ | ||
1 | -*eval.txt* For Vim version 7.0aa. Last change: 2006 Jan 24 | |
1 | +*eval.txt* For Vim version 7.0aa. Last change: 2006 Jan 29 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -2374,6 +2374,8 @@ | ||
2374 | 2374 | :let l = filter(copy(mylist), '& =~ "KEEP"') |
2375 | 2375 | |
2376 | 2376 | < Returns {expr}, the List or Dictionary that was filtered. |
2377 | + When an error is encountered while evaluating {string} no | |
2378 | + further items in {expr} are processed. | |
2377 | 2379 | |
2378 | 2380 | |
2379 | 2381 | finddir({name}[, {path}[, {count}]]) *finddir()* |
@@ -2700,7 +2702,8 @@ | ||
2700 | 2702 | Returns a list with all the entries in the location list for |
2701 | 2703 | window {nr}. When {nr} is zero the current window is used. |
2702 | 2704 | For a location list window, the displayed location list is |
2703 | - returned. Otherwise, same as getqflist(). | |
2705 | + returned. For an invalid window number {nr}, an empty list is | |
2706 | + returned. Otherwise, same as getqflist(). | |
2704 | 2707 | |
2705 | 2708 | getqflist() *getqflist()* |
2706 | 2709 | Returns a list with all the current quickfix errors. Each |
@@ -3263,6 +3266,8 @@ | ||
3263 | 3266 | :let tlist = map(copy(mylist), ' & . "\t"') |
3264 | 3267 | |
3265 | 3268 | < Returns {expr}, the List or Dictionary that was filtered. |
3269 | + When an error is encountered while evaluating {string} no | |
3270 | + further items in {expr} are processed. | |
3266 | 3271 | |
3267 | 3272 | |
3268 | 3273 | maparg({name}[, {mode}]) *maparg()* |
@@ -3982,7 +3987,8 @@ | ||
3982 | 3987 | setloclist({nr}, {list} [, {action}]) *setloclist()* |
3983 | 3988 | Create or replace or add to the location list for window {nr}. |
3984 | 3989 | When {nr} is zero the current window is used. For a location |
3985 | - list window, the displayed location list is modified. | |
3990 | + list window, the displayed location list is modified. For an | |
3991 | + invalid window number {nr}, -1 is returned. | |
3986 | 3992 | Otherwise, same as setqflist(). |
3987 | 3993 | |
3988 | 3994 | setqflist({list} [, {action}]) *setqflist()* |
@@ -4411,16 +4417,16 @@ | ||
4411 | 4417 | Returns a list of tags matching the regular expression {expr}. |
4412 | 4418 | Each list item is a dictionary with at least the following |
4413 | 4419 | entries: |
4414 | - name name of the tag. | |
4415 | - filename name of the file where the tag is | |
4420 | + name Name of the tag. | |
4421 | + filename Name of the file where the tag is | |
4416 | 4422 | defined. |
4417 | 4423 | cmd Ex command used to locate the tag in |
4418 | 4424 | the file. |
4419 | - kind type of the tag. The value for this | |
4425 | + kind Type of the tag. The value for this | |
4420 | 4426 | entry depends on the language specific |
4421 | 4427 | kind values generated by the ctags |
4422 | 4428 | tool. |
4423 | - static a file specific tag. Refer to | |
4429 | + static A file specific tag. Refer to | |
4424 | 4430 | |static-tag| for more information. |
4425 | 4431 | The "kind" entry is only available when using Exuberant ctags |
4426 | 4432 | generated tags file. More entries may be present, depending |
@@ -1,4 +1,4 @@ | ||
1 | -*insert.txt* For Vim version 7.0aa. Last change: 2006 Jan 08 | |
1 | +*insert.txt* For Vim version 7.0aa. Last change: 2006 Jan 29 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -871,8 +871,8 @@ | ||
871 | 871 | User defined completion *compl-function* |
872 | 872 | |
873 | 873 | Completion is done by a function that can be defined by the user with the |
874 | -'completefunc' option. See the 'completefunc' help for how the function | |
875 | -is called and an example. | |
874 | +'completefunc' option. See below for how the function is called and an | |
875 | +example |complete-functions|. | |
876 | 876 | |
877 | 877 | *i_CTRL-X_CTRL-U* |
878 | 878 | CTRL-X CTRL-U Guess what kind of item is in front of the cursor and |
@@ -890,7 +890,7 @@ | ||
890 | 890 | Completion is done by a function that can be defined by the user with the |
891 | 891 | 'omnifunc' option. This is to be used for filetype-specific completion. |
892 | 892 | |
893 | -See the 'completefunc' help for how the function is called and an example. | |
893 | +See below for how the function is called and an example |complete-functions|. | |
894 | 894 | For remarks about specific filetypes see |compl-omni-filetypes|. |
895 | 895 | |
896 | 896 | *i_CTRL-X_CTRL-O* |
@@ -952,6 +952,94 @@ | ||
952 | 952 | other contexts unless a double CTRL-X is used. |
953 | 953 | |
954 | 954 | |
955 | +FUNCTIONS FOR FINDING COMPLETIONS *complete-functions* | |
956 | + | |
957 | +This applies to 'completefunc' and 'omnifunc'. | |
958 | + | |
959 | +The function will be invoked with two arguments. First the function is called | |
960 | +to find the start of the text to be completed. Secondly the function is | |
961 | +called to actually find the matches. | |
962 | + | |
963 | +On the first invocation the arguments are: | |
964 | + a:findstart 1 | |
965 | + a:base empty | |
966 | + | |
967 | +The function must return the column of where the completion starts. It must | |
968 | +be a number between zero and the cursor column "col('.')". This involves | |
969 | +looking at the characters just before the cursor and including those | |
970 | +characters that could be part of the completed item. The text between this | |
971 | +column and the cursor column will be replaced with the matches. Return -1 if | |
972 | +no completion can be done. | |
973 | + | |
974 | +On the second invocation the arguments are: | |
975 | + a:findstart 0 | |
976 | + a:base the text with which matches should match, what was | |
977 | + located in the first call (can be empty) | |
978 | + | |
979 | +The function must return a List with the matching words. These matches | |
980 | +usually include the "a:base" text. When there are no matches return an empty | |
981 | +List. When one of the items in the list cannot be used as a string (e.g., a | |
982 | +Dictionary) then an error message is given and further items in the list are | |
983 | +not used. | |
984 | + | |
985 | +When searching for matches takes some time call |complete_add()| to add each | |
986 | +match to the total list. These matches should then not appear in the returned | |
987 | +list! Call |complete_check()| now and then to allow the user to press a key | |
988 | +while still searching for matches. Stop searching when it returns non-zero. | |
989 | + | |
990 | +The function may move the cursor, it is restored afterwards. This option | |
991 | +cannot be set from a |modeline| or in the |sandbox|, for security reasons. | |
992 | + | |
993 | +An example that completes the names of the months: > | |
994 | + fun! CompleteMonths(findstart, base) | |
995 | + if a:findstart | |
996 | + " locate the start of the word | |
997 | + let line = getline('.') | |
998 | + let start = col('.') - 1 | |
999 | + while start > 0 && line[start - 1] =~ '\a' | |
1000 | + let start -= 1 | |
1001 | + endwhile | |
1002 | + return start | |
1003 | + else | |
1004 | + " find months matching with "a:base" | |
1005 | + let res = [] | |
1006 | + for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec") | |
1007 | + if m =~ '^' . a:base | |
1008 | + call add(res, m) | |
1009 | + endif | |
1010 | + endfor | |
1011 | + return res | |
1012 | + endif | |
1013 | + endfun | |
1014 | + set completefunc=CompleteMonths | |
1015 | +< | |
1016 | +The same, but now pretending searching for matches is slow: > | |
1017 | + fun! CompleteMonths(findstart, base) | |
1018 | + if a:findstart | |
1019 | + " locate the start of the word | |
1020 | + let line = getline('.') | |
1021 | + let start = col('.') - 1 | |
1022 | + while start > 0 && line[start - 1] =~ '\a' | |
1023 | + let start -= 1 | |
1024 | + endwhile | |
1025 | + return start | |
1026 | + else | |
1027 | + " find months matching with "a:base" | |
1028 | + for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec") | |
1029 | + if m =~ '^' . a:base | |
1030 | + call complete_add(m) | |
1031 | + endif | |
1032 | + sleep 300m " simulate searching for next match | |
1033 | + if complete_check() | |
1034 | + break | |
1035 | + endif | |
1036 | + endfor | |
1037 | + return [] | |
1038 | + endif | |
1039 | + endfun | |
1040 | + set completefunc=CompleteMonths | |
1041 | +< | |
1042 | + | |
955 | 1043 | INSERT COMPLETION POPUP MENU *ins-completion-menu* |
956 | 1044 | *popupmenu-completion* |
957 | 1045 | Vim can display the matches in a simplistic popup menu. |
@@ -1,4 +1,4 @@ | ||
1 | -*options.txt* For Vim version 7.0aa. Last change: 2006 Jan 23 | |
1 | +*options.txt* For Vim version 7.0aa. Last change: 2006 Jan 29 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -1183,6 +1183,7 @@ | ||
1183 | 1183 | autocommands. {not available when compiled without the |
1184 | 1184 | |+autocmd| feature} |
1185 | 1185 | quickfix quickfix buffer, contains list of errors |:cwindow| |
1186 | + or list of locations |:lwindow| | |
1186 | 1187 | help help buffer (you are not supposed to set this |
1187 | 1188 | manually) |
1188 | 1189 |
@@ -1191,8 +1192,9 @@ | ||
1191 | 1192 | |
1192 | 1193 | Be careful with changing this option, it can have many side effects! |
1193 | 1194 | |
1194 | - A "quickfix" buffer is only used for the error list. This value is | |
1195 | - set by the |:cwindow| command and you are not supposed to change it. | |
1195 | + A "quickfix" buffer is only used for the error list and the location | |
1196 | + list. This value is set by the |:cwindow| and |:lwindow| commands and | |
1197 | + you are not supposed to change it. | |
1196 | 1198 | |
1197 | 1199 | "nofile" and "nowrite" buffers are similar: |
1198 | 1200 | both: The buffer is not to be written to disk, ":w" doesn't |
@@ -1611,90 +1613,9 @@ | ||
1611 | 1613 | or +insert_expand feature} |
1612 | 1614 | This option specifies a function to be used for Insert mode completion |
1613 | 1615 | with CTRL-X CTRL-U. |i_CTRL-X_CTRL-U| |
1614 | - | |
1615 | - The function will be invoked with two arguments. First the function | |
1616 | - is called to find the start of the text to be completed. Secondly the | |
1617 | - function is called to actually find the matches. | |
1618 | - | |
1619 | - On the first invocation the arguments are: | |
1620 | - a:findstart 1 | |
1621 | - a:base empty | |
1622 | - | |
1623 | - The function must return the column of where the completion starts. | |
1624 | - It must be a number between zero and the cursor column "col('.')". | |
1625 | - This involves looking at the characters just before the cursor and | |
1626 | - including those characters that could be part of the completed item. | |
1627 | - The text between this column and the cursor column will be replaced | |
1628 | - with the matches. Return -1 if no completion can be done. | |
1629 | - | |
1630 | - On the second invocation the arguments are: | |
1631 | - a:findstart 0 | |
1632 | - a:base the text with which matches should match, what was | |
1633 | - located in the first call (can be empty) | |
1634 | - | |
1635 | - The function must return a List with the matching words. These | |
1636 | - matches usually include the "a:base" text. When there are no matches | |
1637 | - return an empty List. | |
1638 | - | |
1639 | - When searching for matches takes some time call |complete_add()| to | |
1640 | - add each match to the total list. These matches should then not | |
1641 | - appear in the returned list! Call |complete_check()| now and then to | |
1642 | - allow the user to press a key while still searching for matches. Stop | |
1643 | - searching when it returns non-zero. | |
1644 | - | |
1645 | - The function may move the cursor, it is restored afterwards. | |
1646 | - This option cannot be set from a |modeline| or in the |sandbox|, for | |
1647 | - security reasons. | |
1648 | - | |
1649 | - An example that completes the names of the months: > | |
1650 | - fun! CompleteMonths(findstart, base) | |
1651 | - if a:findstart | |
1652 | - " locate the start of the word | |
1653 | - let line = getline('.') | |
1654 | - let start = col('.') - 1 | |
1655 | - while start > 0 && line[start - 1] =~ '\a' | |
1656 | - let start -= 1 | |
1657 | - endwhile | |
1658 | - return start | |
1659 | - else | |
1660 | - " find months matching with "a:base" | |
1661 | - let res = [] | |
1662 | - for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec") | |
1663 | - if m =~ '^' . a:base | |
1664 | - call add(res, m) | |
1665 | - endif | |
1666 | - endfor | |
1667 | - return res | |
1668 | - endif | |
1669 | - endfun | |
1670 | - set completefunc=CompleteMonths | |
1671 | -< | |
1672 | - The same, but now pretending searching for matches is slow: > | |
1673 | - fun! CompleteMonths(findstart, base) | |
1674 | - if a:findstart | |
1675 | - " locate the start of the word | |
1676 | - let line = getline('.') | |
1677 | - let start = col('.') - 1 | |
1678 | - while start > 0 && line[start - 1] =~ '\a' | |
1679 | - let start -= 1 | |
1680 | - endwhile | |
1681 | - return start | |
1682 | - else | |
1683 | - " find months matching with "a:base" | |
1684 | - for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec") | |
1685 | - if m =~ '^' . a:base | |
1686 | - call complete_add(m) | |
1687 | - endif | |
1688 | - sleep 300m " simulate searching for next match | |
1689 | - if complete_check() | |
1690 | - break | |
1691 | - endif | |
1692 | - endfor | |
1693 | - return [] | |
1694 | - endif | |
1695 | - endfun | |
1696 | - set completefunc=CompleteMonths | |
1697 | -< | |
1616 | + See |complete-functions| for an explanation of how the function is | |
1617 | + invoked and what it should return. | |
1618 | + | |
1698 | 1619 | |
1699 | 1620 | *'completeopt'* *'cot'* |
1700 | 1621 | 'completeopt' 'cot' string (default: "menu") |
@@ -4681,7 +4602,8 @@ | ||
4681 | 4602 | or +insert_expand feature} |
4682 | 4603 | This option specifies a function to be used for Insert mode omni |
4683 | 4604 | completion with CTRL-X CTRL-O. |i_CTRL-X_CTRL-O| |
4684 | - For the use of the function see 'completefunc'. | |
4605 | + See |complete-functions| for an explanation of how the function is | |
4606 | + invoked and what it should return. | |
4685 | 4607 | |
4686 | 4608 | |
4687 | 4609 | *'operatorfunc'* *'opfunc'* |
@@ -5802,11 +5724,12 @@ | ||
5802 | 5724 | global |
5803 | 5725 | {not in Vi} |
5804 | 5726 | When on, a <Tab> in front of a line inserts blanks according to |
5805 | - 'shiftwidth'. 'tabstop' is used in other places. A <BS> will delete | |
5806 | - a 'shiftwidth' worth of space at the start of the line. | |
5807 | - When off a <Tab> always inserts blanks according to 'tabstop'. | |
5808 | - 'shiftwidth' is only used for shifting text left or right | |
5809 | - |shift-left-right|. | |
5727 | + 'shiftwidth'. 'tabstop' or 'softtabstop' is used in other places. A | |
5728 | + <BS> will delete a 'shiftwidth' worth of space at the start of the | |
5729 | + line. | |
5730 | + When off a <Tab> always inserts blanks according to 'tabstop' or | |
5731 | + 'softtabstop'. 'shiftwidth' is only used for shifting text left or | |
5732 | + right |shift-left-right|. | |
5810 | 5733 | What gets inserted (a Tab or spaces) depends on the 'expandtab' |
5811 | 5734 | option. Also see |ins-expandtab|. When 'expandtab' is not set, the |
5812 | 5735 | number of spaces is minimized by using <Tab>s. |
@@ -1,4 +1,4 @@ | ||
1 | -*quickfix.txt* For Vim version 7.0aa. Last change: 2006 Jan 26 | |
1 | +*quickfix.txt* For Vim version 7.0aa. Last change: 2006 Jan 29 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -43,13 +43,18 @@ | ||
43 | 43 | compiler (see |errorformat| below). |
44 | 44 | |
45 | 45 | *location-list* *E776* |
46 | -A location list is a window-local quickfix list. Each window can have a | |
47 | -separate location list. A location list can be associated with only one | |
48 | -window. When a window with a location list is split, the new window gets a | |
49 | -copy of the location list. When there are no references to a location list, | |
50 | -the location list is destroyed. | |
46 | +A location list is similar to a quickfix list and contains a list of positions | |
47 | +in files. A location list is associated with a window and each window can | |
48 | +have a separate location list. A location list can be associated with only | |
49 | +one window. The location list is independent of the quickfix list. | |
51 | 50 | |
52 | -The following quickfix commands can be used: | |
51 | +When a window with a location list is split, the new window gets a copy of the | |
52 | +location list. When there are no references to a location list, the location | |
53 | +list is destroyed. | |
54 | + | |
55 | +The following quickfix commands can be used. The location list commands are | |
56 | +similar to the quickfix commands, replacing the 'c' prefix in the quickfix | |
57 | +command with 'l'. | |
53 | 58 | |
54 | 59 | *:cc* |
55 | 60 | :cc[!] [nr] Display error [nr]. If [nr] is omitted, the same |
@@ -265,7 +270,7 @@ | ||
265 | 270 | current window. Works only when the location list for |
266 | 271 | the current window is present. You can have more than |
267 | 272 | one location window opened at a time. Otherwise, it |
268 | - acts the same same as ":copen". | |
273 | + acts the same as ":copen". | |
269 | 274 | |
270 | 275 | *:ccl* *:cclose* |
271 | 276 | :ccl[ose] Close the quickfix window. |
@@ -308,9 +313,9 @@ | ||
308 | 313 | triggered. First the 'filetype' option is set to "qf", which triggers the |
309 | 314 | FileType event. Then the BufReadPost event is triggered. This can be used to |
310 | 315 | perform some action on the listed errors. Example: > |
311 | - au BufReadPost quickfix setlocal nomodifiable | |
312 | - \ | silent g/^/s//\=line(".")." "/ | |
313 | - \ | setlocal modifiable | |
316 | + au BufReadPost quickfix setlocal modifiable | |
317 | + \ | silent exe 'g/^/s//\=line(".")." "/' | |
318 | + \ | setlocal nomodifiable | |
314 | 319 | This prepends the line number to each line. Note the use of "\=" in the |
315 | 320 | substitute string of the ":s" command, which is used to evaluate an |
316 | 321 | expression. |
@@ -323,17 +328,26 @@ | ||
323 | 328 | list. |
324 | 329 | |
325 | 330 | *location-list-window* |
326 | -The location list window displays the entries in a location list. When | |
327 | -opening a location list window, it is created just below the current window | |
328 | -and displays the location list for the current window. The location list | |
329 | -window is similar to the quickfix window, except that you can have more than | |
330 | -one location list window opened at a time. | |
331 | +The location list window displays the entries in a location list. When you | |
332 | +open a location list window, it is created below the current window and | |
333 | +displays the location list for the current window. The location list window | |
334 | +is similar to the quickfix window, except that you can have more than one | |
335 | +location list window open at a time. | |
331 | 336 | |
332 | -When an entry is selected from the location list window, the file is opened in | |
333 | -the window with the corresponding location list. If the window is not found, | |
334 | -but the file is opened in another window, then cursor is moved to that window. | |
335 | -Otherwise a new window is opened. The new window gets a copy of the location | |
336 | -list. | |
337 | +When you select a file from the location list window, the following steps are | |
338 | +used to find a window to edit the file: | |
339 | + | |
340 | +1. If a window with the location list displayed in the location list window is | |
341 | + present, then the file is opened in that window. | |
342 | +2. If the above step fails and if the file is already opened in another | |
343 | + window, then that window is used. | |
344 | +3. If the above step fails then an existing window showing a buffer with | |
345 | + 'buftype' not set is used. | |
346 | +4. If the above step fails, then the file is edited in a new window. | |
347 | + | |
348 | +In all of the above cases, if the location list for the selected window is not | |
349 | +yet set, then it is set to the location list displayed in the location list | |
350 | +window. | |
337 | 351 | |
338 | 352 | ============================================================================= |
339 | 353 | 3. Using more than one list of errors *quickfix-error-lists* |
@@ -5398,7 +5398,6 @@ | ||
5398 | 5398 | hebrew.txt hebrew.txt /*hebrew.txt* |
5399 | 5399 | help various.txt /*help* |
5400 | 5400 | help-context help.txt /*help-context* |
5401 | -help-tags tags 1 | |
5402 | 5401 | help-translated various.txt /*help-translated* |
5403 | 5402 | help-xterm-window various.txt /*help-xterm-window* |
5404 | 5403 | help.txt help.txt /*help.txt* |
@@ -1,4 +1,4 @@ | ||
1 | -*todo.txt* For Vim version 7.0aa. Last change: 2006 Jan 26 | |
1 | +*todo.txt* For Vim version 7.0aa. Last change: 2006 Jan 29 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -30,13 +30,27 @@ | ||
30 | 30 | *known-bugs* |
31 | 31 | -------------------- Known bugs and current work ----------------------- |
32 | 32 | |
33 | +Truncating error message keeps one char too many, causes an empty line. | |
34 | + | |
35 | +Variant of ":helpgrep" that uses a location list? How about: | |
36 | + :lhelpgrep (use local list in help window, not current window) | |
37 | + :lgrep | |
38 | + :lvimgrep | |
39 | + :lmake | |
40 | + | |
33 | 41 | ccomplete / omnicomplete: |
42 | +- Also add . or -> when completing struct members. use s:Tag2item() | |
34 | 43 | - When an option is set: In completion mode and the user types (identifier) |
35 | 44 | characters, advance to the first match instead of removing the popup menu. |
36 | 45 | If there is no match remove the selection. (Yegappan Lakshmanan) |
46 | + Keep the current list of all matches. Use the text typed (or completed) so | |
47 | + far to make a second list with only matching entries. | |
37 | 48 | - Complete the longest common match instead of the first match? |
38 | - For all kinds of completions? Configurable? | |
39 | -- Window resize when poup is displayed. | |
49 | + Do this when "longest" is in 'completeopt'. | |
50 | + Pressing CTRL-N or CTRL-P will get the whole match, as before. | |
51 | + Need to postpone inserting anything until all matches have been found. | |
52 | + Then add a completion item with the longest common string (after what was | |
53 | + typed), if there is one. | |
40 | 54 | - When completing something that is a structure, add the "." or "->" right |
41 | 55 | away. How to figure out if it's a pointer or not? |
42 | 56 | - When a typedef or struct is local to a file only use it in that file? |
@@ -52,11 +66,10 @@ | ||
52 | 66 | a specific selection (e.g, methods vs variables). |
53 | 67 | - Provide a function to popup the menu, so that an insert mode mapping can |
54 | 68 | start it (with a specific selection). |
55 | -- !_TAG_FILE_FORMAT and it's ilk are listed in the global completions | |
56 | - Can't reproduce it right now... | |
57 | 69 | |
58 | 70 | spelling: |
59 | 71 | - Also use the spelling dictionary for dictionary completion. |
72 | + When 'dictionary' is empty and/or when "kspell" is in 'complete'. | |
60 | 73 | - Use runtime/cleanadd script to cleanup .add files. When to invoke it? |
61 | 74 | After deleting a word with "zw" and some timestamp difference perhaps? |
62 | 75 | Store it as spell/cleanadd.vim. |
@@ -3781,6 +3794,8 @@ | ||
3781 | 3794 | are reflected in each Vim immediately. Could work with local files but |
3782 | 3795 | also over the internet. See http://www.codingmonkeys.de/subethaedit/. |
3783 | 3796 | |
3797 | +When using "do" or ":diffget" in a buffer with changes in every line an extra | |
3798 | +empty line would appear. | |
3784 | 3799 | |
3785 | 3800 | vim:tw=78:sw=4:sts=4:ts=8:ft=help:norl: |
3786 | 3801 | vim: set fo+=n : |
@@ -1,4 +1,4 @@ | ||
1 | -*version7.txt* For Vim version 7.0aa. Last change: 2006 Jan 26 | |
1 | +*version7.txt* For Vim version 7.0aa. Last change: 2006 Jan 28 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -1624,4 +1624,9 @@ | ||
1624 | 1624 | normal vy" was used. Don't clear the command line unless the mode was |
1625 | 1625 | actually displayed. Added the "mode_displayed" variable. |
1626 | 1626 | |
1627 | +The "load session" toolbar item could not handle a space or other special | |
1628 | +characters in v:this_session. | |
1629 | + | |
1630 | +":set sta ts=8 sw=4 sts=2" deleted 4 spaces halfway a line instead of 2. | |
1631 | + | |
1627 | 1632 | vim:tw=78:ts=8:ft=help:norl: |
@@ -1,4 +1,4 @@ | ||
1 | -*windows.txt* For Vim version 7.0aa. Last change: 2006 Jan 19 | |
1 | +*windows.txt* For Vim version 7.0aa. Last change: 2006 Jan 27 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -992,9 +992,11 @@ | ||
992 | 992 | Split window and edit buffer for {filename} from the buffer |
993 | 993 | list. This will also edit a buffer that is not in the buffer |
994 | 994 | list, without setting the 'buflisted' flag. |
995 | + Note: If what you want to do is split the buffer, make a copy | |
996 | + under another name, you can do it this way: > | |
997 | + :w foobar | sp # | |
995 | 998 | |
996 | - *:bn* *:bnext* *E87* | |
997 | -:[N]bn[ext][!] [N] | |
999 | +:[N]bn[ext][!] [N] *:bn* *:bnext* *E87* | |
998 | 1000 | Go to [N]th next buffer in buffer list. [N] defaults to one. |
999 | 1001 | Wraps around the end of the buffer list. |
1000 | 1002 | See |:buffer-!| for [!]. |
@@ -1089,9 +1091,10 @@ | ||
1089 | 1091 | |
1090 | 1092 | A few useful kinds of a buffer: |
1091 | 1093 | |
1092 | -quickfix Used to contain the error list. See |:cwindow|. This command | |
1093 | - sets the 'buftype' option to "quickfix". You are not supposed | |
1094 | - to change this! 'swapfile' is off. | |
1094 | +quickfix Used to contain the error list or the location list. See | |
1095 | + |:cwindow| and |:lwindow|. This command sets the 'buftype' | |
1096 | + option to "quickfix". You are not supposed to change this! | |
1097 | + 'swapfile' is off. | |
1095 | 1098 | |
1096 | 1099 | help Contains a help file. Will only be created with the |:help| |
1097 | 1100 | command. The flag that indicates a help buffer is internal |
@@ -1,9 +1,9 @@ | ||
1 | -" VHDL indent file ('93 syntax) | |
1 | +" VHDL indent ('93 syntax) | |
2 | 2 | " Language: VHDL |
3 | 3 | " Maintainer: Gerald Lai <laigera+vim?gmail.com> |
4 | -" Credits: N. J. Heo & Janez Stangelj | |
5 | -" Version: 1.1 | |
6 | -" Last Change: 2006 Jan 25 | |
4 | +" Version: 1.2 | |
5 | +" Last Change: 2006 Jan 26 | |
6 | +" URL: http://www.vim.org/scripts/script.php?script_id=1450 | |
7 | 7 | |
8 | 8 | " only load this indent file when no other was loaded |
9 | 9 | if exists("b:did_indent") |
@@ -78,6 +78,17 @@ | ||
78 | 78 | " backup default |
79 | 79 | let ind2 = ind |
80 | 80 | |
81 | + " indent: special; kill string so it would not affect other filters | |
82 | + " keywords: "report" + string | |
83 | + " where: anywhere in current or previous line | |
84 | + let s0 = s:NC.'\<report\>\s*".*"' | |
85 | + if curs =~? s0 | |
86 | + let curs = "" | |
87 | + endif | |
88 | + if prevs =~? s0 | |
89 | + let prevs = "" | |
90 | + endif | |
91 | + | |
81 | 92 | " indent: previous line's comment position, otherwise follow next non-comment line if possible |
82 | 93 | " keyword: "--" |
83 | 94 | " where: start of current line |
@@ -124,9 +135,9 @@ | ||
124 | 135 | endif |
125 | 136 | |
126 | 137 | " indent: align conditional/select statement |
127 | - " keywords: "<=" without ";" ending | |
128 | - " where: anywhere in previous line | |
129 | - if prevs =~ s:NC.'<=[^;]*'.s:ES | |
138 | + " keywords: variable + "<=" without ";" ending | |
139 | + " where: start of previous line | |
140 | + if prevs =~? '^\s*\S\+\s*<=[^;]*'.s:ES | |
130 | 141 | return matchend(prevs, '<=\s*\ze.') |
131 | 142 | endif |
132 | 143 |
@@ -156,13 +167,13 @@ | ||
156 | 167 | let t = indent(pn) |
157 | 168 | if ps !~ '^\s*--' && t < ind |
158 | 169 | " make sure one of these is true |
170 | + " keywords: variable + "<=" without ";" ending | |
171 | + " where: start of previous non-comment line | |
159 | 172 | " keywords: "generic", "map", "port" |
160 | 173 | " where: anywhere in previous non-comment line |
161 | 174 | " keyword: "(" |
162 | 175 | " where: start of previous non-comment line |
163 | - " keywords: "<=" without ";" ending | |
164 | - " where: anywhere in previous non-comment line | |
165 | - if m < 3 && ps !~ s:NC.'<=[^;]*'.s:ES | |
176 | + if m < 3 && ps !~? '^\s*\S\+\s*<=[^;]*'.s:ES | |
166 | 177 | if ps =~? s:NC.'\<\%(generic\|map\|port\)\>' || ps =~ '^\s*(' |
167 | 178 | let ind = t |
168 | 179 | endif |
@@ -236,38 +247,38 @@ | ||
236 | 247 | return 0 |
237 | 248 | endif |
238 | 249 | |
239 | - " indent: follow indent of previous opening statement | |
250 | + " indent: maintain indent of previous opening statement | |
240 | 251 | " keyword: "is" |
241 | 252 | " where: start of current line |
242 | 253 | " find previous opening statement of |
243 | 254 | " keywords: "architecture", "block", "configuration", "entity", "function", "package", "procedure", "process", "type" |
244 | 255 | if curs =~? '^\s*\<is\>' && prevs =~? s:NC.s:NE.'\<\%(architecture\|block\|configuration\|entity\|function\|package\|procedure\|process\|type\)\>' |
245 | - return indent(prevn) | |
256 | + return ind2 | |
246 | 257 | endif |
247 | 258 | |
248 | - " indent: follow indent of previous opening statement | |
259 | + " indent: maintain indent of previous opening statement | |
249 | 260 | " keyword: "then" |
250 | 261 | " where: start of current line |
251 | 262 | " find previous opening statement of |
252 | 263 | " keywords: "elsif", "if" |
253 | 264 | if curs =~? '^\s*\<then\>' && (prevs =~? s:NC.'\<elsif\>' || prevs =~? s:NC.s:NE.'\<if\>') |
254 | - return indent(prevn) | |
265 | + return ind2 | |
255 | 266 | endif |
256 | 267 | |
257 | - " indent: follow indent of previous opening statement | |
268 | + " indent: maintain indent of previous opening statement | |
258 | 269 | " keyword: "generate" |
259 | 270 | " where: start of current line |
260 | 271 | " find previous opening statement of |
261 | 272 | " keywords: "for", "if" |
262 | - if curs =~? '^\s*\<generate\>' && (prevs =~? s:NC.'\<for\>' || prevs =~? s:NC.s:NE.'\<if\>') | |
263 | - return indent(prevn) | |
273 | + if curs =~? '^\s*\<generate\>' && (prevs =~? s:NC.s:NE.'\%(\<wait\s\+\)\@<!\<for\>' || prevs =~? s:NC.s:NE.'\<if\>') | |
274 | + return ind2 | |
264 | 275 | endif |
265 | 276 | |
266 | 277 | " indent: +sw |
267 | - " keywords: "block", "for", "loop", "process", "record", "units" | |
278 | + " keywords: "block", "loop", "process", "record", "units" | |
268 | 279 | " removed: "case", "if" |
269 | 280 | " where: anywhere in previous line |
270 | - if prevs =~? s:NC.s:NE.'\<\%(block\|for\|loop\|process\|record\|units\)\>' | |
281 | + if prevs =~? s:NC.s:NE.'\<\%(block\|loop\|process\|record\|units\)\>' | |
271 | 282 | return ind + &sw |
272 | 283 | endif |
273 | 284 |
@@ -280,10 +291,10 @@ | ||
280 | 291 | endif |
281 | 292 | |
282 | 293 | " indent: +sw |
283 | - " keywords: "architecture", "component", "configuration", "entity", "package" | |
284 | - " removed: "package", "when", "with" | |
294 | + " keywords: "architecture", "component", "configuration", "entity", "for", "package" | |
295 | + " removed: "when", "with" | |
285 | 296 | " where: start of previous line |
286 | - if prevs =~? '^\s*\%(architecture\|component\|configuration\|entity\|package\)\>' | |
297 | + if prevs =~? '^\s*\%(architecture\|component\|configuration\|entity\|for\|package\)\>' | |
287 | 298 | return ind + &sw |
288 | 299 | endif |
289 | 300 |
@@ -319,33 +330,60 @@ | ||
319 | 330 | endif |
320 | 331 | |
321 | 332 | " indent: -sw |
322 | - " keywords: "end" + "block", "component", "for", "function", "generate", "if", "loop", "procedure", "process", "record", "units" | |
333 | + " keywords: "end" + "block", "for", "function", "generate", "if", "loop", "procedure", "process", "record", "units" | |
323 | 334 | " where: start of current line |
324 | 335 | " keyword: ")" |
325 | 336 | " where: start of current line |
326 | - if curs =~? '^\s*end\s\+\%(block\|component\|for\|function\|generate\|if\|loop\|procedure\|process\|record\|units\)\>' || curs =~ '^\s*)' | |
337 | + if curs =~? '^\s*end\s\+\%(block\|for\|function\|generate\|if\|loop\|procedure\|process\|record\|units\)\>' || curs =~ '^\s*)' | |
327 | 338 | return ind - &sw |
328 | 339 | endif |
329 | 340 | |
330 | - " indent: backtrace previous non-comment lines; -sw if begin with "when", follow if begin with "case" | |
331 | - " keyword: "end" + "case" | |
341 | + " indent: backtrace previous non-comment lines | |
342 | + " keyword: "end" + "case", "component" | |
332 | 343 | " where: start of current line |
344 | + let m = 0 | |
333 | 345 | if curs =~? '^\s*end\s\+case\>' |
346 | + let m = 1 | |
347 | + elseif curs =~? '^\s*end\s\+component\>' | |
348 | + let m = 2 | |
349 | + endif | |
350 | + | |
351 | + if m > 0 | |
334 | 352 | " find following previous non-comment line |
335 | 353 | let pn = prevn |
336 | 354 | let ps = getline(pn) |
337 | 355 | while pn > 0 |
338 | 356 | if ps !~ '^\s*--' |
339 | - if ps =~? '^\s*when\>' | |
340 | - return indent(pn) - &sw | |
341 | - elseif ps =~? '^\s*case\>' | |
342 | - return indent(pn) | |
357 | + "indent: -2sw | |
358 | + "keywords: "end" + "case" | |
359 | + "where: start of previous non-comment line | |
360 | + "indent: -sw | |
361 | + "keywords: "when" | |
362 | + "where: start of previous non-comment line | |
363 | + "indent: follow | |
364 | + "keywords: "case" | |
365 | + "where: start of previous non-comment line | |
366 | + if m == 1 | |
367 | + if ps =~? '^\s*end\s\+case\>' | |
368 | + return indent(pn) - 2 * &sw | |
369 | + elseif ps =~? '^\s*when\>' | |
370 | + return indent(pn) - &sw | |
371 | + elseif ps =~? '^\s*case\>' | |
372 | + return indent(pn) | |
373 | + endif | |
374 | + "indent: follow | |
375 | + "keyword: "component" | |
376 | + "where: anywhere in previous non-comment line | |
377 | + elseif m == 2 | |
378 | + if ps =~? s:NC.s:NE.'\<component\>' | |
379 | + return indent(pn) | |
380 | + endif | |
343 | 381 | endif |
344 | 382 | endif |
345 | 383 | let pn = prevnonblank(pn - 1) |
346 | 384 | let ps = getline(pn) |
347 | 385 | endwhile |
348 | - return ind | |
386 | + return ind - &sw | |
349 | 387 | endif |
350 | 388 | |
351 | 389 | " indent: 0 |
@@ -363,7 +401,7 @@ | ||
363 | 401 | endif |
364 | 402 | |
365 | 403 | " **************************************************************************************** |
366 | - " indent: maintain default | |
404 | + " indent: maintain indent of previous opening statement | |
367 | 405 | " keywords: without "generic", "map", "port" + ":" but not ":=" + "in", "out", "inout", "buffer", "linkage", variable & ":=" |
368 | 406 | " where: anywhere in current line |
369 | 407 | if curs =~? s:NC.'\%(\<\%(generic\|map\|port\)\>.*\)\@<!:[^=]\@=\s*\%(\%(in\|out\|inout\|buffer\|linkage\)\>\|\w\+\s\+:=\)' |
@@ -2,7 +2,7 @@ | ||
2 | 2 | " You can also use this as a start for your own set of menus. |
3 | 3 | " |
4 | 4 | " Maintainer: Bram Moolenaar <Bram@vim.org> |
5 | -" Last Change: 2005 Oct 01 | |
5 | +" Last Change: 2006 Jan 27 | |
6 | 6 | |
7 | 7 | " Note that ":an" (short for ":anoremenu") is often used to make a menu work |
8 | 8 | " in all modes and avoid side effects from mappings defined by the user. |
@@ -1034,7 +1034,7 @@ | ||
1034 | 1034 | " Select a session to load; default to current session name if present |
1035 | 1035 | fun! s:LoadVimSesn() |
1036 | 1036 | if strlen(v:this_session) > 0 |
1037 | - let name = v:this_session | |
1037 | + let name = escape(v:this_session, ' \t#%$|<>"*?[{`') | |
1038 | 1038 | else |
1039 | 1039 | let name = "Session.vim" |
1040 | 1040 | endif |
@@ -1046,7 +1046,7 @@ | ||
1046 | 1046 | if strlen(v:this_session) == 0 |
1047 | 1047 | let v:this_session = "Session.vim" |
1048 | 1048 | endif |
1049 | - execute "browse mksession! " . v:this_session | |
1049 | + execute "browse mksession! " . escape(v:this_session, ' \t#%$|<>"*?[{`') | |
1050 | 1050 | endfun |
1051 | 1051 | |
1052 | 1052 | endif |
@@ -4,12 +4,11 @@ | ||
4 | 4 | # aap generate all the .spl files |
5 | 5 | # aap diff create all the diff files |
6 | 6 | |
7 | +# "hu" is at the end, because it takes a very long time. | |
7 | 8 | LANG = af am bg ca cs cy da de el en eo es fr fo ga gd gl he hr id it ku |
8 | 9 | la lt lv mg mi ms nb nl nn ny pl pt ro ru rw sk sl sv sw |
9 | 10 | tet th tl tn uk yi zu hu |
10 | 11 | |
11 | -# "hu" is at the end, because it takes a very long time. | |
12 | -# | |
13 | 12 | # TODO: |
14 | 13 | # Finnish doesn't work, the dictionary fi_FI.zip file contains hyphenation... |
15 | 14 |
@@ -1893,6 +1893,7 @@ | ||
1893 | 1893 | buf_T *buf; |
1894 | 1894 | int start_skip, end_skip; |
1895 | 1895 | int new_count; |
1896 | + int buf_empty; | |
1896 | 1897 | |
1897 | 1898 | /* Find the current buffer in the list of diff buffers. */ |
1898 | 1899 | idx_cur = diff_buf_idx(curbuf); |
@@ -2047,9 +2048,12 @@ | ||
2047 | 2048 | end_skip = 0; |
2048 | 2049 | } |
2049 | 2050 | |
2051 | + buf_empty = FALSE; | |
2050 | 2052 | added = 0; |
2051 | 2053 | for (i = 0; i < count; ++i) |
2052 | 2054 | { |
2055 | + /* remember deleting the last line of the buffer */ | |
2056 | + buf_empty = curbuf->b_ml.ml_line_count == 1; | |
2053 | 2057 | ml_delete(lnum, FALSE); |
2054 | 2058 | --added; |
2055 | 2059 | } |
@@ -2066,6 +2070,13 @@ | ||
2066 | 2070 | ml_append(lnum + i - 1, p, 0, FALSE); |
2067 | 2071 | vim_free(p); |
2068 | 2072 | ++added; |
2073 | + if (buf_empty && curbuf->b_ml.ml_line_count == 2) | |
2074 | + { | |
2075 | + /* Added the first line into an empty buffer, need to | |
2076 | + * delete the dummy empty line. */ | |
2077 | + buf_empty = FALSE; | |
2078 | + ml_delete((linenr_T)2, FALSE); | |
2079 | + } | |
2069 | 2080 | } |
2070 | 2081 | } |
2071 | 2082 | new_count = dp->df_count[idx_to] + added; |
@@ -111,8 +111,7 @@ | ||
111 | 111 | static int ins_compl_make_cyclic __ARGS((void)); |
112 | 112 | static void ins_compl_upd_pum __ARGS((void)); |
113 | 113 | static void ins_compl_del_pum __ARGS((void)); |
114 | -static int pum_wanted __ARGS((void)); | |
115 | -static void ins_compl_show_pum __ARGS((void)); | |
114 | +static int pum_wanted __ARGS((void)); | |
116 | 115 | static void ins_compl_dictionaries __ARGS((char_u *dict, char_u *pat, int dir, int flags, int thesaurus)); |
117 | 116 | static void ins_compl_free __ARGS((void)); |
118 | 117 | static void ins_compl_clear __ARGS((void)); |
@@ -2193,7 +2192,7 @@ | ||
2193 | 2192 | /* |
2194 | 2193 | * Show the popup menu for the list of matches. |
2195 | 2194 | */ |
2196 | - static void | |
2195 | + void | |
2197 | 2196 | ins_compl_show_pum() |
2198 | 2197 | { |
2199 | 2198 | compl_T *compl; |
@@ -2266,13 +2265,14 @@ | ||
2266 | 2265 | pum_display(compl_match_array, compl_match_arraysize, cur, |
2267 | 2266 | curwin->w_cline_row + W_WINROW(curwin), |
2268 | 2267 | curwin->w_cline_height, |
2269 | - curwin->w_wcol + W_WINCOL(curwin)); | |
2268 | + curwin->w_wcol + W_WINCOL(curwin) - curwin->w_leftcol); | |
2270 | 2269 | curwin->w_cursor.col = col; |
2271 | 2270 | } |
2272 | 2271 | } |
2273 | 2272 | |
2274 | 2273 | #define DICT_FIRST (1) /* use just first element in "dict" */ |
2275 | 2274 | #define DICT_EXACT (2) /* "dict" is the exact name of a file */ |
2275 | + | |
2276 | 2276 | /* |
2277 | 2277 | * Add any identifiers that match the given pattern to the list of |
2278 | 2278 | * completions. |
@@ -2842,6 +2842,8 @@ | ||
2842 | 2842 | ((char_u **)ga.ga_data)[ga.ga_len] = vim_strsave(p); |
2843 | 2843 | ++ga.ga_len; |
2844 | 2844 | } |
2845 | + else if (did_emsg) | |
2846 | + break; | |
2845 | 2847 | } |
2846 | 2848 | |
2847 | 2849 | list_unref(matchlist); |
@@ -3367,9 +3369,6 @@ | ||
3367 | 3369 | /* may undisplay the popup menu first */ |
3368 | 3370 | ins_compl_upd_pum(); |
3369 | 3371 | |
3370 | - /* Display the current match. */ | |
3371 | - update_screen(0); | |
3372 | - | |
3373 | 3372 | /* display the updated popup menu */ |
3374 | 3373 | ins_compl_show_pum(); |
3375 | 3374 |
@@ -7216,7 +7215,7 @@ | ||
7216 | 7215 | */ |
7217 | 7216 | if ( mode == BACKSPACE_CHAR |
7218 | 7217 | && ((p_sta && in_indent) |
7219 | - || (curbuf->b_p_sts | |
7218 | + || (curbuf->b_p_sts != 0 | |
7220 | 7219 | && (*(ml_get_cursor() - 1) == TAB |
7221 | 7220 | || (*(ml_get_cursor() - 1) == ' ' |
7222 | 7221 | && (!*inserted_space_p |
@@ -7228,7 +7227,7 @@ | ||
7228 | 7227 | int extra = 0; |
7229 | 7228 | |
7230 | 7229 | *inserted_space_p = FALSE; |
7231 | - if (p_sta) | |
7230 | + if (p_sta && in_indent) | |
7232 | 7231 | ts = curbuf->b_p_sw; |
7233 | 7232 | else |
7234 | 7233 | ts = curbuf->b_p_sts; |
@@ -517,7 +517,6 @@ | ||
517 | 517 | static void f_getftime __ARGS((typval_T *argvars, typval_T *rettv)); |
518 | 518 | static void f_getftype __ARGS((typval_T *argvars, typval_T *rettv)); |
519 | 519 | static void f_getline __ARGS((typval_T *argvars, typval_T *rettv)); |
520 | -static void f_getloclist __ARGS((typval_T *argvars, typval_T *rettv)); | |
521 | 520 | static void f_getqflist __ARGS((typval_T *argvars, typval_T *rettv)); |
522 | 521 | static void f_getreg __ARGS((typval_T *argvars, typval_T *rettv)); |
523 | 522 | static void f_getregtype __ARGS((typval_T *argvars, typval_T *rettv)); |
@@ -6866,7 +6865,7 @@ | ||
6866 | 6865 | {"getftime", 1, 1, f_getftime}, |
6867 | 6866 | {"getftype", 1, 1, f_getftype}, |
6868 | 6867 | {"getline", 1, 2, f_getline}, |
6869 | - {"getloclist", 1, 1, f_getloclist}, | |
6868 | + {"getloclist", 1, 1, f_getqflist}, | |
6870 | 6869 | {"getqflist", 0, 0, f_getqflist}, |
6871 | 6870 | {"getreg", 0, 2, f_getreg}, |
6872 | 6871 | {"getregtype", 0, 1, f_getregtype}, |
@@ -7179,7 +7178,8 @@ | ||
7179 | 7178 | |
7180 | 7179 | /* |
7181 | 7180 | * Call a function with its resolved parameters |
7182 | - * Return OK or FAIL. | |
7181 | + * Return OK when the function can't be called, FAIL otherwise. | |
7182 | + * Also returns OK when an error was encountered while executing the function. | |
7183 | 7183 | */ |
7184 | 7184 | static int |
7185 | 7185 | call_func(name, len, rettv, argcount, argvars, firstline, lastline, |
@@ -8829,7 +8829,7 @@ | ||
8829 | 8829 | int rem; |
8830 | 8830 | int todo; |
8831 | 8831 | char_u *msg = map ? (char_u *)"map()" : (char_u *)"filter()"; |
8832 | - | |
8832 | + int save_called_emsg; | |
8833 | 8833 | |
8834 | 8834 | rettv->vval.v_number = 0; |
8835 | 8835 | if (argvars[0].v_type == VAR_LIST) |
@@ -8859,6 +8859,12 @@ | ||
8859 | 8859 | prepare_vimvar(VV_VAL, &save_val); |
8860 | 8860 | expr = skipwhite(expr); |
8861 | 8861 | |
8862 | + /* We reset "called_emsg" to be able to detect whether an error | |
8863 | + * occurred during evaluation of the expression. "did_emsg" can't be | |
8864 | + * used, because it is reset when calling a function. */ | |
8865 | + save_called_emsg = called_emsg; | |
8866 | + called_emsg = FALSE; | |
8867 | + | |
8862 | 8868 | if (argvars[0].v_type == VAR_DICT) |
8863 | 8869 | { |
8864 | 8870 | prepare_vimvar(VV_KEY, &save_key); |
@@ -8876,7 +8882,8 @@ | ||
8876 | 8882 | if (tv_check_lock(di->di_tv.v_lock, msg)) |
8877 | 8883 | break; |
8878 | 8884 | vimvars[VV_KEY].vv_str = vim_strsave(di->di_key); |
8879 | - if (filter_map_one(&di->di_tv, expr, map, &rem) == FAIL) | |
8885 | + if (filter_map_one(&di->di_tv, expr, map, &rem) == FAIL | |
8886 | + || called_emsg) | |
8880 | 8887 | break; |
8881 | 8888 | if (!map && rem) |
8882 | 8889 | dictitem_remove(d, di); |
@@ -8894,7 +8901,8 @@ | ||
8894 | 8901 | if (tv_check_lock(li->li_tv.v_lock, msg)) |
8895 | 8902 | break; |
8896 | 8903 | nli = li->li_next; |
8897 | - if (filter_map_one(&li->li_tv, expr, map, &rem) == FAIL) | |
8904 | + if (filter_map_one(&li->li_tv, expr, map, &rem) == FAIL | |
8905 | + || called_emsg) | |
8898 | 8906 | break; |
8899 | 8907 | if (!map && rem) |
8900 | 8908 | listitem_remove(l, li); |
@@ -8902,6 +8910,8 @@ | ||
8902 | 8910 | } |
8903 | 8911 | |
8904 | 8912 | restore_vimvar(VV_VAL, &save_val); |
8913 | + | |
8914 | + called_emsg |= save_called_emsg; | |
8905 | 8915 | } |
8906 | 8916 | |
8907 | 8917 | copy_tv(&argvars[0], rettv); |
@@ -9795,18 +9805,18 @@ | ||
9795 | 9805 | get_buffer_lines(curbuf, lnum, end, retlist, rettv); |
9796 | 9806 | } |
9797 | 9807 | |
9798 | -static void get_qf_ll_ist __ARGS((win_T *wp, typval_T *rettv)); | |
9799 | - | |
9800 | -/* | |
9801 | - * Shared by getqflist() and getloclist() functions | |
9802 | - */ | |
9803 | - static void | |
9804 | -get_qf_ll_ist(wp, rettv) | |
9805 | - win_T *wp; | |
9808 | +/* | |
9809 | + * "getqflist()" and "getloclist()" functions | |
9810 | + */ | |
9811 | +/*ARGSUSED*/ | |
9812 | + static void | |
9813 | +f_getqflist(argvars, rettv) | |
9814 | + typval_T *argvars; | |
9806 | 9815 | typval_T *rettv; |
9807 | 9816 | { |
9808 | 9817 | #ifdef FEAT_QUICKFIX |
9809 | 9818 | list_T *l; |
9819 | + win_T *wp; | |
9810 | 9820 | #endif |
9811 | 9821 | |
9812 | 9822 | rettv->vval.v_number = FALSE; |
@@ -9817,40 +9827,17 @@ | ||
9817 | 9827 | rettv->vval.v_list = l; |
9818 | 9828 | rettv->v_type = VAR_LIST; |
9819 | 9829 | ++l->lv_refcount; |
9830 | + wp = NULL; | |
9831 | + if (argvars[0].v_type != VAR_UNKNOWN) /* getloclist() */ | |
9832 | + { | |
9833 | + wp = find_win_by_nr(&argvars[0]); | |
9834 | + if (wp == NULL) | |
9835 | + return; | |
9836 | + } | |
9837 | + | |
9820 | 9838 | (void)get_errorlist(wp, l); |
9821 | 9839 | } |
9822 | 9840 | #endif |
9823 | - | |
9824 | -} | |
9825 | - | |
9826 | -/* | |
9827 | - * "getloclist()" function | |
9828 | - */ | |
9829 | -/*ARGSUSED*/ | |
9830 | - static void | |
9831 | -f_getloclist(argvars, rettv) | |
9832 | - typval_T *argvars; | |
9833 | - typval_T *rettv; | |
9834 | -{ | |
9835 | - win_T *win; | |
9836 | - | |
9837 | - rettv->vval.v_number = FALSE; | |
9838 | - | |
9839 | - win = find_win_by_nr(&argvars[0]); | |
9840 | - if (win != NULL) | |
9841 | - get_qf_ll_ist(win, rettv); | |
9842 | -} | |
9843 | - | |
9844 | -/* | |
9845 | - * "getqflist()" function | |
9846 | - */ | |
9847 | -/*ARGSUSED*/ | |
9848 | - static void | |
9849 | -f_getqflist(argvars, rettv) | |
9850 | - typval_T *argvars; | |
9851 | - typval_T *rettv; | |
9852 | -{ | |
9853 | - get_qf_ll_ist(NULL, rettv); | |
9854 | 9841 | } |
9855 | 9842 | |
9856 | 9843 | /* |
@@ -5122,10 +5122,7 @@ | ||
5122 | 5122 | for (j = 0; pat[i][j] != NUL; ++j) |
5123 | 5123 | { |
5124 | 5124 | if (pat[i][j] == '`') |
5125 | - { | |
5126 | 5125 | intick = !intick; |
5127 | - *p++ = pat[i][j]; | |
5128 | - } | |
5129 | 5126 | else if (pat[i][j] == '\\' && pat[i][j + 1] != NUL) |
5130 | 5127 | { |
5131 | 5128 | /* Remove a backslash, take char literally. But keep |
@@ -5134,19 +5131,16 @@ | ||
5134 | 5131 | if (intick |
5135 | 5132 | || vim_strchr(SHELL_SPECIAL, pat[i][j + 1]) != NULL) |
5136 | 5133 | *p++ = '\\'; |
5137 | - *p++ = pat[i][++j]; | |
5134 | + ++j; | |
5138 | 5135 | } |
5139 | 5136 | else if (!intick && vim_strchr(SHELL_SPECIAL, |
5140 | 5137 | pat[i][j]) != NULL) |
5141 | - { | |
5142 | 5138 | /* Put a backslash before a special character, but not |
5143 | 5139 | * when inside ``. */ |
5144 | 5140 | *p++ = '\\'; |
5145 | - *p++ = pat[i][j]; | |
5146 | - } | |
5147 | - else | |
5148 | - /* Simply copy the character. */ | |
5149 | - *p++ = pat[i][++j]; | |
5141 | + | |
5142 | + /* Copy one character. */ | |
5143 | + *p++ = pat[i][j]; | |
5150 | 5144 | } |
5151 | 5145 | *p = NUL; |
5152 | 5146 | #endif |
@@ -9,6 +9,7 @@ | ||
9 | 9 | int vim_is_ctrl_x_key __ARGS((int c)); |
10 | 10 | int ins_compl_add_infercase __ARGS((char_u *str, int len, char_u *fname, int dir, int flags)); |
11 | 11 | int ins_compl_add __ARGS((char_u *str, int len, char_u *fname, int dir, int flags)); |
12 | +void ins_compl_show_pum __ARGS((void)); | |
12 | 13 | char_u *find_word_start __ARGS((char_u *ptr)); |
13 | 14 | char_u *find_word_end __ARGS((char_u *ptr)); |
14 | 15 | void ins_compl_check_keys __ARGS((int frequency)); |
@@ -3318,7 +3318,7 @@ | ||
3318 | 3318 | |
3319 | 3319 | if (wp != NULL) |
3320 | 3320 | { |
3321 | - qi = ll_get_or_alloc_list(curwin); | |
3321 | + qi = ll_get_or_alloc_list(wp); | |
3322 | 3322 | if (qi == NULL) |
3323 | 3323 | return FAIL; |
3324 | 3324 | } |
@@ -521,6 +521,7 @@ | ||
521 | 521 | int match_ok; |
522 | 522 | long nmatched; |
523 | 523 | int submatch = 0; |
524 | + int save_called_emsg = called_emsg; | |
524 | 525 | #ifdef FEAT_SEARCH_EXTRA |
525 | 526 | int break_loop = FALSE; |
526 | 527 | #else |
@@ -552,9 +553,9 @@ | ||
552 | 553 | else |
553 | 554 | extra_col = 1; |
554 | 555 | |
555 | -/* | |
556 | - * find the string | |
557 | - */ | |
556 | + /* | |
557 | + * find the string | |
558 | + */ | |
558 | 559 | called_emsg = FALSE; |
559 | 560 | do /* loop for count */ |
560 | 561 | { |
@@ -865,6 +866,8 @@ | ||
865 | 866 | |
866 | 867 | vim_free(regmatch.regprog); |
867 | 868 | |
869 | + called_emsg |= save_called_emsg; | |
870 | + | |
868 | 871 | if (!found) /* did not find it */ |
869 | 872 | { |
870 | 873 | if (got_int) |
@@ -3140,7 +3140,15 @@ | ||
3140 | 3140 | else |
3141 | 3141 | { |
3142 | 3142 | update_topline(); |
3143 | - update_screen(NOT_VALID); | |
3143 | +#if defined(FEAT_INS_EXPAND) | |
3144 | + if (pum_visible()) | |
3145 | + { | |
3146 | + redraw_later(NOT_VALID); | |
3147 | + ins_compl_show_pum(); /* This includes the redraw. */ | |
3148 | + } | |
3149 | + else | |
3150 | +#endif | |
3151 | + update_screen(NOT_VALID); | |
3144 | 3152 | if (redrawing()) |
3145 | 3153 | setcursor(); |
3146 | 3154 | } |
@@ -36,5 +36,5 @@ | ||
36 | 36 | #define VIM_VERSION_NODOT "vim70aa" |
37 | 37 | #define VIM_VERSION_SHORT "7.0aa" |
38 | 38 | #define VIM_VERSION_MEDIUM "7.0aa ALPHA" |
39 | -#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Jan 26)" | |
40 | -#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Jan 26, compiled " | |
39 | +#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Jan 29)" | |
40 | +#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Jan 29, compiled " |