mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-02 11:19:22 +02:00
Compare commits
60 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 831e48f10b | |||
| e091a4b25c | |||
| c81299684b | |||
| 6a8ede99dd | |||
| 15eedf1d62 | |||
| 7a40ea2138 | |||
| 2b2207ba69 | |||
| e2d74dbe19 | |||
| e2c6037da3 | |||
| e362c3d2c3 | |||
| d7a96151e0 | |||
| ca24e2cfcf | |||
| 423977d3ce | |||
| 88c8df3f81 | |||
| 560379d7ae | |||
| 33ed6029da | |||
| ec2da36ca4 | |||
| 41baa7983a | |||
| bf5eddebf1 | |||
| 25b0e6b701 | |||
| 23c9e8b3bc | |||
| a5f2cc0333 | |||
| 8822744b4d | |||
| 5e4e1b1299 | |||
| eb46f8fa14 | |||
| 6e78e27b8a | |||
| 4007ed4a5e | |||
| d61e8aaae5 | |||
| 58f60ca2fc | |||
| 6d721c7e10 | |||
| de318c5c35 | |||
| 369b6f57c4 | |||
| 97d62d4321 | |||
| c011a3d083 | |||
| a9d23c2087 | |||
| e32bbded64 | |||
| 1b9750d805 | |||
| 42b8d916c7 | |||
| 4f391796b7 | |||
| 810f9c361c | |||
| 296b1f28ca | |||
| 9506cad7a1 | |||
| d5069d644e | |||
| fe6ce331d9 | |||
| 5869cf060e | |||
| fad609d067 | |||
| 2b7bc567b9 | |||
| 7173b47958 | |||
| e47683a091 | |||
| 519d7785f4 | |||
| 83381f7129 | |||
| 9be7c04e6c | |||
| 40bc4e9b8d | |||
| 9b73c4a215 | |||
| e13b9afe12 | |||
| 0bdef250b2 | |||
| 70bcd7336f | |||
| 972c3b8f1b | |||
| b8f7bd68f6 | |||
| a1fa892939 |
@@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 8.0. Last change: 2016 Sep 27
|
||||
*autocmd.txt* For Vim version 8.0. Last change: 2017 Jan 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -33,7 +33,7 @@ files matching *.c. You can also use autocommands to implement advanced
|
||||
features, such as editing compressed files (see |gzip-example|). The usual
|
||||
place to put autocommands is in your .vimrc or .exrc file.
|
||||
|
||||
*E203* *E204* *E143* *E855*
|
||||
*E203* *E204* *E143* *E855* *E937*
|
||||
WARNING: Using autocommands is very powerful, and may lead to unexpected side
|
||||
effects. Be careful not to destroy your text.
|
||||
- It's a good idea to do some testing on an expendable copy of a file first.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Jan 08
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Jan 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -5256,6 +5256,7 @@ json_decode({string}) *json_decode()*
|
||||
- A trailing comma in an array and object is ignored.
|
||||
- More floating point numbers are recognized, e.g. "1." for
|
||||
"1.0".
|
||||
However, a duplicate key in an object is not allowed. *E938*
|
||||
The result must be a valid Vim type:
|
||||
- An empty object member name is not allowed.
|
||||
- Duplicate object member names are not allowed.
|
||||
@@ -7249,7 +7250,7 @@ strcharpart({src}, {start}[, {len}]) *strcharpart()*
|
||||
Like |strpart()| but using character index and length instead
|
||||
of byte index and length.
|
||||
When a character index is used where a character does not
|
||||
exist it is assumed to be one byte. For example: >
|
||||
exist it is assumed to be one character. For example: >
|
||||
strcharpart('abc', -1, 2)
|
||||
< results in 'a'.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.0. Last change: 2017 Jan 02
|
||||
*options.txt* For Vim version 8.0. Last change: 2017 Jan 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -3430,7 +3430,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
*'formatprg'* *'fp'*
|
||||
'formatprg' 'fp' string (default "")
|
||||
global
|
||||
global or local to buffer |global-local|
|
||||
{not in Vi}
|
||||
The name of an external program that will be used to format the lines
|
||||
selected with the |gq| operator. The program must take the input on
|
||||
@@ -5296,7 +5296,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
{not in Vi} *E21*
|
||||
When off the buffer contents cannot be changed. The 'fileformat' and
|
||||
'fileencoding' options also can't be changed.
|
||||
Can be reset with the |-M| command line argument.
|
||||
Can be reset on startup with the |-M| command line argument.
|
||||
|
||||
*'modified'* *'mod'* *'nomodified'* *'nomod'*
|
||||
'modified' 'mod' boolean (default off)
|
||||
@@ -5991,6 +5991,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
buffer, unless the 'Z' flag is in 'cpoptions'.
|
||||
{not in Vi:} When using the ":view" command the 'readonly' option is
|
||||
set for the newly edited buffer.
|
||||
See 'modifiable' for disallowing changes to the buffer.
|
||||
|
||||
*'redrawtime'* *'rdt'*
|
||||
'redrawtime' 'rdt' number (default 2000)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*starting.txt* For Vim version 8.0. Last change: 2016 Nov 24
|
||||
*starting.txt* For Vim version 8.0. Last change: 2017 Jan 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -230,6 +230,7 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
|
||||
the executable "view" has the same effect as the -R argument.
|
||||
The 'updatecount' option will be set to 10000, meaning that
|
||||
the swap file will not be updated automatically very often.
|
||||
See |-M| for disallowing modifications.
|
||||
|
||||
*-m*
|
||||
-m Modifications not allowed to be written. The 'write' option
|
||||
@@ -1220,7 +1221,7 @@ There are several ways to exit Vim:
|
||||
- Use `:cquit`. Also when there are changes.
|
||||
|
||||
When using `:cquit` or when there was an error message Vim exits with exit
|
||||
code 1. Errors can be avoided by using `:silent!`.
|
||||
code 1. Errors can be avoided by using `:silent!` or with `:catch`.
|
||||
|
||||
==============================================================================
|
||||
8. Saving settings *save-settings*
|
||||
|
||||
@@ -4539,6 +4539,8 @@ E933 eval.txt /*E933*
|
||||
E934 sign.txt /*E934*
|
||||
E935 eval.txt /*E935*
|
||||
E936 autocmd.txt /*E936*
|
||||
E937 autocmd.txt /*E937*
|
||||
E938 eval.txt /*E938*
|
||||
E94 windows.txt /*E94*
|
||||
E95 message.txt /*E95*
|
||||
E96 diff.txt /*E96*
|
||||
|
||||
@@ -89,6 +89,18 @@ an external command (e.g., "!!"), the terminal will be put into Normal mode
|
||||
for a moment. This means that you can stop the output to the screen by
|
||||
hitting a printing key. Output resumes when you hit <BS>.
|
||||
|
||||
*xterm-bracketed-paste*
|
||||
When the 't_BE' option is set then 't_BE' will be sent to the
|
||||
terminal when entering "raw" mode and 't_BD' when leaving "raw" mode. The
|
||||
terminal is then expected to put 't_PS' before pasted text and 't_PE' after
|
||||
pasted text. This way Vim can separate text that is pasted from characters
|
||||
that are typed. The pasted text is handled like when the middle mouse button
|
||||
is used.
|
||||
|
||||
Note that in some situations Vim will not recognize the bracketed paste and
|
||||
you will get the raw text. In other situations Vim will only get the first
|
||||
pasted character and drop the rest, e.g. when using the "r" command.
|
||||
|
||||
*cs7-problem*
|
||||
Note: If the terminal settings are changed after running Vim, you might have
|
||||
an illegal combination of settings. This has been reported on Solaris 2.5
|
||||
@@ -306,6 +318,10 @@ Added by Vim (there are no standard codes for these):
|
||||
|xterm-true-color|
|
||||
t_8b set background color (R, G, B) *t_8b* *'t_8b'*
|
||||
|xterm-true-color|
|
||||
t_BE enable bracketed paste mode *t_BE* *'t_BE'*
|
||||
|xterm-bracketed-paste|
|
||||
t_BD disable bracketed paste mode *t_BD* *'t_BD'*
|
||||
|xterm-bracketed-paste|
|
||||
|
||||
KEY CODES
|
||||
Note: Use the <> form if possible
|
||||
@@ -398,6 +414,8 @@ Note: Use the <> form if possible
|
||||
t_KK <k8> keypad 8 *<k8>* *t_KK* *'t_KK'*
|
||||
t_KL <k9> keypad 9 *<k9>* *t_KL* *'t_KL'*
|
||||
<Mouse> leader of mouse code *<Mouse>*
|
||||
t_PS start of brackted paste |xterm-bracketed-paste| *t_PS* 't_PS'
|
||||
t_PE end of bracketed paste |xterm-bracketed-paste| *t_PE* 't_PE'
|
||||
|
||||
Note about t_so and t_mr: When the termcap entry "so" is not present the
|
||||
entry for "mr" is used. And vice versa. The same is done for "se" and "me".
|
||||
|
||||
+12
-29
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Jan 09
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Jan 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -35,6 +35,8 @@ entered there will not be repeated below, unless there is extra information.
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
get_syn_options() does not respect skip in else part. (Zyx)
|
||||
|
||||
+channel:
|
||||
- Try out background make plugin:
|
||||
https://github.com/AndrewVos/vim-make-background
|
||||
@@ -120,28 +122,10 @@ What if there is an invalid character?
|
||||
|
||||
Include rust files. (Klabnik, #1356)
|
||||
|
||||
More float tests. (Dominique, #1364)
|
||||
|
||||
Patch to avoid ubsan warning for integer overflow. (Dominique, 2016 Dec 26)
|
||||
|
||||
Bug: Json with same key should not give internal error. (Lcd, 2016 Oct 26)
|
||||
Make dict_add give a duplicate key error.
|
||||
|
||||
Patch to make str2nr and str2float work with signed values.
|
||||
(Lemonbody, 2016 Dec 18, #1332)
|
||||
|
||||
Should json_encode()/json_decode() restrict recursiveness?
|
||||
Or avoid recursiveness.
|
||||
|
||||
Patch to fix UBSan error. Is this actually needed?
|
||||
(Yegappan, 2016 Dec 18)
|
||||
|
||||
Allow using json with empty key? Dict already has it.
|
||||
|
||||
Json string with trailing \u should be an error. (Lcd)
|
||||
|
||||
Patch to reset ex_exitvalue after catch. (Christian Brabandt, 2016 Oct 23)
|
||||
|
||||
Patch to deal with changed configure events in GTK 3. (Jan Alexander Steffens,
|
||||
2016 Oct 23 #1193)
|
||||
Remarks from nuko8, 2016 Nov 2.
|
||||
@@ -159,6 +143,9 @@ Patch for :pyx, run python commands depending on the supported version.
|
||||
Patch to avoid warnings for overflow. (Mike Williams, 2016 Dec 16)
|
||||
Update Dec 19.
|
||||
|
||||
When an item in the quickfix list has a file name that does not exist, behave
|
||||
like the item was not a match for :cnext.
|
||||
|
||||
Wrong diff highlighting with three files. (2016 Oct 20, #1186)
|
||||
Also get E749 on exit.
|
||||
Another example in #1309
|
||||
@@ -219,9 +206,6 @@ Or point to nightly builds: https://github.com/vim/vim-win32-installer/releases
|
||||
Problem passing non-UTF-8 strings to Python 3. (Björn Linse, 2016 Sep 11,
|
||||
#1053) With patch, does it work?
|
||||
|
||||
Patch to make finding duplicate tags much faster, using a hashtab. (James
|
||||
McCoy, 2016 Sept 14, #1046) Should work now. Updated Nov 12.
|
||||
>
|
||||
Use ADDR_OTHER instead of ADDR_LINES for many more commands.
|
||||
Add tests for using number larger than number of lines in buffer.
|
||||
|
||||
@@ -251,6 +235,9 @@ Patch to make it possible to extend a list with itself.
|
||||
|
||||
Patch to add Zstandard compressed file support. (Nick Terrell, 2016 Oct 24)
|
||||
|
||||
Patch to add new regexp classes :ident:, :keyword:, :fname:.
|
||||
(ichizok, 2016 Jan 12, #1373)
|
||||
|
||||
Patch to add trim() function. (Bukn, 2016 Nov 25, #1280)
|
||||
|
||||
Patch to add MODIFIED_BY to MSVC build file. (Chen Lei, 2016 Nov 24, #1275)
|
||||
@@ -475,6 +462,9 @@ Should use /usr/local/share/applications or /usr/share/applications.
|
||||
Or use $XDG_DATA_DIRS.
|
||||
Also need to run update-desktop-database (Kuriyama Kazunobu, 2015 Nov 4)
|
||||
|
||||
Test object i{ and it do not behave the same. #1379
|
||||
Do not include the linebreak at the start?
|
||||
|
||||
Patch to have text objects defined by arbitrary single characters. (Daniel
|
||||
Thau, 2013 Nov 20, 2014 Jan 29, 2014 Jan 31)
|
||||
Added tests (James McCoy, 2016 Aug 3). Still needs more work.
|
||||
@@ -972,11 +962,6 @@ highlighted as the cursor line. (Alessandro Ivaldi, 2013 Jun 4)
|
||||
|
||||
Two highlighting bugs. (ZyX, 2013 Aug 18)
|
||||
|
||||
Patch to add the bufferlist() function. (Yegappan Lakshmanan, 2013 May 5)
|
||||
May 17: with winlist() and tabpagelist().
|
||||
May 19: with local variables.
|
||||
May 28: with options
|
||||
|
||||
Patch to support 'u' in interactive substitute. (Christian Brabandt, 2012 Sep
|
||||
28) With tests: Oct 9.
|
||||
|
||||
@@ -1219,8 +1204,6 @@ right type.
|
||||
string() can't parse back "inf" and "nan". Fix documentation or fix code?
|
||||
(ZyX, 2010 Aug 23)
|
||||
|
||||
Make 'formatprg' global-local. (Sung Pae)
|
||||
|
||||
When doing "redir => s:foo" in a script and then "redir END" somewhere else
|
||||
(e.g. in a function) it can't find s:foo.
|
||||
When a script contains "redir => s:foo" but doesn't end redirection, a
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*version8.txt* For Vim version 8.0. Last change: 2016 Dec 10
|
||||
*version8.txt* For Vim version 8.0. Last change: 2017 Jan 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -230,6 +230,7 @@ Ex commands: ~
|
||||
Ex command modifiers: ~
|
||||
|
||||
|:keeppatterns| following command keeps search pattern history
|
||||
|<mods>| supply command modifiers to user defined commands
|
||||
|
||||
|
||||
New and extended functions: ~
|
||||
|
||||
@@ -676,8 +676,14 @@ au BufNewFile,BufRead *.dtd setf dtd
|
||||
" DTS/DSTI (device tree files)
|
||||
au BufNewFile,BufRead *.dts,*.dtsi setf dts
|
||||
|
||||
" EDIF (*.edf,*.edif,*.edn,*.edo)
|
||||
au BufNewFile,BufRead *.ed\(f\|if\|n\|o\) setf edif
|
||||
" EDIF (*.edf,*.edif,*.edn,*.edo) or edn
|
||||
au BufNewFile,BufRead *.ed\(f\|if\|o\) setf edif
|
||||
au BufNewFile,BufRead *.edn
|
||||
\ if getline(1) =~ '^\s*(\s*edif\>' |
|
||||
\ setf edif |
|
||||
\ else |
|
||||
\ setf clojure |
|
||||
\ endif
|
||||
|
||||
" EditorConfig (close enough to dosini)
|
||||
au BufNewFile,BufRead .editorconfig setf dosini
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
" Nikolai Weibull (Add CSS2 support)
|
||||
" Maintainer: Jules Wang <w.jq0722@gmail.com>
|
||||
" URL: https://github.com/JulesWang/css.vim
|
||||
" Last Change: 2015 Apr.17
|
||||
" Last Change: 2017 Jan 14
|
||||
" cssClassName updated by Ryuichi Hayashida Jan 2016
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if !exists("main_syntax")
|
||||
@@ -56,7 +57,7 @@ syn match cssSelectorOp2 "[~|^$*]\?=" contained
|
||||
syn region cssAttributeSelector matchgroup=cssSelectorOp start="\[" end="]" contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ
|
||||
|
||||
" .class and #id
|
||||
syn match cssClassName "\.[A-Za-z][A-Za-z0-9_-]\+" contains=cssClassNameDot
|
||||
syn match cssClassName "\.-\=[A-Za-z_][A-Za-z0-9_-]*" contains=cssClassNameDot
|
||||
syn match cssClassNameDot contained '\.'
|
||||
|
||||
try
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
|
||||
" Former Maintainers: Gerfried Fuchs <alfie@ist.org>
|
||||
" Wichert Akkerman <wakkerma@debian.org>
|
||||
" Last Change: 2016 Aug 30
|
||||
" Last Change: 2016 Nov 12
|
||||
" URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debchangelog.vim
|
||||
|
||||
" Standard syntax initialization
|
||||
@@ -21,7 +21,7 @@ let binNMU='binary-only=yes'
|
||||
syn match debchangelogName contained "^[[:alnum:]][[:alnum:].+-]\+ "
|
||||
exe 'syn match debchangelogFirstKV contained "; \('.urgency.'\|'.binNMU.'\)"'
|
||||
exe 'syn match debchangelogOtherKV contained ", \('.urgency.'\|'.binNMU.'\)"'
|
||||
syn match debchangelogTarget contained "\v %(frozen|unstable|sid|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile|lts|security)|wheezy-%(backports%(-sloppy)=|security)|jessie%(-backports|-security)=|stretch|%(devel|precise|trusty|vivid|wily|xenial|yakkety)%(-%(security|proposed|updates|backports|commercial|partner))=)+"
|
||||
syn match debchangelogTarget contained "\v %(frozen|unstable|sid|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile|lts|security)|wheezy-%(backports%(-sloppy)=|security)|jessie%(-backports|-security)=|stretch|%(devel|precise|trusty|vivid|wily|xenial|yakkety|zesty)%(-%(security|proposed|updates|backports|commercial|partner))=)+"
|
||||
syn match debchangelogVersion contained "(.\{-})"
|
||||
syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*"
|
||||
syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*"
|
||||
|
||||
@@ -38,7 +38,7 @@ unlet s:kernels s:archs s:pairs
|
||||
syn match debcontrolMultiArch contained "\%(no\|foreign\|allowed\|same\)"
|
||||
syn match debcontrolName contained "[a-z0-9][a-z0-9+.-]\+"
|
||||
syn match debcontrolPriority contained "\(extra\|important\|optional\|required\|standard\)"
|
||||
syn match debcontrolSection contained "\v((contrib|non-free|non-US/main|non-US/contrib|non-US/non-free|restricted|universe|multiverse)/)?(admin|cli-mono|comm|database|debian-installer|debug|devel|doc|editors|education|electronics|embedded|fonts|games|gnome|gnustep|gnu-r|graphics|hamradio|haskell|httpd|interpreters|introspection|java|kde|kernel|libs|libdevel|lisp|localization|mail|math|metapackages|misc|net|news|ocaml|oldlibs|otherosfs|perl|php|python|ruby|science|shells|sound|text|tex|utils|vcs|video|web|x11|xfce|zope)"
|
||||
syn match debcontrolSection contained "\v((contrib|non-free|non-US/main|non-US/contrib|non-US/non-free|restricted|universe|multiverse)/)?(admin|cli-mono|comm|database|debian-installer|debug|devel|doc|editors|education|electronics|embedded|fonts|games|gnome|gnustep|gnu-r|graphics|hamradio|haskell|httpd|interpreters|introspection|java|javascript|kde|kernel|libs|libdevel|lisp|localization|mail|math|metapackages|misc|net|news|ocaml|oldlibs|otherosfs|perl|php|python|ruby|rust|science|shells|sound|text|tex|utils|vcs|video|web|x11|xfce|zope)"
|
||||
syn match debcontrolPackageType contained "u\?deb"
|
||||
syn match debcontrolVariable contained "\${.\{-}}"
|
||||
syn match debcontrolDmUpload contained "\cyes"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: Debian sources.list
|
||||
" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
|
||||
" Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
|
||||
" Last Change: 2016 Sep 27
|
||||
" Last Change: 2016 Nov 12
|
||||
" URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debsources.vim
|
||||
|
||||
" Standard syntax initialization
|
||||
@@ -25,7 +25,7 @@ let s:supported = [
|
||||
\ 'oldstable', 'stable', 'testing', 'unstable', 'experimental',
|
||||
\ 'squeeze', 'wheezy', 'jessie', 'stretch', 'sid', 'rc-buggy',
|
||||
\
|
||||
\ 'precise', 'trusty', 'xenial', 'yakkety', 'devel'
|
||||
\ 'precise', 'trusty', 'xenial', 'yakkety', 'zesty', 'devel'
|
||||
\ ]
|
||||
let s:unsupported = [
|
||||
\ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
|
||||
|
||||
@@ -123,7 +123,7 @@ NOTE : En avan
|
||||
Leçon 1.5 : ÉDITION DE TEXTE - AJOUTER
|
||||
|
||||
|
||||
** Appuyez A pour ajouter du text. **
|
||||
** Appuyez A pour ajouter du texte. **
|
||||
|
||||
1. Déplacez le curseur sur la première ligne ci-dessous marquée --->.
|
||||
Peu importe sur quel caractère se trouve le curseur sur cette ligne.
|
||||
@@ -574,7 +574,7 @@ NOTE : Quand la recherche atteint la fin du fichier, elle reprend au d
|
||||
|
||||
2. Puis tapez le caractère % .
|
||||
|
||||
3. Le curseur se déplacera sur la parenthèse out crochet correspondant.
|
||||
3. Le curseur se déplacera sur la parenthèse ou crochet correspondant.
|
||||
|
||||
4. Tapez % pour replacer le curseur sur la parenthèse ou crochet
|
||||
correspondant.
|
||||
@@ -854,17 +854,17 @@ NOTE : Le mode Remplacement est comme le mode Insertion, mais tous les
|
||||
5. Tapez p pour coller le texte. Puis tapez : un second <Échap> .
|
||||
|
||||
6. Utilisez le mode Visuel pour sélectionner "élément", copiez-le avec y ,
|
||||
déplacez-vous à la fin de la ligne suivant avec j$ et collez le texte
|
||||
déplacez-vous à la fin de la ligne suivante avec j$ et collez le texte
|
||||
à cet endroit avec p .
|
||||
|
||||
---> a) ceci est le premier élément.
|
||||
b)
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Leçon 6.4 : RÉGLAGE DES OPTIONS
|
||||
Leçon 6.5 : RÉGLAGE DES OPTIONS
|
||||
|
||||
|
||||
** Réglons une option afin que la recherche et la substitution ignore la
|
||||
** Réglons une option afin que la recherche et la substitution ignorent la
|
||||
casse des caractères. **
|
||||
|
||||
1. Recherchez 'ignore' en tapant : /ignore <Entrée>
|
||||
@@ -1034,5 +1034,5 @@ NOTE : Le compl
|
||||
Dernières mises à jour par Dominique Pellé.
|
||||
|
||||
E-mail : dominique.pelle@gmail.com
|
||||
Last Change : 2016 Nov 08
|
||||
Last Change : 2017 Jan 16
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -123,7 +123,7 @@ NOTE : En avançant dans ce cours, n'essayez pas de mémoriser, apprenez par
|
||||
Leçon 1.5 : ÉDITION DE TEXTE - AJOUTER
|
||||
|
||||
|
||||
** Appuyez A pour ajouter du text. **
|
||||
** Appuyez A pour ajouter du texte. **
|
||||
|
||||
1. Déplacez le curseur sur la première ligne ci-dessous marquée --->.
|
||||
Peu importe sur quel caractère se trouve le curseur sur cette ligne.
|
||||
@@ -574,7 +574,7 @@ NOTE : Quand la recherche atteint la fin du fichier, elle reprend au début
|
||||
|
||||
2. Puis tapez le caractère % .
|
||||
|
||||
3. Le curseur se déplacera sur la parenthèse out crochet correspondant.
|
||||
3. Le curseur se déplacera sur la parenthèse ou crochet correspondant.
|
||||
|
||||
4. Tapez % pour replacer le curseur sur la parenthèse ou crochet
|
||||
correspondant.
|
||||
@@ -854,17 +854,17 @@ NOTE : Le mode Remplacement est comme le mode Insertion, mais tous les
|
||||
5. Tapez p pour coller le texte. Puis tapez : un second <Échap> .
|
||||
|
||||
6. Utilisez le mode Visuel pour sélectionner "élément", copiez-le avec y ,
|
||||
déplacez-vous à la fin de la ligne suivant avec j$ et collez le texte
|
||||
déplacez-vous à la fin de la ligne suivante avec j$ et collez le texte
|
||||
à cet endroit avec p .
|
||||
|
||||
---> a) ceci est le premier élément.
|
||||
b)
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Leçon 6.4 : RÉGLAGE DES OPTIONS
|
||||
Leçon 6.5 : RÉGLAGE DES OPTIONS
|
||||
|
||||
|
||||
** Réglons une option afin que la recherche et la substitution ignore la
|
||||
** Réglons une option afin que la recherche et la substitution ignorent la
|
||||
casse des caractères. **
|
||||
|
||||
1. Recherchez 'ignore' en tapant : /ignore <Entrée>
|
||||
@@ -1034,5 +1034,5 @@ NOTE : Le complètement fonctionne pour de nombreuses commandes. Essayez
|
||||
Dernières mises à jour par Dominique Pellé.
|
||||
|
||||
E-mail : dominique.pelle@gmail.com
|
||||
Last Change : 2016 Nov 08
|
||||
Last Change : 2017 Jan 16
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -1255,7 +1255,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>121</string>
|
||||
<string>122</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
|
||||
+17
-11
@@ -1894,7 +1894,9 @@ myself:
|
||||
|
||||
|
||||
# The normal command to compile a .c file to its .o file.
|
||||
CCC = $(CC) -c -I$(srcdir) $(ALL_CFLAGS)
|
||||
# Without or with ALL_CFLAGS.
|
||||
CCC_NF = $(CC) -c -I$(srcdir)
|
||||
CCC = $(CCC_NF) $(ALL_CFLAGS)
|
||||
|
||||
|
||||
# Link the target for normal use or debugging.
|
||||
@@ -2164,10 +2166,13 @@ test_arglist \
|
||||
test_partial \
|
||||
test_perl \
|
||||
test_popup \
|
||||
test_profile \
|
||||
test_put \
|
||||
test_quickfix \
|
||||
test_regexp_latin \
|
||||
test_regexp_utf8 \
|
||||
test_reltime \
|
||||
test_retab \
|
||||
test_ruby \
|
||||
test_search \
|
||||
test_searchpos \
|
||||
@@ -2998,7 +3003,7 @@ objects/gui_gtk_f.o: gui_gtk_f.c
|
||||
$(CCC) -o $@ gui_gtk_f.c
|
||||
|
||||
objects/gui_gtk_gresources.o: auto/gui_gtk_gresources.c
|
||||
$(CCC) $(PERL_CFLAGS) -o $@ auto/gui_gtk_gresources.c
|
||||
$(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) -o $@ auto/gui_gtk_gresources.c
|
||||
|
||||
objects/gui_gtk_x11.o: gui_gtk_x11.c
|
||||
$(CCC) -o $@ gui_gtk_x11.c
|
||||
@@ -3034,7 +3039,7 @@ objects/if_xcmdsrv.o: if_xcmdsrv.c
|
||||
$(CCC) -o $@ if_xcmdsrv.c
|
||||
|
||||
objects/if_lua.o: if_lua.c
|
||||
$(CCC) $(LUA_CFLAGS) -o $@ if_lua.c
|
||||
$(CCC_NF) $(LUA_CFLAGS) $(ALL_CFLAGS) -o $@ if_lua.c
|
||||
|
||||
objects/if_mzsch.o: if_mzsch.c $(MZSCHEME_EXTRA)
|
||||
$(CCC) -o $@ $(MZSCHEME_CFLAGS_EXTRA) if_mzsch.c
|
||||
@@ -3043,27 +3048,28 @@ mzscheme_base.c:
|
||||
$(MZSCHEME_MZC) --c-mods mzscheme_base.c ++lib scheme/base
|
||||
|
||||
objects/if_perl.o: auto/if_perl.c
|
||||
$(CCC) $(PERL_CFLAGS) -o $@ auto/if_perl.c
|
||||
$(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) -o $@ auto/if_perl.c
|
||||
|
||||
objects/if_perlsfio.o: if_perlsfio.c
|
||||
$(CCC) $(PERL_CFLAGS) -o $@ if_perlsfio.c
|
||||
$(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) -o $@ if_perlsfio.c
|
||||
|
||||
objects/py_getpath.o: $(PYTHON_CONFDIR)/getpath.c
|
||||
$(CCC) $(PYTHON_CFLAGS) -o $@ $(PYTHON_CONFDIR)/getpath.c \
|
||||
$(CCC_NF) $(PYTHON_CFLAGS) $(ALL_CFLAGS) -o $@ \
|
||||
$(PYTHON_CONFDIR)/getpath.c \
|
||||
-I$(PYTHON_CONFDIR) -DHAVE_CONFIG_H -DNO_MAIN \
|
||||
$(PYTHON_GETPATH_CFLAGS)
|
||||
|
||||
objects/if_python.o: if_python.c if_py_both.h
|
||||
$(CCC) $(PYTHON_CFLAGS) $(PYTHON_CFLAGS_EXTRA) -o $@ if_python.c
|
||||
$(CCC_NF) $(PYTHON_CFLAGS) $(PYTHON_CFLAGS_EXTRA) $(ALL_CFLAGS) -o $@ if_python.c
|
||||
|
||||
objects/if_python3.o: if_python3.c if_py_both.h
|
||||
$(CCC) $(PYTHON3_CFLAGS) $(PYTHON3_CFLAGS_EXTRA) -o $@ if_python3.c
|
||||
$(CCC_NF) $(PYTHON3_CFLAGS) $(PYTHON3_CFLAGS_EXTRA) $(ALL_CFLAGS) -o $@ if_python3.c
|
||||
|
||||
objects/if_ruby.o: if_ruby.c
|
||||
$(CCC) $(RUBY_CFLAGS) -o $@ if_ruby.c
|
||||
$(CCC_NF) $(RUBY_CFLAGS) $(ALL_CFLAGS) -o $@ if_ruby.c
|
||||
|
||||
objects/if_tcl.o: if_tcl.c
|
||||
$(CCC) $(TCL_CFLAGS) -o $@ if_tcl.c
|
||||
$(CCC_NF) $(TCL_CFLAGS) $(ALL_CFLAGS) -o $@ if_tcl.c
|
||||
|
||||
objects/integration.o: integration.c
|
||||
$(CCC) -o $@ integration.c
|
||||
@@ -3120,7 +3126,7 @@ objects/ops.o: ops.c
|
||||
$(CCC) -o $@ ops.c
|
||||
|
||||
objects/option.o: option.c
|
||||
$(CCC) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(PYTHON3_CFLAGS) $(RUBY_CFLAGS) $(TCL_CFLAGS) -o $@ option.c
|
||||
$(CCC_NF) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(PYTHON3_CFLAGS) $(RUBY_CFLAGS) $(TCL_CFLAGS) $(ALL_CFLAGS) -o $@ option.c
|
||||
|
||||
objects/os_beos.o: os_beos.c
|
||||
$(CCC) -o $@ os_beos.c
|
||||
|
||||
+8
-5
@@ -113,16 +113,19 @@ read_buffer(
|
||||
* it can be changed there. */
|
||||
if (!readonlymode && !bufempty())
|
||||
changed();
|
||||
else if (retval != FAIL)
|
||||
else if (retval == OK)
|
||||
unchanged(curbuf, FALSE);
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
if (retval == OK)
|
||||
{
|
||||
# ifdef FEAT_EVAL
|
||||
apply_autocmds_retval(EVENT_STDINREADPOST, NULL, NULL, FALSE,
|
||||
apply_autocmds_retval(EVENT_STDINREADPOST, NULL, NULL, FALSE,
|
||||
curbuf, &retval);
|
||||
# else
|
||||
apply_autocmds(EVENT_STDINREADPOST, NULL, NULL, FALSE, curbuf);
|
||||
apply_autocmds(EVENT_STDINREADPOST, NULL, NULL, FALSE, curbuf);
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return retval;
|
||||
@@ -294,7 +297,7 @@ open_buffer(
|
||||
#endif
|
||||
)
|
||||
changed();
|
||||
else if (retval != FAIL && !read_stdin && !read_fifo)
|
||||
else if (retval == OK && !read_stdin && !read_fifo)
|
||||
unchanged(curbuf, FALSE);
|
||||
save_file_ff(curbuf); /* keep this fileformat */
|
||||
|
||||
@@ -328,7 +331,7 @@ open_buffer(
|
||||
# endif
|
||||
#endif
|
||||
|
||||
if (retval != FAIL)
|
||||
if (retval == OK)
|
||||
{
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/*
|
||||
|
||||
+8
-1
@@ -731,7 +731,14 @@ channel_open(
|
||||
channel_free(channel);
|
||||
return NULL;
|
||||
}
|
||||
memcpy((char *)&server.sin_addr, host->h_addr, host->h_length);
|
||||
{
|
||||
char *p;
|
||||
|
||||
/* When using host->h_addr directly ubsan warns for it to not be
|
||||
* aligned. First copy the pointer to aviod that. */
|
||||
memcpy(&p, &host->h_addr, sizeof(p));
|
||||
memcpy((char *)&server.sin_addr, p, host->h_length);
|
||||
}
|
||||
|
||||
/* On Mac and Solaris a zero timeout almost never works. At least wait
|
||||
* one millisecond. Let's do it for all systems, because we don't know why
|
||||
|
||||
+31
-5
@@ -1901,7 +1901,11 @@ vim_str2nr(
|
||||
n += 2; /* skip over "0b" */
|
||||
while ('0' <= *ptr && *ptr <= '1')
|
||||
{
|
||||
un = 2 * un + (unsigned long)(*ptr - '0');
|
||||
/* avoid ubsan error for overflow */
|
||||
if (un < UVARNUM_MAX / 2)
|
||||
un = 2 * un + (unsigned long)(*ptr - '0');
|
||||
else
|
||||
un = UVARNUM_MAX;
|
||||
++ptr;
|
||||
if (n++ == maxlen)
|
||||
break;
|
||||
@@ -1912,7 +1916,11 @@ vim_str2nr(
|
||||
/* octal */
|
||||
while ('0' <= *ptr && *ptr <= '7')
|
||||
{
|
||||
un = 8 * un + (uvarnumber_T)(*ptr - '0');
|
||||
/* avoid ubsan error for overflow */
|
||||
if (un < UVARNUM_MAX / 8)
|
||||
un = 8 * un + (uvarnumber_T)(*ptr - '0');
|
||||
else
|
||||
un = UVARNUM_MAX;
|
||||
++ptr;
|
||||
if (n++ == maxlen)
|
||||
break;
|
||||
@@ -1925,7 +1933,11 @@ vim_str2nr(
|
||||
n += 2; /* skip over "0x" */
|
||||
while (vim_isxdigit(*ptr))
|
||||
{
|
||||
un = 16 * un + (uvarnumber_T)hex2nr(*ptr);
|
||||
/* avoid ubsan error for overflow */
|
||||
if (un < UVARNUM_MAX / 16)
|
||||
un = 16 * un + (uvarnumber_T)hex2nr(*ptr);
|
||||
else
|
||||
un = UVARNUM_MAX;
|
||||
++ptr;
|
||||
if (n++ == maxlen)
|
||||
break;
|
||||
@@ -1936,7 +1948,11 @@ vim_str2nr(
|
||||
/* decimal */
|
||||
while (VIM_ISDIGIT(*ptr))
|
||||
{
|
||||
un = 10 * un + (uvarnumber_T)(*ptr - '0');
|
||||
/* avoid ubsan error for overflow */
|
||||
if (un < UVARNUM_MAX / 10)
|
||||
un = 10 * un + (uvarnumber_T)(*ptr - '0');
|
||||
else
|
||||
un = UVARNUM_MAX;
|
||||
++ptr;
|
||||
if (n++ == maxlen)
|
||||
break;
|
||||
@@ -1950,9 +1966,19 @@ vim_str2nr(
|
||||
if (nptr != NULL)
|
||||
{
|
||||
if (negative) /* account for leading '-' for decimal numbers */
|
||||
*nptr = -(varnumber_T)un;
|
||||
{
|
||||
/* avoid ubsan error for overflow */
|
||||
if (un > VARNUM_MAX)
|
||||
*nptr = VARNUM_MIN;
|
||||
else
|
||||
*nptr = -(varnumber_T)un;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (un > VARNUM_MAX)
|
||||
un = VARNUM_MAX;
|
||||
*nptr = (varnumber_T)un;
|
||||
}
|
||||
}
|
||||
if (unptr != NULL)
|
||||
*unptr = un;
|
||||
|
||||
+105
-5
@@ -309,6 +309,7 @@ static int dont_sync_undo = FALSE; /* CTRL-G U prevents syncing undo for
|
||||
* "cmdchar" can be:
|
||||
* 'i' normal insert command
|
||||
* 'a' normal append command
|
||||
* K_PS bracketed paste
|
||||
* 'R' replace command
|
||||
* 'r' "r<CR>" command: insert one <CR>. Note: count can be > 1, for redo,
|
||||
* but still only one <CR> is inserted. The <Esc> is not used for redo.
|
||||
@@ -782,10 +783,14 @@ edit(
|
||||
dont_sync_undo = TRUE;
|
||||
else
|
||||
dont_sync_undo = FALSE;
|
||||
do
|
||||
{
|
||||
c = safe_vgetc();
|
||||
} while (c == K_IGNORE);
|
||||
if (cmdchar == K_PS)
|
||||
/* Got here from normal mode when bracketed paste started. */
|
||||
c = K_PS;
|
||||
else
|
||||
do
|
||||
{
|
||||
c = safe_vgetc();
|
||||
} while (c == K_IGNORE);
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/* Don't want K_CURSORHOLD for the second key, e.g., after CTRL-V. */
|
||||
@@ -1025,7 +1030,7 @@ doESCkey:
|
||||
case Ctrl_Z: /* suspend when 'insertmode' set */
|
||||
if (!p_im)
|
||||
goto normalchar; /* insert CTRL-Z as normal char */
|
||||
stuffReadbuff((char_u *)":st\r");
|
||||
do_cmdline_cmd((char_u *)"stop");
|
||||
c = Ctrl_O;
|
||||
/*FALLTHROUGH*/
|
||||
|
||||
@@ -1202,6 +1207,16 @@ doESCkey:
|
||||
break;
|
||||
# endif
|
||||
#endif
|
||||
case K_PS:
|
||||
bracketed_paste(PASTE_INSERT, FALSE, NULL);
|
||||
if (cmdchar == K_PS)
|
||||
/* invoked from normal mode, bail out */
|
||||
goto doESCkey;
|
||||
break;
|
||||
case K_PE:
|
||||
/* Got K_PE without K_PS, ignore. */
|
||||
break;
|
||||
|
||||
#ifdef FEAT_GUI_TABLINE
|
||||
case K_TABLINE:
|
||||
case K_TABMENU:
|
||||
@@ -9457,6 +9472,91 @@ ins_mousescroll(int dir)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Handle receiving P_PS: start paste mode. Inserts the following text up to
|
||||
* P_PE literally.
|
||||
* When "drop" is TRUE then consume the text and drop it.
|
||||
*/
|
||||
int
|
||||
bracketed_paste(paste_mode_T mode, int drop, garray_T *gap)
|
||||
{
|
||||
int c;
|
||||
char_u buf[NUMBUFLEN + MB_MAXBYTES];
|
||||
int idx = 0;
|
||||
char_u *end = find_termcode((char_u *)"PE");
|
||||
int ret_char = -1;
|
||||
int save_allow_keys = allow_keys;
|
||||
|
||||
/* If the end code is too long we can't detect it, read everything. */
|
||||
if (STRLEN(end) >= NUMBUFLEN)
|
||||
end = NULL;
|
||||
++no_mapping;
|
||||
allow_keys = 0;
|
||||
for (;;)
|
||||
{
|
||||
/* When the end is not defined read everything. */
|
||||
if (end == NULL && vpeekc() == NUL)
|
||||
break;
|
||||
c = plain_vgetc();
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte)
|
||||
idx += (*mb_char2bytes)(c, buf + idx);
|
||||
else
|
||||
#endif
|
||||
buf[idx++] = c;
|
||||
buf[idx] = NUL;
|
||||
if (end != NUL && STRNCMP(buf, end, idx) == 0)
|
||||
{
|
||||
if (end[idx] == NUL)
|
||||
break; /* Found the end of paste code. */
|
||||
continue;
|
||||
}
|
||||
if (!drop)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case PASTE_CMDLINE:
|
||||
put_on_cmdline(buf, idx, TRUE);
|
||||
break;
|
||||
|
||||
case PASTE_EX:
|
||||
if (gap != NULL && ga_grow(gap, idx) == OK)
|
||||
{
|
||||
mch_memmove((char *)gap->ga_data + gap->ga_len,
|
||||
buf, (size_t)idx);
|
||||
gap->ga_len += idx;
|
||||
}
|
||||
break;
|
||||
|
||||
case PASTE_INSERT:
|
||||
if (stop_arrow() == OK)
|
||||
{
|
||||
ins_char_bytes(buf, idx);
|
||||
AppendToRedobuffLit(buf, idx);
|
||||
}
|
||||
break;
|
||||
|
||||
case PASTE_ONE_CHAR:
|
||||
if (ret_char == -1)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte)
|
||||
ret_char = (*mb_ptr2char)(buf);
|
||||
else
|
||||
#endif
|
||||
ret_char = buf[0];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
idx = 0;
|
||||
}
|
||||
--no_mapping;
|
||||
allow_keys = save_allow_keys;
|
||||
|
||||
return ret_char;
|
||||
}
|
||||
|
||||
#if defined(FEAT_GUI_TABLINE) || defined(PROTO)
|
||||
static void
|
||||
ins_tabline(int c)
|
||||
|
||||
+45
-27
@@ -242,14 +242,38 @@ static void list_one_var(dictitem_T *v, char_u *prefix, int *first);
|
||||
static void list_one_var_a(char_u *prefix, char_u *name, int type, char_u *string, int *first);
|
||||
static char_u *find_option_end(char_u **arg, int *opt_flags);
|
||||
|
||||
#ifdef EBCDIC
|
||||
static int compare_func_name(const void *s1, const void *s2);
|
||||
static void sortFunctions();
|
||||
#endif
|
||||
|
||||
/* for VIM_VERSION_ defines */
|
||||
#include "version.h"
|
||||
|
||||
|
||||
#if defined(EBCDIC) || defined(PROTO)
|
||||
/*
|
||||
* Compare struct fst by function name.
|
||||
*/
|
||||
static int
|
||||
compare_func_name(const void *s1, const void *s2)
|
||||
{
|
||||
struct fst *p1 = (struct fst *)s1;
|
||||
struct fst *p2 = (struct fst *)s2;
|
||||
|
||||
return STRCMP(p1->f_name, p2->f_name);
|
||||
}
|
||||
|
||||
/*
|
||||
* Sort the function table by function name.
|
||||
* The sorting of the table above is ASCII dependant.
|
||||
* On machines using EBCDIC we have to sort it.
|
||||
*/
|
||||
static void
|
||||
sortFunctions(void)
|
||||
{
|
||||
int funcCnt = (int)(sizeof(functions) / sizeof(struct fst)) - 1;
|
||||
|
||||
qsort(functions, (size_t)funcCnt, sizeof(struct fst), compare_func_name);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Initialize the global and v: variables.
|
||||
*/
|
||||
@@ -4085,21 +4109,12 @@ eval6(
|
||||
{
|
||||
if (n2 == 0) /* give an error message? */
|
||||
{
|
||||
#ifdef FEAT_NUM64
|
||||
if (n1 == 0)
|
||||
n1 = -0x7fffffffffffffffLL - 1; /* similar to NaN */
|
||||
n1 = VARNUM_MIN; /* similar to NaN */
|
||||
else if (n1 < 0)
|
||||
n1 = -0x7fffffffffffffffLL;
|
||||
n1 = -VARNUM_MAX;
|
||||
else
|
||||
n1 = 0x7fffffffffffffffLL;
|
||||
#else
|
||||
if (n1 == 0)
|
||||
n1 = -0x7fffffffL - 1L; /* similar to NaN */
|
||||
else if (n1 < 0)
|
||||
n1 = -0x7fffffffL;
|
||||
else
|
||||
n1 = 0x7fffffffL;
|
||||
#endif
|
||||
n1 = VARNUM_MAX;
|
||||
}
|
||||
else
|
||||
n1 = n1 / n2;
|
||||
@@ -9232,6 +9247,8 @@ fill_assert_error(
|
||||
{
|
||||
if (atype == ASSERT_MATCH || atype == ASSERT_NOTMATCH)
|
||||
ga_concat(gap, (char_u *)"Pattern ");
|
||||
else if (atype == ASSERT_NOTEQUAL)
|
||||
ga_concat(gap, (char_u *)"Expected not equal to ");
|
||||
else
|
||||
ga_concat(gap, (char_u *)"Expected ");
|
||||
if (exp_str == NULL)
|
||||
@@ -9241,16 +9258,17 @@ fill_assert_error(
|
||||
}
|
||||
else
|
||||
ga_concat_esc(gap, exp_str);
|
||||
if (atype == ASSERT_MATCH)
|
||||
ga_concat(gap, (char_u *)" does not match ");
|
||||
else if (atype == ASSERT_NOTMATCH)
|
||||
ga_concat(gap, (char_u *)" does match ");
|
||||
else if (atype == ASSERT_NOTEQUAL)
|
||||
ga_concat(gap, (char_u *)" differs from ");
|
||||
else
|
||||
ga_concat(gap, (char_u *)" but got ");
|
||||
ga_concat_esc(gap, tv2string(got_tv, &tofree, numbuf, 0));
|
||||
vim_free(tofree);
|
||||
if (atype != ASSERT_NOTEQUAL)
|
||||
{
|
||||
if (atype == ASSERT_MATCH)
|
||||
ga_concat(gap, (char_u *)" does not match ");
|
||||
else if (atype == ASSERT_NOTMATCH)
|
||||
ga_concat(gap, (char_u *)" does match ");
|
||||
else
|
||||
ga_concat(gap, (char_u *)" but got ");
|
||||
ga_concat_esc(gap, tv2string(got_tv, &tofree, numbuf, 0));
|
||||
vim_free(tofree);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+8
-46
@@ -923,34 +923,6 @@ get_expr_name(expand_T *xp, int idx)
|
||||
|
||||
#endif /* FEAT_CMDL_COMPL */
|
||||
|
||||
#if defined(EBCDIC) || defined(PROTO)
|
||||
/*
|
||||
* Compare struct fst by function name.
|
||||
*/
|
||||
static int
|
||||
compare_func_name(const void *s1, const void *s2)
|
||||
{
|
||||
struct fst *p1 = (struct fst *)s1;
|
||||
struct fst *p2 = (struct fst *)s2;
|
||||
|
||||
return STRCMP(p1->f_name, p2->f_name);
|
||||
}
|
||||
|
||||
/*
|
||||
* Sort the function table by function name.
|
||||
* The sorting of the table above is ASCII dependant.
|
||||
* On machines using EBCDIC we have to sort it.
|
||||
*/
|
||||
static void
|
||||
sortFunctions(void)
|
||||
{
|
||||
int funcCnt = (int)(sizeof(functions) / sizeof(struct fst)) - 1;
|
||||
|
||||
qsort(functions, (size_t)funcCnt, sizeof(struct fst), compare_func_name);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Find internal function in table above.
|
||||
* Return index, or -1 if not found
|
||||
@@ -3332,21 +3304,12 @@ f_float2nr(typval_T *argvars, typval_T *rettv)
|
||||
|
||||
if (get_float_arg(argvars, &f) == OK)
|
||||
{
|
||||
# ifdef FEAT_NUM64
|
||||
if (f < -0x7fffffffffffffffLL)
|
||||
rettv->vval.v_number = -0x7fffffffffffffffLL;
|
||||
else if (f > 0x7fffffffffffffffLL)
|
||||
rettv->vval.v_number = 0x7fffffffffffffffLL;
|
||||
if (f < -VARNUM_MAX)
|
||||
rettv->vval.v_number = -VARNUM_MAX;
|
||||
else if (f > VARNUM_MAX)
|
||||
rettv->vval.v_number = VARNUM_MAX;
|
||||
else
|
||||
rettv->vval.v_number = (varnumber_T)f;
|
||||
# else
|
||||
if (f < -0x7fffffff)
|
||||
rettv->vval.v_number = -0x7fffffff;
|
||||
else if (f > 0x7fffffff)
|
||||
rettv->vval.v_number = 0x7fffffff;
|
||||
else
|
||||
rettv->vval.v_number = (varnumber_T)f;
|
||||
# endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4259,7 +4222,7 @@ f_getchar(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
if (argvars[0].v_type == VAR_UNKNOWN)
|
||||
/* getchar(): blocking wait. */
|
||||
n = safe_vgetc();
|
||||
n = plain_vgetc();
|
||||
else if (get_tv_number_chk(&argvars[0], &error) == 1)
|
||||
/* getchar(1): only check if char avail */
|
||||
n = vpeekc_any();
|
||||
@@ -4268,7 +4231,7 @@ f_getchar(typval_T *argvars, typval_T *rettv)
|
||||
n = 0;
|
||||
else
|
||||
/* getchar(0) and char avail: return char */
|
||||
n = safe_vgetc();
|
||||
n = plain_vgetc();
|
||||
|
||||
if (n == K_IGNORE)
|
||||
continue;
|
||||
@@ -6906,10 +6869,8 @@ f_len(typval_T *argvars, typval_T *rettv)
|
||||
}
|
||||
}
|
||||
|
||||
static void libcall_common(typval_T *argvars, typval_T *rettv, int type);
|
||||
|
||||
static void
|
||||
libcall_common(typval_T *argvars, typval_T *rettv, int type)
|
||||
libcall_common(typval_T *argvars UNUSED, typval_T *rettv, int type)
|
||||
{
|
||||
#ifdef FEAT_LIBCALL
|
||||
char_u *string_in;
|
||||
@@ -11889,6 +11850,7 @@ get_cmd_output_as_rettv(
|
||||
if (buf == NULL)
|
||||
{
|
||||
EMSGN(_(e_nobufnr), argvars[1].vval.v_number);
|
||||
fclose(fd);
|
||||
goto errret;
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -1313,7 +1313,7 @@ do_filter(
|
||||
if (otmp != NULL)
|
||||
{
|
||||
if (readfile(otmp, NULL, line2, (linenr_T)0, (linenr_T)MAXLNUM,
|
||||
eap, READ_FILTER) == FAIL)
|
||||
eap, READ_FILTER) != OK)
|
||||
{
|
||||
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
if (!aborting())
|
||||
@@ -5263,6 +5263,10 @@ do_sub(exarg_T *eap)
|
||||
setmouse(); /* disable mouse in xterm */
|
||||
#endif
|
||||
curwin->w_cursor.col = regmatch.startpos[0].col;
|
||||
#ifdef FEAT_CURSORBIND
|
||||
if (curwin->w_p_crb)
|
||||
do_check_cursorbind();
|
||||
#endif
|
||||
|
||||
/* When 'cpoptions' contains "u" don't sync undo when
|
||||
* asking for confirmation. */
|
||||
|
||||
+18
-16
@@ -5164,24 +5164,10 @@ ex_language(exarg_T *eap)
|
||||
# if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
||||
|
||||
static char_u **locales = NULL; /* Array of all available locales */
|
||||
|
||||
# ifndef WIN32
|
||||
static int did_init_locales = FALSE;
|
||||
|
||||
static void init_locales(void);
|
||||
static char_u **find_locales(void);
|
||||
|
||||
/*
|
||||
* Lazy initialization of all available locales.
|
||||
*/
|
||||
static void
|
||||
init_locales(void)
|
||||
{
|
||||
if (!did_init_locales)
|
||||
{
|
||||
did_init_locales = TRUE;
|
||||
locales = find_locales();
|
||||
}
|
||||
}
|
||||
|
||||
/* Return an array of strings for all available locales + NULL for the
|
||||
* last element. Return NULL in case of error. */
|
||||
static char_u **
|
||||
@@ -5222,6 +5208,22 @@ find_locales(void)
|
||||
((char_u **)locales_ga.ga_data)[locales_ga.ga_len] = NULL;
|
||||
return (char_u **)locales_ga.ga_data;
|
||||
}
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Lazy initialization of all available locales.
|
||||
*/
|
||||
static void
|
||||
init_locales(void)
|
||||
{
|
||||
# ifndef WIN32
|
||||
if (!did_init_locales)
|
||||
{
|
||||
did_init_locales = TRUE;
|
||||
locales = find_locales();
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
# if defined(EXITFREE) || defined(PROTO)
|
||||
void
|
||||
|
||||
+7
-1
@@ -4116,6 +4116,12 @@ set_one_cmd_context(
|
||||
case CMD_echoerr:
|
||||
case CMD_call:
|
||||
case CMD_return:
|
||||
case CMD_cexpr:
|
||||
case CMD_caddexpr:
|
||||
case CMD_cgetexpr:
|
||||
case CMD_lexpr:
|
||||
case CMD_laddexpr:
|
||||
case CMD_lgetexpr:
|
||||
set_context_for_expression(xp, arg, ea.cmdidx);
|
||||
break;
|
||||
|
||||
@@ -8876,7 +8882,7 @@ ex_read(exarg_T *eap)
|
||||
eap->line2, (linenr_T)0, (linenr_T)MAXLNUM, eap, 0);
|
||||
|
||||
}
|
||||
if (i == FAIL)
|
||||
if (i != OK)
|
||||
{
|
||||
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
if (!aborting())
|
||||
|
||||
+8
-3
@@ -210,7 +210,7 @@ filemess(
|
||||
* READ_KEEP_UNDO don't clear undo info or read it from a file
|
||||
* READ_FIFO read from fifo/socket instead of a file
|
||||
*
|
||||
* return FAIL for failure, OK otherwise
|
||||
* return FAIL for failure, NOTDONE for directory (failure), or OK
|
||||
*/
|
||||
int
|
||||
readfile(
|
||||
@@ -450,13 +450,18 @@ readfile(
|
||||
# endif
|
||||
)
|
||||
{
|
||||
int retval = FAIL;
|
||||
|
||||
if (S_ISDIR(perm))
|
||||
{
|
||||
filemess(curbuf, fname, (char_u *)_("is a directory"), 0);
|
||||
retval = NOTDONE;
|
||||
}
|
||||
else
|
||||
filemess(curbuf, fname, (char_u *)_("is not a file"), 0);
|
||||
msg_end();
|
||||
msg_scroll = msg_save;
|
||||
return FAIL;
|
||||
return retval;
|
||||
}
|
||||
#endif
|
||||
#if defined(MSWIN)
|
||||
@@ -7174,7 +7179,7 @@ buf_reload(buf_T *buf, int orig_mode)
|
||||
#endif
|
||||
if (readfile(buf->b_ffname, buf->b_fname, (linenr_T)0,
|
||||
(linenr_T)0,
|
||||
(linenr_T)MAXLNUM, &ea, flags) == FAIL)
|
||||
(linenr_T)MAXLNUM, &ea, flags) != OK)
|
||||
{
|
||||
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
if (!aborting())
|
||||
|
||||
+7
-1
@@ -1817,6 +1817,12 @@ plain_vgetc(void)
|
||||
{
|
||||
c = safe_vgetc();
|
||||
} while (c == K_IGNORE || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR);
|
||||
|
||||
if (c == K_PS)
|
||||
/* Only handle the first pasted character. Drop the rest, since we
|
||||
* don't know what to do with it. */
|
||||
c = bracketed_paste(PASTE_ONE_CHAR, FALSE, NULL);
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
@@ -1906,7 +1912,7 @@ vungetc(int c)
|
||||
}
|
||||
|
||||
/*
|
||||
* get a character:
|
||||
* Get a character:
|
||||
* 1. from the stuffbuffer
|
||||
* This is used for abbreviated commands like "D" -> "d$".
|
||||
* Also used to redo a command for ".".
|
||||
|
||||
@@ -70,7 +70,6 @@ hash_init(hashtab_T *ht)
|
||||
ht->ht_mask = HT_INIT_SIZE - 1;
|
||||
}
|
||||
|
||||
#if defined(FEAT_EVAL) || defined(FEAT_SYN_HL) || defined(PROTO)
|
||||
/*
|
||||
* Free the array of a hash table. Does not free the items it contains!
|
||||
* If "ht" is not freed then you should call hash_init() next!
|
||||
@@ -104,7 +103,6 @@ hash_clear_all(hashtab_T *ht, int off)
|
||||
}
|
||||
hash_clear(ht);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Find "key" in hashtable "ht". "key" must not be NULL.
|
||||
|
||||
+1
-1
@@ -207,7 +207,7 @@ set_context_in_cscope_cmd(
|
||||
static void
|
||||
do_cscope_general(
|
||||
exarg_T *eap,
|
||||
int make_split) /* whether to split window */
|
||||
int make_split UNUSED) /* whether to split window */
|
||||
{
|
||||
cscmd_T *cmdp;
|
||||
|
||||
|
||||
+8
-4
@@ -312,6 +312,7 @@ static void ruby_vim_init(void);
|
||||
# define ruby_init_loadpath dll_ruby_init_loadpath
|
||||
# ifdef WIN3264
|
||||
# define NtInitialize dll_NtInitialize
|
||||
# define ruby_sysinit dll_ruby_sysinit
|
||||
# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
|
||||
# define rb_w32_snprintf dll_rb_w32_snprintf
|
||||
# endif
|
||||
@@ -414,6 +415,7 @@ static void (*dll_ruby_init) (void);
|
||||
static void (*dll_ruby_init_loadpath) (void);
|
||||
# ifdef WIN3264
|
||||
static void (*dll_NtInitialize) (int*, char***);
|
||||
static void (*dll_ruby_sysinit) (int*, char***);
|
||||
# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
|
||||
static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...);
|
||||
# endif
|
||||
@@ -603,13 +605,11 @@ static struct
|
||||
{"ruby_init", (RUBY_PROC*)&dll_ruby_init},
|
||||
{"ruby_init_loadpath", (RUBY_PROC*)&dll_ruby_init_loadpath},
|
||||
# ifdef WIN3264
|
||||
{
|
||||
# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER < 19
|
||||
"NtInitialize",
|
||||
{"NtInitialize", (RUBY_PROC*)&dll_NtInitialize},
|
||||
# else
|
||||
"ruby_sysinit",
|
||||
{"ruby_sysinit", (RUBY_PROC*)&dll_ruby_sysinit},
|
||||
# endif
|
||||
(RUBY_PROC*)&dll_NtInitialize},
|
||||
# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
|
||||
{"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf},
|
||||
# endif
|
||||
@@ -871,7 +871,11 @@ static int ensure_ruby_initialized(void)
|
||||
int argc = 1;
|
||||
char *argv[] = {"gvim.exe"};
|
||||
char **argvp = argv;
|
||||
# ifdef RUBY19_OR_LATER
|
||||
ruby_sysinit(&argc, &argvp);
|
||||
# else
|
||||
NtInitialize(&argc, &argvp);
|
||||
# endif
|
||||
#endif
|
||||
{
|
||||
#if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)
|
||||
|
||||
+9
-5
@@ -629,10 +629,13 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
|
||||
key = p = reader->js_buf + reader->js_used;
|
||||
while (*p != NUL && *p != ':' && *p > ' ')
|
||||
++p;
|
||||
cur_item->v_type = VAR_STRING;
|
||||
cur_item->vval.v_string = vim_strnsave(key, (int)(p - key));
|
||||
if (cur_item != NULL)
|
||||
{
|
||||
cur_item->v_type = VAR_STRING;
|
||||
cur_item->vval.v_string = vim_strnsave(key, (int)(p - key));
|
||||
top_item->jd_key = cur_item->vval.v_string;
|
||||
}
|
||||
reader->js_used += (int)(p - key);
|
||||
top_item->jd_key = cur_item->vval.v_string;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -936,7 +939,7 @@ item_end:
|
||||
&& dict_find(top_item->jd_tv.vval.v_dict,
|
||||
top_item->jd_key, -1) != NULL)
|
||||
{
|
||||
EMSG2(_("E937: Duplicate key in JSON: \"%s\""),
|
||||
EMSG2(_("E938: Duplicate key in JSON: \"%s\""),
|
||||
top_item->jd_key);
|
||||
clear_tv(&top_item->jd_key_tv);
|
||||
clear_tv(cur_item);
|
||||
@@ -1053,7 +1056,8 @@ json_decode(js_read_T *reader, typval_T *res, int options)
|
||||
|
||||
/*
|
||||
* Decode the JSON from "reader" to find the end of the message.
|
||||
* "options" can be JSON_JS or zero;
|
||||
* "options" can be JSON_JS or zero.
|
||||
* This is only used for testing.
|
||||
* Return FAIL if the message has a decoding error.
|
||||
* Return MAYBE if the message is truncated, need to read more.
|
||||
* This only works reliable if the message contains an object, array or
|
||||
|
||||
@@ -107,6 +107,12 @@ test_decode_find_end(void)
|
||||
reader.js_buf = (char_u *)" { ";
|
||||
assert(json_find_end(&reader, 0) == MAYBE);
|
||||
|
||||
/* JS object with white space */
|
||||
reader.js_buf = (char_u *)" { a : 123 } ";
|
||||
assert(json_find_end(&reader, JSON_JS) == OK);
|
||||
reader.js_buf = (char_u *)" { a : ";
|
||||
assert(json_find_end(&reader, JSON_JS) == MAYBE);
|
||||
|
||||
/* array without white space */
|
||||
reader.js_buf = (char_u *)"[\"a\",123]";
|
||||
assert(json_find_end(&reader, 0) == OK);
|
||||
|
||||
+5
-2
@@ -398,6 +398,8 @@ enum key_extra
|
||||
#define K_KMULTIPLY TERMCAP2KEY('K', '9') /* keypad * */
|
||||
#define K_KENTER TERMCAP2KEY('K', 'A') /* keypad Enter */
|
||||
#define K_KPOINT TERMCAP2KEY('K', 'B') /* keypad . or ,*/
|
||||
#define K_PS TERMCAP2KEY('P', 'S') /* paste start */
|
||||
#define K_PE TERMCAP2KEY('P', 'E') /* paste end */
|
||||
|
||||
#define K_K0 TERMCAP2KEY('K', 'C') /* keypad 0 */
|
||||
#define K_K1 TERMCAP2KEY('K', 'D') /* keypad 1 */
|
||||
@@ -494,9 +496,10 @@ enum key_extra
|
||||
|
||||
/*
|
||||
* The length of the longest special key name, including modifiers.
|
||||
* Current longest is <M-C-S-T-4-MiddleRelease> (length includes '<' and '>').
|
||||
* Current longest is <M-C-S-T-D-A-4-ScrollWheelRight> (length includes '<' and
|
||||
* '>').
|
||||
*/
|
||||
#define MAX_KEY_NAME_LEN 25
|
||||
#define MAX_KEY_NAME_LEN 32
|
||||
|
||||
/* Maximum length of a special key event as tokens. This includes modifiers.
|
||||
* The longest event is something like <M-C-S-T-4-LeftDrag> which would be the
|
||||
|
||||
+1
-42
@@ -4583,47 +4583,6 @@ static HINSTANCE hMsvcrtDLL = 0;
|
||||
# define DYNAMIC_MSVCRT_DLL "msvcrt.dll"
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Get the address of 'funcname' which is imported by 'hInst' DLL.
|
||||
*/
|
||||
static void *
|
||||
get_iconv_import_func(HINSTANCE hInst, const char *funcname)
|
||||
{
|
||||
PBYTE pImage = (PBYTE)hInst;
|
||||
PIMAGE_DOS_HEADER pDOS = (PIMAGE_DOS_HEADER)hInst;
|
||||
PIMAGE_NT_HEADERS pPE;
|
||||
PIMAGE_IMPORT_DESCRIPTOR pImpDesc;
|
||||
PIMAGE_THUNK_DATA pIAT; /* Import Address Table */
|
||||
PIMAGE_THUNK_DATA pINT; /* Import Name Table */
|
||||
PIMAGE_IMPORT_BY_NAME pImpName;
|
||||
|
||||
if (pDOS->e_magic != IMAGE_DOS_SIGNATURE)
|
||||
return NULL;
|
||||
pPE = (PIMAGE_NT_HEADERS)(pImage + pDOS->e_lfanew);
|
||||
if (pPE->Signature != IMAGE_NT_SIGNATURE)
|
||||
return NULL;
|
||||
pImpDesc = (PIMAGE_IMPORT_DESCRIPTOR)(pImage
|
||||
+ pPE->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT]
|
||||
.VirtualAddress);
|
||||
for (; pImpDesc->FirstThunk; ++pImpDesc)
|
||||
{
|
||||
if (!pImpDesc->OriginalFirstThunk)
|
||||
continue;
|
||||
pIAT = (PIMAGE_THUNK_DATA)(pImage + pImpDesc->FirstThunk);
|
||||
pINT = (PIMAGE_THUNK_DATA)(pImage + pImpDesc->OriginalFirstThunk);
|
||||
for (; pIAT->u1.Function; ++pIAT, ++pINT)
|
||||
{
|
||||
if (IMAGE_SNAP_BY_ORDINAL(pINT->u1.Ordinal))
|
||||
continue;
|
||||
pImpName = (PIMAGE_IMPORT_BY_NAME)(pImage
|
||||
+ (UINT_PTR)(pINT->u1.AddressOfData));
|
||||
if (strcmp((char *)pImpName->Name, funcname) == 0)
|
||||
return (void *)pIAT->u1.Function;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Try opening the iconv.dll and return TRUE if iconv() can be used.
|
||||
*/
|
||||
@@ -4671,7 +4630,7 @@ iconv_enabled(int verbose)
|
||||
iconv_open = (void *)GetProcAddress(hIconvDLL, "libiconv_open");
|
||||
iconv_close = (void *)GetProcAddress(hIconvDLL, "libiconv_close");
|
||||
iconvctl = (void *)GetProcAddress(hIconvDLL, "libiconvctl");
|
||||
iconv_errno = get_iconv_import_func(hIconvDLL, "_errno");
|
||||
iconv_errno = get_dll_import_func(hIconvDLL, "_errno");
|
||||
if (iconv_errno == NULL)
|
||||
iconv_errno = (void *)GetProcAddress(hMsvcrtDLL, "_errno");
|
||||
if (iconv == NULL || iconv_open == NULL || iconv_close == NULL
|
||||
|
||||
+1
-1
@@ -1519,7 +1519,7 @@ ml_recover(void)
|
||||
line_count = pp->pb_pointer[idx].pe_line_count;
|
||||
if (readfile(curbuf->b_ffname, NULL, lnum,
|
||||
pp->pb_pointer[idx].pe_old_lnum - 1,
|
||||
line_count, NULL, 0) == FAIL)
|
||||
line_count, NULL, 0) != OK)
|
||||
cannot_open = TRUE;
|
||||
else
|
||||
lnum += line_count;
|
||||
|
||||
+2
-2
@@ -578,8 +578,6 @@ emsg(char_u *s)
|
||||
return TRUE;
|
||||
|
||||
called_emsg = TRUE;
|
||||
if (emsg_silent == 0)
|
||||
ex_exitval = 1;
|
||||
|
||||
/*
|
||||
* If "emsg_severe" is TRUE: When an error exception is to be thrown,
|
||||
@@ -642,6 +640,8 @@ emsg(char_u *s)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
ex_exitval = 1;
|
||||
|
||||
/* Reset msg_silent, an error causes messages to be switched back on. */
|
||||
msg_silent = 0;
|
||||
cmd_silent = FALSE;
|
||||
|
||||
+8
-7
@@ -2177,16 +2177,19 @@ ins_bytes_len(char_u *p, int len)
|
||||
void
|
||||
ins_char(int c)
|
||||
{
|
||||
#if defined(FEAT_MBYTE) || defined(PROTO)
|
||||
char_u buf[MB_MAXBYTES + 1];
|
||||
int n;
|
||||
int n = 1;
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
n = (*mb_char2bytes)(c, buf);
|
||||
|
||||
/* When "c" is 0x100, 0x200, etc. we don't want to insert a NUL byte.
|
||||
* Happens for CTRL-Vu9900. */
|
||||
if (buf[0] == 0)
|
||||
buf[0] = '\n';
|
||||
#else
|
||||
buf[0] = c;
|
||||
#endif
|
||||
|
||||
ins_char_bytes(buf, n);
|
||||
}
|
||||
@@ -2195,7 +2198,6 @@ ins_char(int c)
|
||||
ins_char_bytes(char_u *buf, int charlen)
|
||||
{
|
||||
int c = buf[0];
|
||||
#endif
|
||||
int newlen; /* nr of bytes inserted */
|
||||
int oldlen; /* nr of bytes deleted (0 when not replacing) */
|
||||
char_u *p;
|
||||
@@ -2218,11 +2220,7 @@ ins_char_bytes(char_u *buf, int charlen)
|
||||
|
||||
/* The lengths default to the values for when not replacing. */
|
||||
oldlen = 0;
|
||||
#ifdef FEAT_MBYTE
|
||||
newlen = charlen;
|
||||
#else
|
||||
newlen = 1;
|
||||
#endif
|
||||
|
||||
if (State & REPLACE_FLAG)
|
||||
{
|
||||
@@ -4461,6 +4459,9 @@ vim_setenv(char_u *name, char_u *val)
|
||||
{
|
||||
sprintf((char *)envbuf, "%s=%s", name, val);
|
||||
putenv((char *)envbuf);
|
||||
# ifdef libintl_putenv
|
||||
libintl_putenv((char *)envbuf);
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
#ifdef FEAT_GETTEXT
|
||||
|
||||
+11
-2
@@ -2162,6 +2162,7 @@ static struct modmasktable
|
||||
/* 'A' must be the last one */
|
||||
{MOD_MASK_ALT, MOD_MASK_ALT, (char_u)'A'},
|
||||
{0, 0, NUL}
|
||||
/* NOTE: when adding an entry, update MAX_KEY_NAME_LEN! */
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -2294,6 +2295,8 @@ static struct key_name_entry
|
||||
{K_XDOWN, (char_u *)"xDown"},
|
||||
{K_XLEFT, (char_u *)"xLeft"},
|
||||
{K_XRIGHT, (char_u *)"xRight"},
|
||||
{K_PS, (char_u *)"PasteStart"},
|
||||
{K_PE, (char_u *)"PasteEnd"},
|
||||
|
||||
{K_F1, (char_u *)"F1"},
|
||||
{K_F2, (char_u *)"F2"},
|
||||
@@ -2435,6 +2438,7 @@ static struct key_name_entry
|
||||
{K_SWIPEDOWN, (char_u *)"SwipeDown"},
|
||||
#endif
|
||||
{0, NULL}
|
||||
/* NOTE: When adding a long name update MAX_KEY_NAME_LEN. */
|
||||
};
|
||||
|
||||
#define KEY_NAMES_TABLE_LEN (sizeof(key_names_table) / sizeof(struct key_name_entry))
|
||||
@@ -2663,8 +2667,13 @@ get_special_key_name(int c, int modifiers)
|
||||
}
|
||||
else /* use name of special key */
|
||||
{
|
||||
STRCPY(string + idx, key_names_table[table_idx].name);
|
||||
idx = (int)STRLEN(string);
|
||||
size_t len = STRLEN(key_names_table[table_idx].name);
|
||||
|
||||
if (len + idx + 2 <= MAX_KEY_NAME_LEN)
|
||||
{
|
||||
STRCPY(string + idx, key_names_table[table_idx].name);
|
||||
idx += (int)len;
|
||||
}
|
||||
}
|
||||
string[idx++] = '>';
|
||||
string[idx] = NUL;
|
||||
|
||||
@@ -2870,6 +2870,10 @@ do_check_cursorbind(void)
|
||||
restart_edit_save = restart_edit;
|
||||
restart_edit = TRUE;
|
||||
check_cursor();
|
||||
# ifdef FEAT_SYN_HL
|
||||
if (curwin->w_p_cul || curwin->w_p_cuc)
|
||||
validate_cursor();
|
||||
# endif
|
||||
restart_edit = restart_edit_save;
|
||||
# ifdef FEAT_MBYTE
|
||||
/* Correct cursor for multi-byte character. */
|
||||
|
||||
+9
-5
@@ -2332,7 +2332,8 @@ special_keys(char_u *args)
|
||||
char *save_str = nb_unquote(args, NULL);
|
||||
char *tok = strtok(save_str, " ");
|
||||
char *sep;
|
||||
char keybuf[64];
|
||||
#define KEYBUFLEN 64
|
||||
char keybuf[KEYBUFLEN];
|
||||
char cmdbuf[256];
|
||||
|
||||
while (tok != NULL)
|
||||
@@ -2359,10 +2360,13 @@ special_keys(char_u *args)
|
||||
tok++;
|
||||
}
|
||||
|
||||
strcpy(&keybuf[i], tok);
|
||||
vim_snprintf(cmdbuf, sizeof(cmdbuf),
|
||||
"<silent><%s> :nbkey %s<CR>", keybuf, keybuf);
|
||||
do_map(0, (char_u *)cmdbuf, NORMAL, FALSE);
|
||||
if (strlen(tok) + i < KEYBUFLEN)
|
||||
{
|
||||
strcpy(&keybuf[i], tok);
|
||||
vim_snprintf(cmdbuf, sizeof(cmdbuf),
|
||||
"<silent><%s> :nbkey %s<CR>", keybuf, keybuf);
|
||||
do_map(0, (char_u *)cmdbuf, NORMAL, FALSE);
|
||||
}
|
||||
tok = strtok(NULL, " ");
|
||||
}
|
||||
vim_free(save_str);
|
||||
|
||||
+18
-7
@@ -426,6 +426,7 @@ static const struct nv_cmd
|
||||
#ifdef FEAT_AUTOCMD
|
||||
{K_CURSORHOLD, nv_cursorhold, NV_KEEPREG, 0},
|
||||
#endif
|
||||
{K_PS, nv_edit, 0, 0},
|
||||
};
|
||||
|
||||
/* Number of commands in nv_cmds[]. */
|
||||
@@ -1984,7 +1985,7 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
|
||||
op_formatexpr(oap); /* use expression */
|
||||
else
|
||||
#endif
|
||||
if (*p_fp != NUL)
|
||||
if (*p_fp != NUL || *curbuf->b_p_fp != NUL)
|
||||
op_colon(oap); /* use external command */
|
||||
else
|
||||
op_format(oap, FALSE); /* use internal function */
|
||||
@@ -2197,10 +2198,12 @@ op_colon(oparg_T *oap)
|
||||
}
|
||||
else if (oap->op_type == OP_FORMAT)
|
||||
{
|
||||
if (*p_fp == NUL)
|
||||
stuffReadbuff((char_u *)"fmt");
|
||||
else
|
||||
if (*curbuf->b_p_fp != NUL)
|
||||
stuffReadbuff(curbuf->b_p_fp);
|
||||
else if (*p_fp != NUL)
|
||||
stuffReadbuff(p_fp);
|
||||
else
|
||||
stuffReadbuff((char_u *)"fmt");
|
||||
stuffReadbuff((char_u *)"\n']");
|
||||
}
|
||||
|
||||
@@ -2982,9 +2985,9 @@ do_mouse(
|
||||
if (State & INSERT)
|
||||
stuffcharReadbuff(Ctrl_O);
|
||||
if (curwin->w_llist_ref == NULL) /* quickfix window */
|
||||
stuffReadbuff((char_u *)":.cc\n");
|
||||
do_cmdline_cmd((char_u *)".cc");
|
||||
else /* location list window */
|
||||
stuffReadbuff((char_u *)":.ll\n");
|
||||
do_cmdline_cmd((char_u *)".ll");
|
||||
got_click = FALSE; /* ignore drag&release now */
|
||||
}
|
||||
#endif
|
||||
@@ -3858,7 +3861,7 @@ add_to_showcmd(int c)
|
||||
K_VER_SCROLLBAR, K_HOR_SCROLLBAR,
|
||||
K_LEFTMOUSE_NM, K_LEFTRELEASE_NM,
|
||||
# endif
|
||||
K_IGNORE,
|
||||
K_IGNORE, K_PS,
|
||||
K_LEFTMOUSE, K_LEFTDRAG, K_LEFTRELEASE,
|
||||
K_MIDDLEMOUSE, K_MIDDLEDRAG, K_MIDDLERELEASE,
|
||||
K_RIGHTMOUSE, K_RIGHTDRAG, K_RIGHTRELEASE,
|
||||
@@ -9047,6 +9050,7 @@ nv_esc(cmdarg_T *cap)
|
||||
|
||||
/*
|
||||
* Handle "A", "a", "I", "i" and <Insert> commands.
|
||||
* Also handle K_PS, start bracketed paste.
|
||||
*/
|
||||
static void
|
||||
nv_edit(cmdarg_T *cap)
|
||||
@@ -9074,6 +9078,9 @@ nv_edit(cmdarg_T *cap)
|
||||
/* Only give this error when 'insertmode' is off. */
|
||||
EMSG(_(e_modifiable));
|
||||
clearop(cap->oap);
|
||||
if (cap->cmdchar == K_PS)
|
||||
/* drop the pasted text */
|
||||
bracketed_paste(PASTE_INSERT, TRUE, NULL);
|
||||
}
|
||||
else if (!checkclearopq(cap->oap))
|
||||
{
|
||||
@@ -9105,6 +9112,7 @@ nv_edit(cmdarg_T *cap)
|
||||
break;
|
||||
|
||||
case 'a': /* "a"ppend is like "i"nsert on the next character. */
|
||||
case K_PS: /* bracketed paste works like "a"ppend */
|
||||
#ifdef FEAT_VIRTUALEDIT
|
||||
/* increment coladd when in virtual space, increment the
|
||||
* column otherwise, also to append after an unprintable char */
|
||||
@@ -9135,6 +9143,9 @@ nv_edit(cmdarg_T *cap)
|
||||
|
||||
invoke_edit(cap, FALSE, cap->cmdchar, FALSE);
|
||||
}
|
||||
else if (cap->cmdchar == K_PS)
|
||||
/* drop the pasted text */
|
||||
bracketed_paste(PASTE_INSERT, TRUE, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -3550,7 +3550,7 @@ do_put(
|
||||
*/
|
||||
if (y_type == MBLOCK)
|
||||
{
|
||||
char c = gchar_cursor();
|
||||
int c = gchar_cursor();
|
||||
colnr_T endcol2 = 0;
|
||||
|
||||
if (dir == FORWARD && c != NUL)
|
||||
|
||||
+12
-1
@@ -107,6 +107,7 @@
|
||||
#if defined(FEAT_BEVAL) && defined(FEAT_EVAL)
|
||||
# define PV_BEXPR OPT_BOTH(OPT_BUF(BV_BEXPR))
|
||||
#endif
|
||||
#define PV_FP OPT_BOTH(OPT_BUF(BV_FP))
|
||||
#ifdef FEAT_EVAL
|
||||
# define PV_FEX OPT_BUF(BV_FEX)
|
||||
#endif
|
||||
@@ -1270,7 +1271,7 @@ static struct vimoption options[] =
|
||||
{(char_u *)"^\\s*\\d\\+[\\]:.)}\\t ]\\s*",
|
||||
(char_u *)0L} SCRIPTID_INIT},
|
||||
{"formatprg", "fp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
|
||||
(char_u *)&p_fp, PV_NONE,
|
||||
(char_u *)&p_fp, PV_FP,
|
||||
{(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
|
||||
{"fsync", "fs", P_BOOL|P_SECURE|P_VI_DEF,
|
||||
#ifdef HAVE_FSYNC
|
||||
@@ -3107,6 +3108,8 @@ static struct vimoption options[] =
|
||||
p_term("t_ZR", T_CZR)
|
||||
p_term("t_8f", T_8F)
|
||||
p_term("t_8b", T_8B)
|
||||
p_term("t_BE", T_BE)
|
||||
p_term("t_BD", T_BD)
|
||||
|
||||
/* terminal key codes are not in here */
|
||||
|
||||
@@ -5574,6 +5577,7 @@ check_buf_options(buf_T *buf)
|
||||
#if defined(FEAT_CRYPT)
|
||||
check_string_option(&buf->b_p_cm);
|
||||
#endif
|
||||
check_string_option(&buf->b_p_fp);
|
||||
#if defined(FEAT_EVAL)
|
||||
check_string_option(&buf->b_p_fex);
|
||||
#endif
|
||||
@@ -10358,6 +10362,9 @@ unset_global_local_option(char_u *name, void *from)
|
||||
clear_string_option(&buf->b_p_tsr);
|
||||
break;
|
||||
#endif
|
||||
case PV_FP:
|
||||
clear_string_option(&buf->b_p_fp);
|
||||
break;
|
||||
#ifdef FEAT_QUICKFIX
|
||||
case PV_EFM:
|
||||
clear_string_option(&buf->b_p_efm);
|
||||
@@ -10411,6 +10418,7 @@ get_varp_scope(struct vimoption *p, int opt_flags)
|
||||
{
|
||||
switch ((int)p->indir)
|
||||
{
|
||||
case PV_FP: return (char_u *)&(curbuf->b_p_fp);
|
||||
#ifdef FEAT_QUICKFIX
|
||||
case PV_EFM: return (char_u *)&(curbuf->b_p_efm);
|
||||
case PV_GP: return (char_u *)&(curbuf->b_p_gp);
|
||||
@@ -10491,6 +10499,8 @@ get_varp(struct vimoption *p)
|
||||
case PV_TSR: return *curbuf->b_p_tsr != NUL
|
||||
? (char_u *)&(curbuf->b_p_tsr) : p->var;
|
||||
#endif
|
||||
case PV_FP: return *curbuf->b_p_fp != NUL
|
||||
? (char_u *)&(curbuf->b_p_fp) : p->var;
|
||||
#ifdef FEAT_QUICKFIX
|
||||
case PV_EFM: return *curbuf->b_p_efm != NUL
|
||||
? (char_u *)&(curbuf->b_p_efm) : p->var;
|
||||
@@ -11059,6 +11069,7 @@ buf_copy_options(buf_T *buf, int flags)
|
||||
buf->b_p_inde = vim_strsave(p_inde);
|
||||
buf->b_p_indk = vim_strsave(p_indk);
|
||||
#endif
|
||||
buf->b_p_fp = empty_option;
|
||||
#if defined(FEAT_EVAL)
|
||||
buf->b_p_fex = vim_strsave(p_fex);
|
||||
#endif
|
||||
|
||||
@@ -1051,6 +1051,7 @@ enum
|
||||
, BV_EP
|
||||
, BV_ET
|
||||
, BV_FENC
|
||||
, BV_FP
|
||||
#ifdef FEAT_EVAL
|
||||
, BV_BEXPR
|
||||
, BV_FEX
|
||||
|
||||
+2
-2
@@ -6940,7 +6940,7 @@ mch_libcall(
|
||||
if (argstring != NULL)
|
||||
{
|
||||
# if defined(USE_DLOPEN)
|
||||
ProcAdd = (STRPROCSTR)dlsym(hinstLib, (const char *)funcname);
|
||||
*(void **)(&ProcAdd) = dlsym(hinstLib, (const char *)funcname);
|
||||
dlerr = (char *)dlerror();
|
||||
# else
|
||||
if (shl_findsym(&hinstLib, (const char *)funcname,
|
||||
@@ -6962,7 +6962,7 @@ mch_libcall(
|
||||
else
|
||||
{
|
||||
# if defined(USE_DLOPEN)
|
||||
ProcAddI = (INTPROCSTR)dlsym(hinstLib, (const char *)funcname);
|
||||
*(void **)(&ProcAddI) = dlsym(hinstLib, (const char *)funcname);
|
||||
dlerr = (char *)dlerror();
|
||||
# else
|
||||
if (shl_findsym(&hinstLib, (const char *)funcname,
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@
|
||||
|
||||
/* shared library access */
|
||||
#if defined(HAVE_DLFCN_H) && defined(USE_DLOPEN)
|
||||
# ifdef __MVS__
|
||||
# if defined(__MVS__) && !defined (__SUSV3)
|
||||
/* needed to define RTLD_LAZY (Anthony Giorgio) */
|
||||
# define __SUSV3
|
||||
# endif
|
||||
|
||||
+113
-17
@@ -425,6 +425,84 @@ vimLoadLib(char *name)
|
||||
return dll;
|
||||
}
|
||||
|
||||
#if defined(DYNAMIC_ICONV) || defined(DYNAMIC_GETTEXT) || defined(PROTO)
|
||||
/*
|
||||
* Get related information about 'funcname' which is imported by 'hInst'.
|
||||
* If 'info' is 0, return the function address.
|
||||
* If 'info' is 1, return the module name which the function is imported from.
|
||||
*/
|
||||
static void *
|
||||
get_imported_func_info(HINSTANCE hInst, const char *funcname, int info)
|
||||
{
|
||||
PBYTE pImage = (PBYTE)hInst;
|
||||
PIMAGE_DOS_HEADER pDOS = (PIMAGE_DOS_HEADER)hInst;
|
||||
PIMAGE_NT_HEADERS pPE;
|
||||
PIMAGE_IMPORT_DESCRIPTOR pImpDesc;
|
||||
PIMAGE_THUNK_DATA pIAT; /* Import Address Table */
|
||||
PIMAGE_THUNK_DATA pINT; /* Import Name Table */
|
||||
PIMAGE_IMPORT_BY_NAME pImpName;
|
||||
|
||||
if (pDOS->e_magic != IMAGE_DOS_SIGNATURE)
|
||||
return NULL;
|
||||
pPE = (PIMAGE_NT_HEADERS)(pImage + pDOS->e_lfanew);
|
||||
if (pPE->Signature != IMAGE_NT_SIGNATURE)
|
||||
return NULL;
|
||||
pImpDesc = (PIMAGE_IMPORT_DESCRIPTOR)(pImage
|
||||
+ pPE->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT]
|
||||
.VirtualAddress);
|
||||
for (; pImpDesc->FirstThunk; ++pImpDesc)
|
||||
{
|
||||
if (!pImpDesc->OriginalFirstThunk)
|
||||
continue;
|
||||
pIAT = (PIMAGE_THUNK_DATA)(pImage + pImpDesc->FirstThunk);
|
||||
pINT = (PIMAGE_THUNK_DATA)(pImage + pImpDesc->OriginalFirstThunk);
|
||||
for (; pIAT->u1.Function; ++pIAT, ++pINT)
|
||||
{
|
||||
if (IMAGE_SNAP_BY_ORDINAL(pINT->u1.Ordinal))
|
||||
continue;
|
||||
pImpName = (PIMAGE_IMPORT_BY_NAME)(pImage
|
||||
+ (UINT_PTR)(pINT->u1.AddressOfData));
|
||||
if (strcmp((char *)pImpName->Name, funcname) == 0)
|
||||
{
|
||||
switch (info)
|
||||
{
|
||||
case 0:
|
||||
return (void *)pIAT->u1.Function;
|
||||
case 1:
|
||||
return (void *)(pImage + pImpDesc->Name);
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the module handle which 'funcname' in 'hInst' is imported from.
|
||||
*/
|
||||
HINSTANCE
|
||||
find_imported_module_by_funcname(HINSTANCE hInst, const char *funcname)
|
||||
{
|
||||
char *modulename;
|
||||
|
||||
modulename = (char *)get_imported_func_info(hInst, funcname, 1);
|
||||
if (modulename != NULL)
|
||||
return GetModuleHandleA(modulename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the address of 'funcname' which is imported by 'hInst' DLL.
|
||||
*/
|
||||
void *
|
||||
get_dll_import_func(HINSTANCE hInst, const char *funcname)
|
||||
{
|
||||
return get_imported_func_info(hInst, funcname, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(DYNAMIC_GETTEXT) || defined(PROTO)
|
||||
# ifndef GETTEXT_DLL
|
||||
# define GETTEXT_DLL "libintl.dll"
|
||||
@@ -436,6 +514,7 @@ static char *null_libintl_ngettext(const char *, const char *, unsigned long n);
|
||||
static char *null_libintl_textdomain(const char *);
|
||||
static char *null_libintl_bindtextdomain(const char *, const char *);
|
||||
static char *null_libintl_bind_textdomain_codeset(const char *, const char *);
|
||||
static int null_libintl_putenv(const char *);
|
||||
|
||||
static HINSTANCE hLibintlDLL = NULL;
|
||||
char *(*dyn_libintl_gettext)(const char *) = null_libintl_gettext;
|
||||
@@ -446,6 +525,7 @@ char *(*dyn_libintl_bindtextdomain)(const char *, const char *)
|
||||
= null_libintl_bindtextdomain;
|
||||
char *(*dyn_libintl_bind_textdomain_codeset)(const char *, const char *)
|
||||
= null_libintl_bind_textdomain_codeset;
|
||||
int (*dyn_libintl_putenv)(const char *) = null_libintl_putenv;
|
||||
|
||||
int
|
||||
dyn_libintl_init(void)
|
||||
@@ -463,6 +543,7 @@ dyn_libintl_init(void)
|
||||
{"bindtextdomain", (FARPROC*)&dyn_libintl_bindtextdomain},
|
||||
{NULL, NULL}
|
||||
};
|
||||
HINSTANCE hmsvcrt;
|
||||
|
||||
/* No need to initialize twice. */
|
||||
if (hLibintlDLL)
|
||||
@@ -507,6 +588,13 @@ dyn_libintl_init(void)
|
||||
dyn_libintl_bind_textdomain_codeset =
|
||||
null_libintl_bind_textdomain_codeset;
|
||||
|
||||
/* _putenv() function for the libintl.dll is optional. */
|
||||
hmsvcrt = find_imported_module_by_funcname(hLibintlDLL, "getenv");
|
||||
if (hmsvcrt != NULL)
|
||||
dyn_libintl_putenv = (void *)GetProcAddress(hmsvcrt, "_putenv");
|
||||
if (dyn_libintl_putenv == NULL || dyn_libintl_putenv == putenv)
|
||||
dyn_libintl_putenv = null_libintl_putenv;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -521,6 +609,7 @@ dyn_libintl_end(void)
|
||||
dyn_libintl_textdomain = null_libintl_textdomain;
|
||||
dyn_libintl_bindtextdomain = null_libintl_bindtextdomain;
|
||||
dyn_libintl_bind_textdomain_codeset = null_libintl_bind_textdomain_codeset;
|
||||
dyn_libintl_putenv = null_libintl_putenv;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
@@ -562,6 +651,13 @@ null_libintl_textdomain(const char *domainname)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
null_libintl_putenv(const char *envstring)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* DYNAMIC_GETTEXT */
|
||||
|
||||
/* This symbol is not defined in older versions of the SDK or Visual C++ */
|
||||
@@ -4781,32 +4877,32 @@ mch_call_shell(
|
||||
#if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
|
||||
static HANDLE
|
||||
job_io_file_open(
|
||||
char_u *fname,
|
||||
DWORD dwDesiredAccess,
|
||||
DWORD dwShareMode,
|
||||
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
|
||||
DWORD dwCreationDisposition,
|
||||
DWORD dwFlagsAndAttributes)
|
||||
char_u *fname,
|
||||
DWORD dwDesiredAccess,
|
||||
DWORD dwShareMode,
|
||||
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
|
||||
DWORD dwCreationDisposition,
|
||||
DWORD dwFlagsAndAttributes)
|
||||
{
|
||||
HANDLE h;
|
||||
# ifdef FEAT_MBYTE
|
||||
WCHAR *wn = NULL;
|
||||
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
|
||||
{
|
||||
wn = enc_to_utf16(fname, NULL);
|
||||
if (wn != NULL)
|
||||
{
|
||||
h = CreateFileW(wn, dwDesiredAccess, dwShareMode,
|
||||
lpSecurityAttributes, dwCreationDisposition,
|
||||
dwFlagsAndAttributes, NULL);
|
||||
vim_free(wn);
|
||||
}
|
||||
wn = enc_to_utf16(fname, NULL);
|
||||
if (wn != NULL)
|
||||
{
|
||||
h = CreateFileW(wn, dwDesiredAccess, dwShareMode,
|
||||
lpSecurityAttributes, dwCreationDisposition,
|
||||
dwFlagsAndAttributes, NULL);
|
||||
vim_free(wn);
|
||||
}
|
||||
}
|
||||
if (wn == NULL)
|
||||
# endif
|
||||
h = CreateFile((LPCSTR)fname, dwDesiredAccess, dwShareMode,
|
||||
lpSecurityAttributes, dwCreationDisposition,
|
||||
dwFlagsAndAttributes, NULL);
|
||||
h = CreateFile((LPCSTR)fname, dwDesiredAccess, dwShareMode,
|
||||
lpSecurityAttributes, dwCreationDisposition,
|
||||
dwFlagsAndAttributes, NULL);
|
||||
return h;
|
||||
}
|
||||
|
||||
|
||||
+25
-29
@@ -5,7 +5,7 @@
|
||||
#
|
||||
# UNUA TRADUKISTO Dominique PELLE <dominique.pelle ĉe gmail.com>
|
||||
# PROVLEGANTO(J) Felipe CASTRO <fefcas ĉe gmail.com>
|
||||
# Antono MECHELYNCK <antoine.mechelynck ĉe skynet.be>
|
||||
# Antono MECHELYNCK <antoine.mechelynck ĉe gmail.com>
|
||||
# Yves NEVELSTEEN
|
||||
#
|
||||
# Uzitaj vortaroj kaj fakvortaroj:
|
||||
@@ -23,8 +23,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Vim(Esperanto)\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-08-26 20:54+0200\n"
|
||||
"PO-Revision-Date: 2016-08-26 20:30+0200\n"
|
||||
"POT-Creation-Date: 2017-01-16 00:30+0100\n"
|
||||
"PO-Revision-Date: 2017-01-16 01:14+0100\n"
|
||||
"Last-Translator: Dominique PELLÉ <dominique.pelle@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
"Language: eo\n"
|
||||
@@ -66,6 +66,9 @@ msgstr "E83: Ne eblas disponigi bufron, nun uzas alian..."
|
||||
msgid "E931: Buffer cannot be registered"
|
||||
msgstr "E931: Bufro ne povas esti registrita"
|
||||
|
||||
msgid "E937: Attempt to delete a buffer that is in use"
|
||||
msgstr "E937: Provo de forviŝo de bufro, kiu estas uzanta"
|
||||
|
||||
msgid "E515: No buffers were unloaded"
|
||||
msgstr "E515: Neniu bufro estis malŝargita"
|
||||
|
||||
@@ -269,7 +272,7 @@ msgid "E918: buffer must be loaded: %s"
|
||||
msgstr "E918: bufro devas esti ŝargita: %s"
|
||||
|
||||
msgid "E821: File is encrypted with unknown method"
|
||||
msgstr "E821: Dosiero estas ĉifrata per nekonata metodo"
|
||||
msgstr "E821: Dosiero estas ĉifrita per nekonata metodo"
|
||||
|
||||
msgid "Warning: Using a weak encryption method; see :help 'cm'"
|
||||
msgstr "Averto: uzo de malfortika ĉifrada metodo; vidu :help 'cm'"
|
||||
@@ -1963,6 +1966,9 @@ msgstr "E462: Ne eblis prepari por reŝargi \"%s\""
|
||||
msgid "E321: Could not reload \"%s\""
|
||||
msgstr "E321: Ne eblis reŝargi \"%s\""
|
||||
|
||||
msgid "--Deleted--"
|
||||
msgstr "--Forviŝita--"
|
||||
|
||||
#, c-format
|
||||
msgid "auto-removing autocommand: %s <buffer=%d>"
|
||||
msgstr "aŭto-forviŝas aŭtokomandon: %s <bufro=%d>"
|
||||
@@ -1972,12 +1978,12 @@ msgstr "aŭto-forviŝas aŭtokomandon: %s <bufro=%d>"
|
||||
msgid "E367: No such group: \"%s\""
|
||||
msgstr "E367: Ne ekzistas tia grupo: \"%s\""
|
||||
|
||||
msgid "E936: Cannot delete the current group"
|
||||
msgstr "E936: Ne eblas forviŝi la aktualan grupon"
|
||||
|
||||
msgid "W19: Deleting augroup that is still in use"
|
||||
msgstr "W19: Forviŝo de augroup kiu estas ankoraŭ uzata"
|
||||
|
||||
msgid "--Deleted--"
|
||||
msgstr "--Forviŝita--"
|
||||
|
||||
#, c-format
|
||||
msgid "E215: Illegal character after *: %s"
|
||||
msgstr "E215: Nevalida signo post *: %s"
|
||||
@@ -2834,6 +2840,10 @@ msgid "E251: VIM instance registry property is badly formed. Deleted!"
|
||||
msgstr ""
|
||||
"E251: Ecoj de registro de apero de VIM estas nevalide formata. Forviŝita!"
|
||||
|
||||
#, c-format
|
||||
msgid "E938: Duplicate key in JSON: \"%s\""
|
||||
msgstr "E938: Ripetita ŝlosilo en JSON: \"%s\""
|
||||
|
||||
#, c-format
|
||||
msgid "E696: Missing comma in List: %s"
|
||||
msgstr "E696: Mankas komo en Listo: %s"
|
||||
@@ -3058,6 +3068,10 @@ msgid "--not-a-term\t\tSkip warning for input/output not being a terminal"
|
||||
msgstr ""
|
||||
"--not-a-term\t\tPreterpasi averton por enigo/eligo, kiu ne estas terminalo"
|
||||
|
||||
msgid "--ttyfail\t\tExit if input or output is not a terminal"
|
||||
msgstr ""
|
||||
"--ttyfail\t\tEliri se le eniro aŭ eliro ne estas terminalo"
|
||||
|
||||
msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
|
||||
msgstr "-u <vimrc>\t\tUzi <vimrc> anstataŭ iun ajn .vimrc"
|
||||
|
||||
@@ -4454,9 +4468,6 @@ msgstr "ERARO DE ENIGO/ELIGO"
|
||||
msgid "Message"
|
||||
msgstr "Mesaĝo"
|
||||
|
||||
msgid "'columns' is not 80, cannot execute external commands"
|
||||
msgstr "'columns' ne estas 80, ne eblas plenumi eksterajn komandojn"
|
||||
|
||||
msgid "E237: Printer selection failed"
|
||||
msgstr "E237: Elekto de presilo malsukcesis"
|
||||
|
||||
@@ -5998,14 +6009,6 @@ msgstr "E133: \":return\" ekster funkcio"
|
||||
msgid "E107: Missing parentheses: %s"
|
||||
msgstr "E107: Mankas krampoj: %s"
|
||||
|
||||
#. Only MS VC 4.1 and earlier can do Win32s
|
||||
msgid ""
|
||||
"\n"
|
||||
"MS-Windows 16/32-bit GUI version"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Grafika versio MS-Vindozo 16/32-bitoj"
|
||||
|
||||
msgid ""
|
||||
"\n"
|
||||
"MS-Windows 64-bit GUI version"
|
||||
@@ -6305,13 +6308,6 @@ msgstr "tajpu :help register<Enenklavo> por pliaj informoj "
|
||||
msgid "menu Help->Sponsor/Register for information "
|
||||
msgstr "menuo Helpo->Subteni/Registri por pliaj informoj "
|
||||
|
||||
msgid "WARNING: Windows 95/98/ME detected"
|
||||
msgstr "AVERTO: Trovis Vindozon 95/98/ME"
|
||||
|
||||
# DP: atentu al la spacetoj: ĉiuj ĉenoj devas havi la saman longon
|
||||
msgid "type :help windows95<Enter> for info on this"
|
||||
msgstr "tajpu :help windows95<Enenklavo> por pliaj informoj "
|
||||
|
||||
msgid "Already only one window"
|
||||
msgstr "Jam nur unu fenestro"
|
||||
|
||||
@@ -6465,6 +6461,10 @@ msgstr "E236: La tiparo \"%s\" ne estas egallarĝa"
|
||||
msgid "E473: Internal error"
|
||||
msgstr "E473: Interna eraro"
|
||||
|
||||
#, c-format
|
||||
msgid "E685: Internal error: %s"
|
||||
msgstr "E685: Interna eraro: %s"
|
||||
|
||||
msgid "Interrupted"
|
||||
msgstr "Interrompita"
|
||||
|
||||
@@ -6745,10 +6745,6 @@ msgstr "E463: Regiono estas gardita, ne eblas ŝanĝi"
|
||||
msgid "E744: NetBeans does not allow changes in read-only files"
|
||||
msgstr "E744: NetBeans ne permesas ŝanĝojn en nurlegeblaj dosieroj"
|
||||
|
||||
#, c-format
|
||||
msgid "E685: Internal error: %s"
|
||||
msgstr "E685: Interna eraro: %s"
|
||||
|
||||
msgid "E363: pattern uses more memory than 'maxmempattern'"
|
||||
msgstr "E363: ŝablono uzas pli da memoro ol 'maxmempattern'"
|
||||
|
||||
|
||||
+27
-30
@@ -6,7 +6,7 @@
|
||||
# FIRST AUTHOR DindinX <David.Odin@bigfoot.com> 2000.
|
||||
# SECOND AUTHOR Adrien Beau <version.francaise@free.fr> 2002, 2003.
|
||||
# THIRD AUTHOR David Blanchet <david.blanchet@free.fr> 2006, 2008.
|
||||
# FOURTH AUTHOR Dominique Pellé <dominique.pelle@gmail.com> 2008, 2016.
|
||||
# FOURTH AUTHOR Dominique Pellé <dominique.pelle@gmail.com> 2008, 2017.
|
||||
#
|
||||
# Latest translation available at:
|
||||
# http://dominique.pelle.free.fr/vim-fr.php
|
||||
@@ -15,8 +15,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Vim(Français)\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-08-26 20:54+0200\n"
|
||||
"PO-Revision-Date: 2016-08-26 20:34+0200\n"
|
||||
"POT-Creation-Date: 2017-01-16 00:30+0100\n"
|
||||
"PO-Revision-Date: 2017-01-16 00:51+0100\n"
|
||||
"Last-Translator: Dominique Pellé <dominique.pelle@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
"Language: fr\n"
|
||||
@@ -63,6 +63,9 @@ msgstr ""
|
||||
msgid "E931: Buffer cannot be registered"
|
||||
msgstr "E931: Le tampon ne peut pas être enregistré"
|
||||
|
||||
msgid "E937: Attempt to delete a buffer that is in use"
|
||||
msgstr "E937: Tentative de suppression d'un tampon en cours d'utilisation"
|
||||
|
||||
msgid "E515: No buffers were unloaded"
|
||||
msgstr "E515: Aucun tampon n'a été déchargé"
|
||||
|
||||
@@ -242,7 +245,7 @@ msgid "E898: socket() in channel_open()"
|
||||
msgstr "E898: socket() dans channel_open()"
|
||||
|
||||
msgid "E903: received command with non-string argument"
|
||||
msgstr "E903: commande reçue avec une argument qui n'est pas une chaîne"
|
||||
msgstr "E903: commande reçue avec un argument qui n'est pas une chaîne"
|
||||
|
||||
msgid "E904: last argument for expr/call must be a number"
|
||||
msgstr "E904: le dernier argument de expr/call doit être un nombre"
|
||||
@@ -2150,6 +2153,9 @@ msgstr "E462: Impossible de pr
|
||||
msgid "E321: Could not reload \"%s\""
|
||||
msgstr "E321: Impossible de recharger \"%s\""
|
||||
|
||||
msgid "--Deleted--"
|
||||
msgstr "--Effacé--"
|
||||
|
||||
#, c-format
|
||||
msgid "auto-removing autocommand: %s <buffer=%d>"
|
||||
msgstr "Autocommandes marquées pour auto-suppression : %s <tampon=%d>"
|
||||
@@ -2159,12 +2165,12 @@ msgstr "Autocommandes marqu
|
||||
msgid "E367: No such group: \"%s\""
|
||||
msgstr "E367: Aucun groupe \"%s\""
|
||||
|
||||
msgid "E936: Cannot delete the current group"
|
||||
msgstr "E936: Impossible de supprimer le groupe courant"
|
||||
|
||||
msgid "W19: Deleting augroup that is still in use"
|
||||
msgstr "W19: Effacement d'augroup toujours en usage"
|
||||
|
||||
msgid "--Deleted--"
|
||||
msgstr "--Effacé--"
|
||||
|
||||
#, c-format
|
||||
msgid "E215: Illegal character after *: %s"
|
||||
msgstr "E215: Caractère non valide après * : %s"
|
||||
@@ -2854,7 +2860,7 @@ msgid "invalid expression"
|
||||
msgstr "expression invalide"
|
||||
|
||||
msgid "expressions disabled at compile time"
|
||||
msgstr "expressions désactivée lors de la compilation"
|
||||
msgstr "expressions désactivées lors de la compilation"
|
||||
|
||||
msgid "hidden option"
|
||||
msgstr "option cachée"
|
||||
@@ -3041,6 +3047,10 @@ msgstr "E573: Id utilis
|
||||
msgid "E251: VIM instance registry property is badly formed. Deleted!"
|
||||
msgstr "E251: Entrée registre de l'instance de Vim mal formatée. Suppression !"
|
||||
|
||||
#, c-format
|
||||
msgid "E938: Duplicate key in JSON: \"%s\""
|
||||
msgstr "E938: Clé dupliquée dans le document JSON : \"%s\""
|
||||
|
||||
#, c-format
|
||||
msgid "E696: Missing comma in List: %s"
|
||||
msgstr "E696: Il manque une virgule dans la Liste %s"
|
||||
@@ -3269,6 +3279,10 @@ msgid "--not-a-term\t\tSkip warning for input/output not being a terminal"
|
||||
msgstr ""
|
||||
"--no-a-term\t\tAucun avertissement si l'entrée/sortie n'est pas un terminal"
|
||||
|
||||
msgid "--ttyfail\t\tExit if input or output is not a terminal"
|
||||
msgstr ""
|
||||
"--ttyfail\t\tQuitte si l'entrée ou la sortie ne sont pas un terminal"
|
||||
|
||||
msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
|
||||
msgstr "-u <vimrc>\tUtiliser <vimrc> au lieu du vimrc habituel"
|
||||
|
||||
@@ -4682,9 +4696,6 @@ msgstr "ERREUR d'E/S"
|
||||
msgid "Message"
|
||||
msgstr "Message"
|
||||
|
||||
msgid "'columns' is not 80, cannot execute external commands"
|
||||
msgstr "'columns' ne vaut pas 80, impossible d'exécuter des commandes externes"
|
||||
|
||||
msgid "E237: Printer selection failed"
|
||||
msgstr "E237: La sélection de l'imprimante a échoué"
|
||||
|
||||
@@ -5625,7 +5636,7 @@ msgstr ""
|
||||
#. This should have been checked when generating the .spl
|
||||
#. * file.
|
||||
msgid "E783: duplicate char in MAP entry"
|
||||
msgstr "E783: caractères dupliqué dans l'entrée MAP"
|
||||
msgstr "E783: caractère dupliqué dans l'entrée MAP"
|
||||
|
||||
msgid "No Syntax items defined for this buffer"
|
||||
msgstr "Aucun élément de syntaxe défini pour ce tampon"
|
||||
@@ -6264,14 +6275,6 @@ msgstr "E133: :return en dehors d'une fonction"
|
||||
msgid "E107: Missing parentheses: %s"
|
||||
msgstr "E107: Parenthèses manquantes : %s"
|
||||
|
||||
#. Only MS VC 4.1 and earlier can do Win32s
|
||||
msgid ""
|
||||
"\n"
|
||||
"MS-Windows 16/32-bit GUI version"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Version graphique MS-Windows 16/32 bits"
|
||||
|
||||
msgid ""
|
||||
"\n"
|
||||
"MS-Windows 64-bit GUI version"
|
||||
@@ -6561,12 +6564,6 @@ msgstr "tapez :help register<Entr
|
||||
msgid "menu Help->Sponsor/Register for information "
|
||||
msgstr "menu Aide->Sponsor/Enregistrement pour plus d'info"
|
||||
|
||||
msgid "WARNING: Windows 95/98/ME detected"
|
||||
msgstr "ALERTE: Windows 95/98/ME détecté"
|
||||
|
||||
msgid "type :help windows95<Enter> for info on this"
|
||||
msgstr "tapez :help windows95<Entrée> pour plus d'information"
|
||||
|
||||
msgid "Already only one window"
|
||||
msgstr "Il n'y a déjà plus qu'une fenêtre"
|
||||
|
||||
@@ -6727,6 +6724,10 @@ msgstr "E236: La police \"%s\" n'a pas une chasse (largeur) fixe"
|
||||
msgid "E473: Internal error"
|
||||
msgstr "E473: Erreur interne"
|
||||
|
||||
#, c-format
|
||||
msgid "E685: Internal error: %s"
|
||||
msgstr "E685: Erreur interne : %s"
|
||||
|
||||
msgid "Interrupted"
|
||||
msgstr "Interrompu"
|
||||
|
||||
@@ -7011,10 +7012,6 @@ msgid "E744: NetBeans does not allow changes in read-only files"
|
||||
msgstr ""
|
||||
"E744: NetBeans n'autorise pas la modification des fichiers en lecture seule"
|
||||
|
||||
#, c-format
|
||||
msgid "E685: Internal error: %s"
|
||||
msgstr "E685: Erreur interne : %s"
|
||||
|
||||
msgid "E363: pattern uses more memory than 'maxmempattern'"
|
||||
msgstr "E363: le motif utilise plus de mémoire que 'maxmempattern'"
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ void fixthisline(int (*get_the_indent)(void));
|
||||
void fix_indent(void);
|
||||
int in_cinkeys(int keytyped, int when, int line_is_empty);
|
||||
int hkmap(int c);
|
||||
int bracketed_paste(paste_mode_T mode, int drop, garray_T *gap);
|
||||
void ins_scroll(void);
|
||||
void ins_horscroll(void);
|
||||
int ins_copychar(linenr_T lnum);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/* os_win32.c */
|
||||
HINSTANCE vimLoadLib(char *name);
|
||||
HINSTANCE find_imported_module_by_funcname(HINSTANCE hInst, const char *funcname);
|
||||
void *get_dll_import_func(HINSTANCE hInst, const char *funcname);
|
||||
int dyn_libintl_init(void);
|
||||
void dyn_libintl_end(void);
|
||||
void PlatformId(void);
|
||||
|
||||
@@ -1133,25 +1133,43 @@ typedef long_u hash_T; /* Type for hi_hash */
|
||||
# ifdef PROTO
|
||||
typedef long varnumber_T;
|
||||
typedef unsigned long uvarnumber_T;
|
||||
#define VARNUM_MIN LONG_MIN
|
||||
#define VARNUM_MAX LONG_MAX
|
||||
#define UVARNUM_MAX ULONG_MAX
|
||||
# else
|
||||
typedef __int64 varnumber_T;
|
||||
typedef unsigned __int64 uvarnumber_T;
|
||||
#define VARNUM_MIN _I64_MIN
|
||||
#define VARNUM_MAX _I64_MAX
|
||||
#define UVARNUM_MAX _UI64_MAX
|
||||
# endif
|
||||
# elif defined(HAVE_STDINT_H)
|
||||
typedef int64_t varnumber_T;
|
||||
typedef uint64_t uvarnumber_T;
|
||||
#define VARNUM_MIN INT64_MIN
|
||||
#define VARNUM_MAX INT64_MAX
|
||||
#define UVARNUM_MAX UINT64_MAX
|
||||
# else
|
||||
typedef long varnumber_T;
|
||||
typedef unsigned long uvarnumber_T;
|
||||
#define VARNUM_MIN LONG_MIN
|
||||
#define VARNUM_MAX LONG_MAX
|
||||
#define UVARNUM_MAX ULONG_MAX
|
||||
# endif
|
||||
#else
|
||||
/* Use 32-bit Number. */
|
||||
# if VIM_SIZEOF_INT <= 3 /* use long if int is smaller than 32 bits */
|
||||
typedef long varnumber_T;
|
||||
typedef unsigned long uvarnumber_T;
|
||||
#define VARNUM_MIN LONG_MIN
|
||||
#define VARNUM_MAX LONG_MAX
|
||||
#define UVARNUM_MAX ULONG_MAX
|
||||
# else
|
||||
typedef int varnumber_T;
|
||||
typedef unsigned int uvarnumber_T;
|
||||
#define VARNUM_MIN INT_MIN
|
||||
#define VARNUM_MAX INT_MAX
|
||||
#define UVARNUM_MAX UINT_MAX
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -2100,6 +2118,7 @@ struct file_buffer
|
||||
long_u b_p_inde_flags; /* flags for 'indentexpr' */
|
||||
char_u *b_p_indk; /* 'indentkeys' */
|
||||
#endif
|
||||
char_u *b_p_fp; /* 'formatprg' */
|
||||
#if defined(FEAT_EVAL)
|
||||
char_u *b_p_fex; /* 'formatexpr' */
|
||||
long_u b_p_fex_flags; /* flags for 'formatexpr' */
|
||||
|
||||
+71
-20
@@ -22,6 +22,7 @@ struct hl_group
|
||||
{
|
||||
char_u *sg_name; /* highlight group name */
|
||||
char_u *sg_name_u; /* uppercase of sg_name */
|
||||
int sg_cleared; /* "hi clear" was used */
|
||||
/* for normal terminals */
|
||||
int sg_term; /* "term=" highlighting attributes */
|
||||
char_u *sg_start; /* terminal string for start highl */
|
||||
@@ -462,7 +463,7 @@ static void syn_clear_keyword(int id, hashtab_T *ht);
|
||||
static void clear_keywtab(hashtab_T *ht);
|
||||
static void add_keyword(char_u *name, int id, int flags, short *cont_in_list, short *next_list, int conceal_char);
|
||||
static char_u *get_group_name(char_u *arg, char_u **name_end);
|
||||
static char_u *get_syn_options(char_u *arg, syn_opt_arg_T *opt, int *conceal_char);
|
||||
static char_u *get_syn_options(char_u *arg, syn_opt_arg_T *opt, int *conceal_char, int skip);
|
||||
static void syn_cmd_include(exarg_T *eap, int syncing);
|
||||
static void syn_cmd_iskeyword(exarg_T *eap, int syncing);
|
||||
static void syn_cmd_keyword(exarg_T *eap, int syncing);
|
||||
@@ -481,7 +482,7 @@ static int syn_add_cluster(char_u *name);
|
||||
static void init_syn_patterns(void);
|
||||
static char_u *get_syn_pattern(char_u *arg, synpat_T *ci);
|
||||
static void syn_cmd_sync(exarg_T *eap, int syncing);
|
||||
static int get_id_list(char_u **arg, int keylen, short **list);
|
||||
static int get_id_list(char_u **arg, int keylen, short **list, int skip);
|
||||
static void syn_combine_list(short **clstr1, short **clstr2, int list_op);
|
||||
static void syn_incl_toplevel(int id, int *flagsp);
|
||||
|
||||
@@ -3434,7 +3435,14 @@ syn_cmd_conceal(exarg_T *eap UNUSED, int syncing UNUSED)
|
||||
return;
|
||||
|
||||
next = skiptowhite(arg);
|
||||
if (STRNICMP(arg, "on", 2) == 0 && next - arg == 2)
|
||||
if (*arg == NUL)
|
||||
{
|
||||
if (curwin->w_s->b_syn_conceal)
|
||||
MSG(_("syn conceal on"));
|
||||
else
|
||||
MSG(_("syn conceal off"));
|
||||
}
|
||||
else if (STRNICMP(arg, "on", 2) == 0 && next - arg == 2)
|
||||
curwin->w_s->b_syn_conceal = TRUE;
|
||||
else if (STRNICMP(arg, "off", 3) == 0 && next - arg == 3)
|
||||
curwin->w_s->b_syn_conceal = FALSE;
|
||||
@@ -3457,7 +3465,14 @@ syn_cmd_case(exarg_T *eap, int syncing UNUSED)
|
||||
return;
|
||||
|
||||
next = skiptowhite(arg);
|
||||
if (STRNICMP(arg, "match", 5) == 0 && next - arg == 5)
|
||||
if (*arg == NUL)
|
||||
{
|
||||
if (curwin->w_s->b_syn_ic)
|
||||
MSG(_("syntax case ignore"));
|
||||
else
|
||||
MSG(_("syntax case match"));
|
||||
}
|
||||
else if (STRNICMP(arg, "match", 5) == 0 && next - arg == 5)
|
||||
curwin->w_s->b_syn_ic = FALSE;
|
||||
else if (STRNICMP(arg, "ignore", 6) == 0 && next - arg == 6)
|
||||
curwin->w_s->b_syn_ic = TRUE;
|
||||
@@ -3479,7 +3494,16 @@ syn_cmd_spell(exarg_T *eap, int syncing UNUSED)
|
||||
return;
|
||||
|
||||
next = skiptowhite(arg);
|
||||
if (STRNICMP(arg, "toplevel", 8) == 0 && next - arg == 8)
|
||||
if (*arg == NUL)
|
||||
{
|
||||
if (curwin->w_s->b_syn_spell == SYNSPL_TOP)
|
||||
MSG(_("syntax spell toplevel"));
|
||||
else if (curwin->w_s->b_syn_spell == SYNSPL_NOTOP)
|
||||
MSG(_("syntax spell notoplevel"));
|
||||
else
|
||||
MSG(_("syntax spell default"));
|
||||
}
|
||||
else if (STRNICMP(arg, "toplevel", 8) == 0 && next - arg == 8)
|
||||
curwin->w_s->b_syn_spell = SYNSPL_TOP;
|
||||
else if (STRNICMP(arg, "notoplevel", 10) == 0 && next - arg == 10)
|
||||
curwin->w_s->b_syn_spell = SYNSPL_NOTOP;
|
||||
@@ -3556,6 +3580,9 @@ syntax_clear(synblock_T *block)
|
||||
block->b_syn_ic = FALSE; /* Use case, by default */
|
||||
block->b_syn_spell = SYNSPL_DEFAULT; /* default spell checking */
|
||||
block->b_syn_containedin = FALSE;
|
||||
#ifdef FEAT_CONCEAL
|
||||
block->b_syn_conceal = FALSE;
|
||||
#endif
|
||||
|
||||
/* free the keywords */
|
||||
clear_keywtab(&block->b_keywtab);
|
||||
@@ -4543,7 +4570,8 @@ get_group_name(
|
||||
get_syn_options(
|
||||
char_u *arg, /* next argument to be checked */
|
||||
syn_opt_arg_T *opt, /* various things */
|
||||
int *conceal_char UNUSED)
|
||||
int *conceal_char UNUSED,
|
||||
int skip) /* TRUE if skipping over command */
|
||||
{
|
||||
char_u *gname_start, *gname;
|
||||
int syn_id;
|
||||
@@ -4626,17 +4654,17 @@ get_syn_options(
|
||||
EMSG(_("E395: contains argument not accepted here"));
|
||||
return NULL;
|
||||
}
|
||||
if (get_id_list(&arg, 8, &opt->cont_list) == FAIL)
|
||||
if (get_id_list(&arg, 8, &opt->cont_list, skip) == FAIL)
|
||||
return NULL;
|
||||
}
|
||||
else if (flagtab[fidx].argtype == 2)
|
||||
{
|
||||
if (get_id_list(&arg, 11, &opt->cont_in_list) == FAIL)
|
||||
if (get_id_list(&arg, 11, &opt->cont_in_list, skip) == FAIL)
|
||||
return NULL;
|
||||
}
|
||||
else if (flagtab[fidx].argtype == 3)
|
||||
{
|
||||
if (get_id_list(&arg, 9, &opt->next_list) == FAIL)
|
||||
if (get_id_list(&arg, 9, &opt->next_list, skip) == FAIL)
|
||||
return NULL;
|
||||
}
|
||||
else if (flagtab[fidx].argtype == 11 && arg[5] == '=')
|
||||
@@ -4846,7 +4874,10 @@ syn_cmd_keyword(exarg_T *eap, int syncing UNUSED)
|
||||
|
||||
if (rest != NULL)
|
||||
{
|
||||
syn_id = syn_check_group(arg, (int)(group_name_end - arg));
|
||||
if (eap->skip)
|
||||
syn_id = -1;
|
||||
else
|
||||
syn_id = syn_check_group(arg, (int)(group_name_end - arg));
|
||||
if (syn_id != 0)
|
||||
/* allocate a buffer, for removing backslashes in the keyword */
|
||||
keyword_copy = alloc((unsigned)STRLEN(rest) + 1);
|
||||
@@ -4868,7 +4899,8 @@ syn_cmd_keyword(exarg_T *eap, int syncing UNUSED)
|
||||
p = keyword_copy;
|
||||
for ( ; rest != NULL && !ends_excmd(*rest); rest = skipwhite(rest))
|
||||
{
|
||||
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char);
|
||||
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char,
|
||||
eap->skip);
|
||||
if (rest == NULL || ends_excmd(*rest))
|
||||
break;
|
||||
/* Copy the keyword, removing backslashes, and add a NUL. */
|
||||
@@ -4981,7 +5013,7 @@ syn_cmd_match(
|
||||
syn_opt_arg.cont_list = NULL;
|
||||
syn_opt_arg.cont_in_list = NULL;
|
||||
syn_opt_arg.next_list = NULL;
|
||||
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char);
|
||||
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char, eap->skip);
|
||||
|
||||
/* get the pattern. */
|
||||
init_syn_patterns();
|
||||
@@ -4991,7 +5023,7 @@ syn_cmd_match(
|
||||
syn_opt_arg.flags |= HL_HAS_EOL;
|
||||
|
||||
/* Get options after the pattern */
|
||||
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char);
|
||||
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char, eap->skip);
|
||||
|
||||
if (rest != NULL) /* all arguments are valid */
|
||||
{
|
||||
@@ -5117,7 +5149,7 @@ syn_cmd_region(
|
||||
while (rest != NULL && !ends_excmd(*rest))
|
||||
{
|
||||
/* Check for option arguments */
|
||||
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char);
|
||||
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char, eap->skip);
|
||||
if (rest == NULL || ends_excmd(*rest))
|
||||
break;
|
||||
|
||||
@@ -5628,13 +5660,16 @@ syn_cmd_cluster(exarg_T *eap, int syncing UNUSED)
|
||||
break;
|
||||
|
||||
clstr_list = NULL;
|
||||
if (get_id_list(&rest, opt_len, &clstr_list) == FAIL)
|
||||
if (get_id_list(&rest, opt_len, &clstr_list, eap->skip) == FAIL)
|
||||
{
|
||||
EMSG2(_(e_invarg2), rest);
|
||||
break;
|
||||
}
|
||||
syn_combine_list(&SYN_CLSTR(curwin->w_s)[scl_id].scl_list,
|
||||
if (scl_id >= 0)
|
||||
syn_combine_list(&SYN_CLSTR(curwin->w_s)[scl_id].scl_list,
|
||||
&clstr_list, list_op);
|
||||
else
|
||||
vim_free(clstr_list);
|
||||
got_clstr = TRUE;
|
||||
}
|
||||
|
||||
@@ -5931,8 +5966,9 @@ syn_cmd_sync(exarg_T *eap, int syncing UNUSED)
|
||||
get_id_list(
|
||||
char_u **arg,
|
||||
int keylen, /* length of keyword */
|
||||
short **list) /* where to store the resulting list, if not
|
||||
short **list, /* where to store the resulting list, if not
|
||||
NULL, the list is silently skipped! */
|
||||
int skip)
|
||||
{
|
||||
char_u *p = NULL;
|
||||
char_u *end;
|
||||
@@ -6000,7 +6036,8 @@ get_id_list(
|
||||
}
|
||||
if (count != 0)
|
||||
{
|
||||
EMSG2(_("E408: %s must be first in contains list"), name + 1);
|
||||
EMSG2(_("E408: %s must be first in contains list"),
|
||||
name + 1);
|
||||
failed = TRUE;
|
||||
vim_free(name);
|
||||
break;
|
||||
@@ -6015,7 +6052,10 @@ get_id_list(
|
||||
}
|
||||
else if (name[1] == '@')
|
||||
{
|
||||
id = syn_check_cluster(name + 2, (int)(end - p - 1));
|
||||
if (skip)
|
||||
id = -1;
|
||||
else
|
||||
id = syn_check_cluster(name + 2, (int)(end - p - 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -7293,6 +7333,7 @@ do_highlight(
|
||||
#ifdef FEAT_EVAL
|
||||
HL_TABLE()[from_id - 1].sg_scriptID = current_SID;
|
||||
#endif
|
||||
HL_TABLE()[from_id - 1].sg_cleared = FALSE;
|
||||
redraw_all_later(SOME_VALID);
|
||||
}
|
||||
}
|
||||
@@ -8001,6 +8042,7 @@ do_highlight(
|
||||
error = TRUE;
|
||||
break;
|
||||
}
|
||||
HL_TABLE()[idx].sg_cleared = FALSE;
|
||||
|
||||
/*
|
||||
* When highlighting has been given for a group, don't link it.
|
||||
@@ -8138,6 +8180,8 @@ hl_has_settings(int idx, int check_link)
|
||||
static void
|
||||
highlight_clear(int idx)
|
||||
{
|
||||
HL_TABLE()[idx].sg_cleared = TRUE;
|
||||
|
||||
HL_TABLE()[idx].sg_term = 0;
|
||||
vim_free(HL_TABLE()[idx].sg_start);
|
||||
HL_TABLE()[idx].sg_start = NULL;
|
||||
@@ -9913,6 +9957,13 @@ highlight_list_two(int cnt, int attr)
|
||||
char_u *
|
||||
get_highlight_name(expand_T *xp UNUSED, int idx)
|
||||
{
|
||||
if (idx < 0)
|
||||
return NULL;
|
||||
/* Items are never removed from the table, skip the ones that were cleared.
|
||||
*/
|
||||
while (idx < highlight_ga.ga_len && HL_TABLE()[idx].sg_cleared)
|
||||
++idx;
|
||||
|
||||
#ifdef FEAT_CMDL_COMPL
|
||||
if (idx == highlight_ga.ga_len && include_none != 0)
|
||||
return (char_u *)"none";
|
||||
@@ -9925,7 +9976,7 @@ get_highlight_name(expand_T *xp UNUSED, int idx)
|
||||
&& include_link != 0)
|
||||
return (char_u *)"clear";
|
||||
#endif
|
||||
if (idx < 0 || idx >= highlight_ga.ga_len)
|
||||
if (idx >= highlight_ga.ga_len)
|
||||
return NULL;
|
||||
return HL_TABLE()[idx].sg_name;
|
||||
}
|
||||
|
||||
@@ -35,19 +35,15 @@ typedef struct tag_pointers
|
||||
} tagptrs_T;
|
||||
|
||||
/*
|
||||
* The matching tags are first stored in ga_match[]. In which one depends on
|
||||
* the priority of the match.
|
||||
* At the end, the matches from ga_match[] are concatenated, to make a list
|
||||
* The matching tags are first stored in one of the ht_match[] hash tables. In
|
||||
* which one depends on the priority of the match.
|
||||
* At the end, all the matches from ht_match[] are concatenated, to make a list
|
||||
* sorted on priority.
|
||||
*/
|
||||
#define MT_ST_CUR 0 /* static match in current file */
|
||||
#define MT_GL_CUR 1 /* global match in current file */
|
||||
#define MT_GL_OTH 2 /* global match in other file */
|
||||
#define MT_ST_OTH 3 /* static match in other file */
|
||||
#define MT_IC_ST_CUR 4 /* icase static match in current file */
|
||||
#define MT_IC_GL_CUR 5 /* icase global match in current file */
|
||||
#define MT_IC_GL_OTH 6 /* icase global match in other file */
|
||||
#define MT_IC_ST_OTH 7 /* icase static match in other file */
|
||||
#define MT_IC_OFF 4 /* add for icase match */
|
||||
#define MT_RE_OFF 8 /* add for regexp match */
|
||||
#define MT_MASK 7 /* mask for printing priority */
|
||||
@@ -1341,12 +1337,9 @@ find_tags(
|
||||
int is_etag; /* current file is emaces style */
|
||||
#endif
|
||||
|
||||
struct match_found
|
||||
{
|
||||
int len; /* nr of chars of match[] to be compared */
|
||||
char_u match[1]; /* actually longer */
|
||||
} *mfp, *mfp2;
|
||||
garray_T ga_match[MT_COUNT];
|
||||
char_u *mfp;
|
||||
hashtab_T ht_match[MT_COUNT];
|
||||
hash_T hash = 0;
|
||||
int match_count = 0; /* number of matches found */
|
||||
char_u **matches;
|
||||
int mtt;
|
||||
@@ -1402,16 +1395,16 @@ find_tags(
|
||||
vimconv.vc_type = CONV_NONE;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Allocate memory for the buffers that are used
|
||||
*/
|
||||
/*
|
||||
* Allocate memory for the buffers that are used
|
||||
*/
|
||||
lbuf = alloc(lbuf_size);
|
||||
tag_fname = alloc(MAXPATHL + 1);
|
||||
#ifdef FEAT_EMACS_TAGS
|
||||
ebuf = alloc(LSIZE);
|
||||
#endif
|
||||
for (mtt = 0; mtt < MT_COUNT; ++mtt)
|
||||
ga_init2(&ga_match[mtt], (int)sizeof(struct match_found *), 100);
|
||||
hash_init(&ht_match[mtt]);
|
||||
|
||||
/* check for out of memory situation */
|
||||
if (lbuf == NULL || tag_fname == NULL
|
||||
@@ -1759,8 +1752,13 @@ line_read_in:
|
||||
/*
|
||||
* Emacs tags line with CTRL-L: New file name on next line.
|
||||
* The file name is followed by a ','.
|
||||
* Remember etag file name in ebuf.
|
||||
*/
|
||||
if (*lbuf == Ctrl_L) /* remember etag file name in ebuf */
|
||||
if (*lbuf == Ctrl_L
|
||||
# ifdef FEAT_CSCOPE
|
||||
&& !use_cscope
|
||||
# endif
|
||||
)
|
||||
{
|
||||
is_etag = 1; /* in case at the start */
|
||||
state = TS_LINEAR;
|
||||
@@ -2206,10 +2204,12 @@ parse_line:
|
||||
}
|
||||
|
||||
/*
|
||||
* If a match is found, add it to ga_match[].
|
||||
* If a match is found, add it to ht_match[].
|
||||
*/
|
||||
if (match)
|
||||
{
|
||||
int len = 0;
|
||||
|
||||
#ifdef FEAT_CSCOPE
|
||||
if (use_cscope)
|
||||
{
|
||||
@@ -2262,179 +2262,170 @@ parse_line:
|
||||
}
|
||||
|
||||
/*
|
||||
* Add the found match in ga_match[mtt], avoiding duplicates.
|
||||
* Add the found match in ht_match[mtt].
|
||||
* Store the info we need later, which depends on the kind of
|
||||
* tags we are dealing with.
|
||||
*/
|
||||
if (ga_grow(&ga_match[mtt], 1) == OK)
|
||||
if (help_only)
|
||||
{
|
||||
int len;
|
||||
int heuristic;
|
||||
|
||||
if (help_only)
|
||||
{
|
||||
#ifdef FEAT_MULTI_LANG
|
||||
# define ML_EXTRA 3
|
||||
#else
|
||||
# define ML_EXTRA 0
|
||||
#endif
|
||||
/*
|
||||
* Append the help-heuristic number after the
|
||||
* tagname, for sorting it later.
|
||||
*/
|
||||
*tagp.tagname_end = NUL;
|
||||
len = (int)(tagp.tagname_end - tagp.tagname);
|
||||
mfp = (struct match_found *)
|
||||
alloc((int)sizeof(struct match_found) + len
|
||||
+ 10 + ML_EXTRA);
|
||||
if (mfp != NULL)
|
||||
{
|
||||
/* "len" includes the language and the NUL, but
|
||||
* not the priority. */
|
||||
mfp->len = len + ML_EXTRA + 1;
|
||||
#define ML_HELP_LEN 6
|
||||
p = mfp->match;
|
||||
STRCPY(p, tagp.tagname);
|
||||
#ifdef FEAT_MULTI_LANG
|
||||
p[len] = '@';
|
||||
STRCPY(p + len + 1, help_lang);
|
||||
#endif
|
||||
|
||||
heuristic = help_heuristic(tagp.tagname,
|
||||
match_re ? matchoff : 0, !match_no_ic);
|
||||
#ifdef FEAT_MULTI_LANG
|
||||
heuristic += help_pri;
|
||||
#endif
|
||||
sprintf((char *)p + len + 1 + ML_EXTRA, "%06d",
|
||||
heuristic);
|
||||
}
|
||||
*tagp.tagname_end = TAB;
|
||||
}
|
||||
else if (name_only)
|
||||
/*
|
||||
* Append the help-heuristic number after the tagname, for
|
||||
* sorting it later. The heuristic is ignored for
|
||||
* detecting duplicates.
|
||||
* The format is {tagname}@{lang}NUL{heuristic}NUL
|
||||
*/
|
||||
*tagp.tagname_end = NUL;
|
||||
len = (int)(tagp.tagname_end - tagp.tagname);
|
||||
mfp = (char_u *)alloc((int)sizeof(char_u) + len + 10 + ML_EXTRA + 1);
|
||||
if (mfp != NULL)
|
||||
{
|
||||
if (get_it_again)
|
||||
int heuristic;
|
||||
|
||||
p = mfp;
|
||||
STRCPY(p, tagp.tagname);
|
||||
#ifdef FEAT_MULTI_LANG
|
||||
p[len] = '@';
|
||||
STRCPY(p + len + 1, help_lang);
|
||||
#endif
|
||||
|
||||
heuristic = help_heuristic(tagp.tagname,
|
||||
match_re ? matchoff : 0, !match_no_ic);
|
||||
#ifdef FEAT_MULTI_LANG
|
||||
heuristic += help_pri;
|
||||
#endif
|
||||
sprintf((char *)p + len + 1 + ML_EXTRA, "%06d",
|
||||
heuristic);
|
||||
}
|
||||
*tagp.tagname_end = TAB;
|
||||
}
|
||||
else if (name_only)
|
||||
{
|
||||
if (get_it_again)
|
||||
{
|
||||
char_u *temp_end = tagp.command;
|
||||
|
||||
if (*temp_end == '/')
|
||||
while (*temp_end && *temp_end != '\r'
|
||||
&& *temp_end != '\n'
|
||||
&& *temp_end != '$')
|
||||
temp_end++;
|
||||
|
||||
if (tagp.command + 2 < temp_end)
|
||||
{
|
||||
char_u *temp_end = tagp.command;
|
||||
|
||||
if (*temp_end == '/')
|
||||
while (*temp_end && *temp_end != '\r'
|
||||
&& *temp_end != '\n'
|
||||
&& *temp_end != '$')
|
||||
temp_end++;
|
||||
|
||||
if (tagp.command + 2 < temp_end)
|
||||
{
|
||||
len = (int)(temp_end - tagp.command - 2);
|
||||
mfp = (struct match_found *)alloc(
|
||||
(int)sizeof(struct match_found) + len);
|
||||
if (mfp != NULL)
|
||||
{
|
||||
mfp->len = len + 1; /* include the NUL */
|
||||
p = mfp->match;
|
||||
vim_strncpy(p, tagp.command + 2, len);
|
||||
}
|
||||
}
|
||||
else
|
||||
mfp = NULL;
|
||||
get_it_again = FALSE;
|
||||
len = (int)(temp_end - tagp.command - 2);
|
||||
mfp = (char_u *)alloc(len + 2);
|
||||
if (mfp != NULL)
|
||||
vim_strncpy(mfp, tagp.command + 2, len);
|
||||
}
|
||||
else
|
||||
{
|
||||
len = (int)(tagp.tagname_end - tagp.tagname);
|
||||
mfp = (struct match_found *)alloc(
|
||||
(int)sizeof(struct match_found) + len);
|
||||
if (mfp != NULL)
|
||||
{
|
||||
mfp->len = len + 1; /* include the NUL */
|
||||
p = mfp->match;
|
||||
vim_strncpy(p, tagp.tagname, len);
|
||||
}
|
||||
|
||||
/* if wanted, re-read line to get long form too */
|
||||
if (State & INSERT)
|
||||
get_it_again = p_sft;
|
||||
}
|
||||
mfp = NULL;
|
||||
get_it_again = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Save the tag in a buffer.
|
||||
* Emacs tag: <mtt><tag_fname><NUL><ebuf><NUL><lbuf>
|
||||
* other tag: <mtt><tag_fname><NUL><NUL><lbuf>
|
||||
* without Emacs tags: <mtt><tag_fname><NUL><lbuf>
|
||||
*/
|
||||
len = (int)STRLEN(tag_fname)
|
||||
+ (int)STRLEN(lbuf) + 3;
|
||||
#ifdef FEAT_EMACS_TAGS
|
||||
if (is_etag)
|
||||
len += (int)STRLEN(ebuf) + 1;
|
||||
else
|
||||
++len;
|
||||
#endif
|
||||
mfp = (struct match_found *)alloc(
|
||||
(int)sizeof(struct match_found) + len);
|
||||
len = (int)(tagp.tagname_end - tagp.tagname);
|
||||
mfp = (char_u *)alloc((int)sizeof(char_u) + len + 1);
|
||||
if (mfp != NULL)
|
||||
{
|
||||
mfp->len = len;
|
||||
p = mfp->match;
|
||||
p[0] = mtt;
|
||||
STRCPY(p + 1, tag_fname);
|
||||
#ifdef BACKSLASH_IN_FILENAME
|
||||
/* Ignore differences in slashes, avoid adding
|
||||
* both path/file and path\file. */
|
||||
slash_adjust(p + 1);
|
||||
#endif
|
||||
s = p + 1 + STRLEN(tag_fname) + 1;
|
||||
#ifdef FEAT_EMACS_TAGS
|
||||
if (is_etag)
|
||||
{
|
||||
STRCPY(s, ebuf);
|
||||
s += STRLEN(ebuf) + 1;
|
||||
}
|
||||
else
|
||||
*s++ = NUL;
|
||||
#endif
|
||||
STRCPY(s, lbuf);
|
||||
}
|
||||
}
|
||||
vim_strncpy(mfp, tagp.tagname, len);
|
||||
|
||||
if (mfp != NULL)
|
||||
{
|
||||
/*
|
||||
* Don't add identical matches.
|
||||
* This can take a lot of time when finding many
|
||||
* matches, check for CTRL-C now and then.
|
||||
* Add all cscope tags, because they are all listed.
|
||||
*/
|
||||
#ifdef FEAT_CSCOPE
|
||||
if (use_cscope)
|
||||
i = -1;
|
||||
else
|
||||
#endif
|
||||
for (i = ga_match[mtt].ga_len; --i >= 0 && !got_int; )
|
||||
{
|
||||
mfp2 = ((struct match_found **)
|
||||
(ga_match[mtt].ga_data))[i];
|
||||
if (mfp2->len == mfp->len
|
||||
&& memcmp(mfp2->match, mfp->match,
|
||||
(size_t)mfp->len) == 0)
|
||||
break;
|
||||
fast_breakcheck();
|
||||
}
|
||||
if (i < 0)
|
||||
{
|
||||
((struct match_found **)(ga_match[mtt].ga_data))
|
||||
[ga_match[mtt].ga_len++] = mfp;
|
||||
++match_count;
|
||||
}
|
||||
else
|
||||
vim_free(mfp);
|
||||
/* if wanted, re-read line to get long form too */
|
||||
if (State & INSERT)
|
||||
get_it_again = p_sft;
|
||||
}
|
||||
}
|
||||
else /* Out of memory! Just forget about the rest. */
|
||||
else
|
||||
{
|
||||
retval = OK;
|
||||
stop_searching = TRUE;
|
||||
break;
|
||||
#define TAG_SEP 0x01
|
||||
size_t tag_fname_len = STRLEN(tag_fname);
|
||||
#ifdef FEAT_EMACS_TAGS
|
||||
size_t ebuf_len = 0;
|
||||
#endif
|
||||
|
||||
/* Save the tag in a buffer.
|
||||
* Use 0x01 to separate fields (Can't use NUL, because the
|
||||
* hash key is terminated by NUL).
|
||||
* Emacs tag: <mtt><tag_fname><0x01><ebuf><0x01><lbuf><NUL>
|
||||
* other tag: <mtt><tag_fname><0x01><0x01><lbuf><NUL>
|
||||
* without Emacs tags: <mtt><tag_fname><0x01><lbuf><NUL>
|
||||
* Here <mtt> is the "mtt" value plus 1 to avoid NUL.
|
||||
*/
|
||||
len = (int)tag_fname_len + (int)STRLEN(lbuf) + 3;
|
||||
#ifdef FEAT_EMACS_TAGS
|
||||
if (is_etag)
|
||||
{
|
||||
ebuf_len = STRLEN(ebuf);
|
||||
len += (int)ebuf_len + 1;
|
||||
}
|
||||
else
|
||||
++len;
|
||||
#endif
|
||||
mfp = (char_u *)alloc((int)sizeof(char_u) + len + 1);
|
||||
if (mfp != NULL)
|
||||
{
|
||||
p = mfp;
|
||||
p[0] = mtt + 1;
|
||||
STRCPY(p + 1, tag_fname);
|
||||
#ifdef BACKSLASH_IN_FILENAME
|
||||
/* Ignore differences in slashes, avoid adding
|
||||
* both path/file and path\file. */
|
||||
slash_adjust(p + 1);
|
||||
#endif
|
||||
p[tag_fname_len + 1] = TAG_SEP;
|
||||
s = p + 1 + tag_fname_len + 1;
|
||||
#ifdef FEAT_EMACS_TAGS
|
||||
if (is_etag)
|
||||
{
|
||||
STRCPY(s, ebuf);
|
||||
s[ebuf_len] = TAG_SEP;
|
||||
s += ebuf_len + 1;
|
||||
}
|
||||
else
|
||||
*s++ = TAG_SEP;
|
||||
#endif
|
||||
STRCPY(s, lbuf);
|
||||
}
|
||||
}
|
||||
|
||||
if (mfp != NULL)
|
||||
{
|
||||
hashitem_T *hi;
|
||||
|
||||
/*
|
||||
* Don't add identical matches.
|
||||
* Add all cscope tags, because they are all listed.
|
||||
* "mfp" is used as a hash key, there is a NUL byte to end
|
||||
* the part matters for comparing, more bytes may follow
|
||||
* after it. E.g. help tags store the priority after the
|
||||
* NUL.
|
||||
*/
|
||||
#ifdef FEAT_CSCOPE
|
||||
if (use_cscope)
|
||||
hash++;
|
||||
else
|
||||
#endif
|
||||
hash = hash_hash(mfp);
|
||||
hi = hash_lookup(&ht_match[mtt], mfp, hash);
|
||||
if (HASHITEM_EMPTY(hi))
|
||||
{
|
||||
if (hash_add_item(&ht_match[mtt], hi, mfp, hash)
|
||||
== FAIL)
|
||||
{
|
||||
/* Out of memory! Just forget about the rest. */
|
||||
retval = OK;
|
||||
stop_searching = TRUE;
|
||||
break;
|
||||
}
|
||||
else
|
||||
++match_count;
|
||||
}
|
||||
else
|
||||
/* duplicate tag, drop it */
|
||||
vim_free(mfp);
|
||||
}
|
||||
}
|
||||
#ifdef FEAT_CSCOPE
|
||||
@@ -2532,7 +2523,7 @@ findtag_end:
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Move the matches from the ga_match[] arrays into one list of
|
||||
* Move the matches from the ht_match[] arrays into one list of
|
||||
* matches. When retval == FAIL, free the matches.
|
||||
*/
|
||||
if (retval == FAIL)
|
||||
@@ -2546,22 +2537,35 @@ findtag_end:
|
||||
match_count = 0;
|
||||
for (mtt = 0; mtt < MT_COUNT; ++mtt)
|
||||
{
|
||||
for (i = 0; i < ga_match[mtt].ga_len; ++i)
|
||||
hashitem_T *hi;
|
||||
long_u todo;
|
||||
|
||||
todo = (long)ht_match[mtt].ht_used;
|
||||
for (hi = ht_match[mtt].ht_array; todo > 0; ++hi)
|
||||
{
|
||||
mfp = ((struct match_found **)(ga_match[mtt].ga_data))[i];
|
||||
if (matches == NULL)
|
||||
vim_free(mfp);
|
||||
else
|
||||
if (!HASHITEM_EMPTY(hi))
|
||||
{
|
||||
/* To avoid allocating memory again we turn the struct
|
||||
* match_found into a string. For help the priority was not
|
||||
* included in the length. */
|
||||
mch_memmove(mfp, mfp->match,
|
||||
(size_t)(mfp->len + (help_only ? ML_HELP_LEN : 0)));
|
||||
matches[match_count++] = (char_u *)mfp;
|
||||
mfp = hi->hi_key;
|
||||
if (matches == NULL)
|
||||
vim_free(mfp);
|
||||
else
|
||||
{
|
||||
if (!name_only)
|
||||
{
|
||||
/* Change mtt back to zero-based. */
|
||||
*mfp = *mfp - 1;
|
||||
|
||||
/* change the TAG_SEP back to NUL */
|
||||
for (p = mfp + 1; *p != NUL; ++p)
|
||||
if (*p == TAG_SEP)
|
||||
*p = NUL;
|
||||
}
|
||||
matches[match_count++] = (char_u *)mfp;
|
||||
}
|
||||
todo--;
|
||||
}
|
||||
}
|
||||
ga_clear(&ga_match[mtt]);
|
||||
hash_clear(&ht_match[mtt]);
|
||||
}
|
||||
|
||||
*matchesp = matches;
|
||||
|
||||
+17
-7
@@ -857,6 +857,8 @@ static struct builtin_term builtin_termcaps[] =
|
||||
{(int)KS_8F, IF_EB("\033[38;2;%lu;%lu;%lum", ESC_STR "[38;2;%lu;%lu;%lum")},
|
||||
{(int)KS_8B, IF_EB("\033[48;2;%lu;%lu;%lum", ESC_STR "[48;2;%lu;%lu;%lum")},
|
||||
# endif
|
||||
{(int)KS_CBE, IF_EB("\033[?2004h", ESC_STR "[?2004h")},
|
||||
{(int)KS_CBD, IF_EB("\033[?2004l", ESC_STR "[?2004l")},
|
||||
|
||||
{K_UP, IF_EB("\033O*A", ESC_STR "O*A")},
|
||||
{K_DOWN, IF_EB("\033O*B", ESC_STR "O*B")},
|
||||
@@ -902,13 +904,15 @@ static struct builtin_term builtin_termcaps[] =
|
||||
{K_ZEND, IF_EB("\033[8;*~", ESC_STR "[8;*~")},
|
||||
{K_PAGEUP, IF_EB("\033[5;*~", ESC_STR "[5;*~")},
|
||||
{K_PAGEDOWN, IF_EB("\033[6;*~", ESC_STR "[6;*~")},
|
||||
{K_KPLUS, IF_EB("\033O*k", ESC_STR "O*k")}, /* keypad plus */
|
||||
{K_KMINUS, IF_EB("\033O*m", ESC_STR "O*m")}, /* keypad minus */
|
||||
{K_KDIVIDE, IF_EB("\033O*o", ESC_STR "O*o")}, /* keypad / */
|
||||
{K_KMULTIPLY, IF_EB("\033O*j", ESC_STR "O*j")}, /* keypad * */
|
||||
{K_KENTER, IF_EB("\033O*M", ESC_STR "O*M")}, /* keypad Enter */
|
||||
{K_KPOINT, IF_EB("\033O*n", ESC_STR "O*n")}, /* keypad . */
|
||||
{K_KDEL, IF_EB("\033[3;*~", ESC_STR "[3;*~")}, /* keypad Del */
|
||||
{K_KPLUS, IF_EB("\033O*k", ESC_STR "O*k")}, /* keypad plus */
|
||||
{K_KMINUS, IF_EB("\033O*m", ESC_STR "O*m")}, /* keypad minus */
|
||||
{K_KDIVIDE, IF_EB("\033O*o", ESC_STR "O*o")}, /* keypad / */
|
||||
{K_KMULTIPLY, IF_EB("\033O*j", ESC_STR "O*j")}, /* keypad * */
|
||||
{K_KENTER, IF_EB("\033O*M", ESC_STR "O*M")}, /* keypad Enter */
|
||||
{K_KPOINT, IF_EB("\033O*n", ESC_STR "O*n")}, /* keypad . */
|
||||
{K_KDEL, IF_EB("\033[3;*~", ESC_STR "[3;*~")}, /* keypad Del */
|
||||
{K_PS, IF_EB("\033[200~", ESC_STR "[200~")}, /* paste start */
|
||||
{K_PE, IF_EB("\033[201~", ESC_STR "[201~")}, /* paste end */
|
||||
|
||||
{BT_EXTRA_KEYS, ""},
|
||||
{TERMCAP2KEY('k', '0'), IF_EB("\033[10;*~", ESC_STR "[10;*~")}, /* F0 */
|
||||
@@ -1224,6 +1228,8 @@ static struct builtin_term builtin_termcaps[] =
|
||||
{K_KMULTIPLY, "[KMULTIPLY]"},
|
||||
{K_KENTER, "[KENTER]"},
|
||||
{K_KPOINT, "[KPOINT]"},
|
||||
{K_PS, "[PASTE-START]"},
|
||||
{K_PE, "[PASTE-END]"},
|
||||
{K_K0, "[K0]"},
|
||||
{K_K1, "[K1]"},
|
||||
{K_K2, "[K2]"},
|
||||
@@ -1544,6 +1550,8 @@ set_termname(char_u *term)
|
||||
{KS_CSI, "SI"}, {KS_CEI, "EI"},
|
||||
{KS_U7, "u7"}, {KS_RBG, "RB"},
|
||||
{KS_8F, "8f"}, {KS_8B, "8b"},
|
||||
{KS_CBE, "BE"}, {KS_CBD, "BD"},
|
||||
{KS_CPS, "PS"}, {KS_CPE, "PE"},
|
||||
{(enum SpecialKey)0, NULL}
|
||||
};
|
||||
|
||||
@@ -3146,6 +3154,7 @@ starttermcap(void)
|
||||
{
|
||||
out_str(T_TI); /* start termcap mode */
|
||||
out_str(T_KS); /* start "keypad transmit" mode */
|
||||
out_str(T_BE); /* enable bracketed paste moe */
|
||||
out_flush();
|
||||
termcap_active = TRUE;
|
||||
screen_start(); /* don't know where cursor is now */
|
||||
@@ -3195,6 +3204,7 @@ stoptermcap(void)
|
||||
check_for_codes_from_term();
|
||||
}
|
||||
#endif
|
||||
out_str(T_BD); /* disable bracketed paste moe */
|
||||
out_str(T_KE); /* stop "keypad transmit" mode */
|
||||
out_flush();
|
||||
termcap_active = FALSE;
|
||||
|
||||
+10
-2
@@ -89,10 +89,14 @@ enum SpecialKey
|
||||
KS_OP, /* original color pair */
|
||||
KS_U7, /* request cursor position */
|
||||
KS_8F, /* set foreground color (RGB) */
|
||||
KS_8B /* set background color (RGB) */
|
||||
KS_8B, /* set background color (RGB) */
|
||||
KS_CBE, /* enable bracketed paste mode */
|
||||
KS_CBD, /* disable bracketed paste mode */
|
||||
KS_CPS, /* start of brackted paste */
|
||||
KS_CPE /* end of brackted paste */
|
||||
};
|
||||
|
||||
#define KS_LAST KS_8B
|
||||
#define KS_LAST KS_CPE
|
||||
|
||||
/*
|
||||
* the terminal capabilities are stored in this array
|
||||
@@ -170,6 +174,10 @@ extern char_u *(term_strings[]); /* current terminal strings */
|
||||
#define T_U7 (term_str(KS_U7)) /* request cursor position */
|
||||
#define T_8F (term_str(KS_8F)) /* set foreground color (RGB) */
|
||||
#define T_8B (term_str(KS_8B)) /* set background color (RGB) */
|
||||
#define T_BE (term_str(KS_CBE)) /* enable bracketed paste mode */
|
||||
#define T_BD (term_str(KS_CBD)) /* disable bracketed paste mode */
|
||||
#define T_PS (term_str(KS_CPS)) /* start of bracketed paste */
|
||||
#define T_PE (term_str(KS_CPE)) /* end of bracketed paste */
|
||||
|
||||
#define TMODE_COOK 0 /* terminal mode for external cmds and Ex mode */
|
||||
#define TMODE_SLEEP 1 /* terminal mode for sleeping (cooked but no echo) */
|
||||
|
||||
@@ -144,6 +144,7 @@ NEW_TESTS = test_arglist.res \
|
||||
test_channel.res \
|
||||
test_charsearch.res \
|
||||
test_cmdline.res \
|
||||
test_command_count.res \
|
||||
test_crypt.res \
|
||||
test_cscope.res \
|
||||
test_diffmode.res \
|
||||
@@ -174,7 +175,9 @@ NEW_TESTS = test_arglist.res \
|
||||
test_normal.res \
|
||||
test_packadd.res \
|
||||
test_perl.res \
|
||||
test_profile.res \
|
||||
test_quickfix.res \
|
||||
test_retab.res \
|
||||
test_ruby.res \
|
||||
test_search.res \
|
||||
test_signs.res \
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
source test_assign.vim
|
||||
source test_autocmd.vim
|
||||
source test_command_count.vim
|
||||
source test_cursor_func.vim
|
||||
source test_delete.vim
|
||||
source test_execute_func.vim
|
||||
@@ -32,6 +31,7 @@ source test_mapping.vim
|
||||
source test_messages.vim
|
||||
source test_partial.vim
|
||||
source test_popup.vim
|
||||
source test_put.vim
|
||||
source test_reltime.vim
|
||||
source test_searchpos.vim
|
||||
source test_set.vim
|
||||
|
||||
@@ -32,7 +32,7 @@ func Test_assert_notequal()
|
||||
call assert_notequal([1, 2, 3], s)
|
||||
|
||||
call assert_notequal('foo', s)
|
||||
call assert_match("Expected 'foo' differs from 'foo'", v:errors[0])
|
||||
call assert_match("Expected not equal to 'foo'", v:errors[0])
|
||||
call remove(v:errors, 0)
|
||||
endfunc
|
||||
|
||||
|
||||
@@ -322,3 +322,22 @@ func Test_three_windows()
|
||||
call delete('Xtestje2')
|
||||
call delete('Xtestje3')
|
||||
endfunc
|
||||
|
||||
func Test_BufEnter()
|
||||
au! BufEnter
|
||||
au Bufenter * let val = val . '+'
|
||||
let g:val = ''
|
||||
split NewFile
|
||||
call assert_equal('+', g:val)
|
||||
bwipe!
|
||||
call assert_equal('++', g:val)
|
||||
|
||||
" Also get BufEnter when editing a directory
|
||||
call mkdir('Xdir')
|
||||
split Xdir
|
||||
call assert_equal('+++', g:val)
|
||||
bwipe!
|
||||
|
||||
call delete('Xdir', 'd')
|
||||
au! BufEnter
|
||||
endfunc
|
||||
|
||||
@@ -25,6 +25,60 @@ func Test_complete_wildmenu()
|
||||
set nowildmenu
|
||||
endfunc
|
||||
|
||||
func Test_match_completion()
|
||||
if !has('cmdline_compl')
|
||||
return
|
||||
endif
|
||||
hi Aardig ctermfg=green
|
||||
call feedkeys(":match \<Tab>\<Home>\"\<CR>", 'xt')
|
||||
call assert_equal('"match Aardig', getreg(':'))
|
||||
call feedkeys(":match \<S-Tab>\<Home>\"\<CR>", 'xt')
|
||||
call assert_equal('"match none', getreg(':'))
|
||||
endfunc
|
||||
|
||||
func Test_highlight_completion()
|
||||
if !has('cmdline_compl')
|
||||
return
|
||||
endif
|
||||
hi Aardig ctermfg=green
|
||||
call feedkeys(":hi \<Tab>\<Home>\"\<CR>", 'xt')
|
||||
call assert_equal('"hi Aardig', getreg(':'))
|
||||
call feedkeys(":hi li\<S-Tab>\<Home>\"\<CR>", 'xt')
|
||||
call assert_equal('"hi link', getreg(':'))
|
||||
call feedkeys(":hi d\<S-Tab>\<Home>\"\<CR>", 'xt')
|
||||
call assert_equal('"hi default', getreg(':'))
|
||||
call feedkeys(":hi c\<S-Tab>\<Home>\"\<CR>", 'xt')
|
||||
call assert_equal('"hi clear', getreg(':'))
|
||||
endfunc
|
||||
|
||||
func Test_expr_completion()
|
||||
if !has('cmdline_compl')
|
||||
return
|
||||
endif
|
||||
for cmd in [
|
||||
\ 'let a = ',
|
||||
\ 'if',
|
||||
\ 'elseif',
|
||||
\ 'while',
|
||||
\ 'for',
|
||||
\ 'echo',
|
||||
\ 'echon',
|
||||
\ 'execute',
|
||||
\ 'echomsg',
|
||||
\ 'echoerr',
|
||||
\ 'call',
|
||||
\ 'return',
|
||||
\ 'cexpr',
|
||||
\ 'caddexpr',
|
||||
\ 'cgetexpr',
|
||||
\ 'lexpr',
|
||||
\ 'laddexpr',
|
||||
\ 'lgetexpr']
|
||||
call feedkeys(":" . cmd . " getl\<Tab>\<Home>\"\<CR>", 'xt')
|
||||
call assert_equal('"' . cmd . ' getline(', getreg(':'))
|
||||
endfor
|
||||
endfunc
|
||||
|
||||
func Test_getcompletion()
|
||||
if !has('cmdline_compl')
|
||||
return
|
||||
|
||||
@@ -152,7 +152,7 @@ func Test_json_decode()
|
||||
call assert_fails('call json_decode("blah")', "E474:")
|
||||
call assert_fails('call json_decode("true blah")', "E488:")
|
||||
call assert_fails('call json_decode("<foobar>")', "E474:")
|
||||
call assert_fails('call json_decode("{\"a\":1,\"a\":2}")', "E937:")
|
||||
call assert_fails('call json_decode("{\"a\":1,\"a\":2}")', "E938:")
|
||||
|
||||
call assert_fails('call json_decode("{")', "E474:")
|
||||
call assert_fails('call json_decode("{foobar}")', "E474:")
|
||||
|
||||
+22
-10
@@ -224,21 +224,33 @@ func! Test_normal06_formatprg()
|
||||
" only test on non windows platform
|
||||
if has('win32')
|
||||
return
|
||||
else
|
||||
" uses sed to number non-empty lines
|
||||
call writefile(['#!/bin/sh', 'sed ''/./=''|sed ''/./{', 'N', 's/\n/ /', '}'''], 'Xsed_format.sh')
|
||||
call system('chmod +x ./Xsed_format.sh')
|
||||
endif
|
||||
call Setup_NewWindow()
|
||||
%d
|
||||
call setline(1, ['a', '', 'c', '', ' ', 'd', 'e'])
|
||||
|
||||
" uses sed to number non-empty lines
|
||||
call writefile(['#!/bin/sh', 'sed ''/./=''|sed ''/./{', 'N', 's/\n/ /', '}'''], 'Xsed_format.sh')
|
||||
call system('chmod +x ./Xsed_format.sh')
|
||||
let text = ['a', '', 'c', '', ' ', 'd', 'e']
|
||||
let expected = ['1 a', '', '3 c', '', '5 ', '6 d', '7 e']
|
||||
|
||||
10new
|
||||
call setline(1, text)
|
||||
set formatprg=./Xsed_format.sh
|
||||
norm! gggqG
|
||||
call assert_equal(['1 a', '', '3 c', '', '5 ', '6 d', '7 e'], getline(1, '$'))
|
||||
call assert_equal(expected, getline(1, '$'))
|
||||
bw!
|
||||
|
||||
10new
|
||||
call setline(1, text)
|
||||
set formatprg=donothing
|
||||
setlocal formatprg=./Xsed_format.sh
|
||||
norm! gggqG
|
||||
call assert_equal(expected, getline(1, '$'))
|
||||
bw!
|
||||
|
||||
" clean up
|
||||
set formatprg=
|
||||
setlocal formatprg=
|
||||
call delete('Xsed_format.sh')
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
func! Test_normal07_internalfmt()
|
||||
@@ -251,7 +263,7 @@ func! Test_normal07_internalfmt()
|
||||
norm! gggqG
|
||||
call assert_equal(['1 2 3', '4 5 6', '7 8 9', '10 11 '], getline(1, '$'))
|
||||
" clean up
|
||||
set formatprg= tw=0
|
||||
set tw=0
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
" Test Vim profiler
|
||||
if !has('profile')
|
||||
finish
|
||||
endif
|
||||
|
||||
func Test_profile_func()
|
||||
let lines = [
|
||||
\ "func! Foo1()",
|
||||
\ "endfunc",
|
||||
\ "func! Foo2()",
|
||||
\ " let l:count = 100",
|
||||
\ " while l:count > 0",
|
||||
\ " let l:count = l:count - 1",
|
||||
\ " endwhile",
|
||||
\ "endfunc",
|
||||
\ "func! Foo3()",
|
||||
\ "endfunc",
|
||||
\ "func! Bar()",
|
||||
\ "endfunc",
|
||||
\ "call Foo1()",
|
||||
\ "call Foo1()",
|
||||
\ "profile pause",
|
||||
\ "call Foo1()",
|
||||
\ "profile continue",
|
||||
\ "call Foo2()",
|
||||
\ "call Foo3()",
|
||||
\ "call Bar()",
|
||||
\ "if !v:profiling",
|
||||
\ " delfunc Foo2",
|
||||
\ "endif",
|
||||
\ "delfunc Foo3",
|
||||
\ ]
|
||||
|
||||
call writefile(lines, 'Xprofile_func.vim')
|
||||
call system(v:progpath
|
||||
\ . ' -es -u NONE -U NONE -i NONE --noplugin'
|
||||
\ . ' -c "profile start Xprofile_func.log"'
|
||||
\ . ' -c "profile func Foo*"'
|
||||
\ . ' -c "so Xprofile_func.vim"'
|
||||
\ . ' -c "qall!"')
|
||||
call assert_equal(0, v:shell_error)
|
||||
|
||||
let lines = readfile('Xprofile_func.log')
|
||||
|
||||
" - Foo1() is called 3 times but should be reported as called twice
|
||||
" since one call is in between "profile pause" .. "profile continue".
|
||||
" - Foo2() should come before Foo1() since Foo1() does much more work.
|
||||
" - Foo3() is not reported because function is deleted.
|
||||
" - Unlike Foo3(), Foo2() should not be deleted since there is a check
|
||||
" for v:profiling.
|
||||
" - Bar() is not reported since it does not match "profile func Foo*".
|
||||
call assert_equal(28, len(lines))
|
||||
|
||||
call assert_equal('FUNCTION Foo1()', lines[0])
|
||||
call assert_equal('Called 2 times', lines[1])
|
||||
call assert_match('^Total time:\s\+\d\+\.\d\+$', lines[2])
|
||||
call assert_match('^ Self time:\s\+\d\+\.\d\+$', lines[3])
|
||||
call assert_equal('', lines[4])
|
||||
call assert_equal('count total (s) self (s)', lines[5])
|
||||
call assert_equal('', lines[6])
|
||||
call assert_equal('FUNCTION Foo2()', lines[7])
|
||||
call assert_equal('Called 1 time', lines[8])
|
||||
call assert_match('^Total time:\s\+\d\+\.\d\+$', lines[9])
|
||||
call assert_match('^ Self time:\s\+\d\+\.\d\+$', lines[10])
|
||||
call assert_equal('', lines[11])
|
||||
call assert_equal('count total (s) self (s)', lines[12])
|
||||
call assert_match('^\s*1\s\+.*\slet l:count = 100$', lines[13])
|
||||
call assert_match('^\s*101\s\+.*\swhile l:count > 0$', lines[14])
|
||||
call assert_match('^\s*100\s\+.*\s let l:count = l:count - 1$', lines[15])
|
||||
call assert_match('^\s*100\s\+.*\sendwhile$', lines[16])
|
||||
call assert_equal('', lines[17])
|
||||
call assert_equal('FUNCTIONS SORTED ON TOTAL TIME', lines[18])
|
||||
call assert_equal('count total (s) self (s) function', lines[19])
|
||||
call assert_match('^\s*1\s\+\d\+\.\d\+\s\+Foo2()$', lines[20])
|
||||
call assert_match('^\s*2\s\+\d\+\.\d\+\s\+Foo1()$', lines[21])
|
||||
call assert_equal('', lines[22])
|
||||
call assert_equal('FUNCTIONS SORTED ON SELF TIME', lines[23])
|
||||
call assert_equal('count total (s) self (s) function', lines[24])
|
||||
call assert_match('^\s*1\s\+\d\+\.\d\+\s\+Foo2()$', lines[25])
|
||||
call assert_match('^\s*2\s\+\d\+\.\d\+\s\+Foo1()$', lines[26])
|
||||
call assert_equal('', lines[27])
|
||||
|
||||
call delete('Xprofile_func.vim')
|
||||
call delete('Xprofile_func.log')
|
||||
endfunc
|
||||
|
||||
func Test_profile_file()
|
||||
let lines = [
|
||||
\ 'func! Foo()',
|
||||
\ 'endfunc',
|
||||
\ 'for i in range(10)',
|
||||
\ ' " a comment',
|
||||
\ ' call Foo()',
|
||||
\ 'endfor',
|
||||
\ 'call Foo()',
|
||||
\ ]
|
||||
|
||||
call writefile(lines, 'Xprofile_file.vim')
|
||||
call system(v:progpath
|
||||
\ . ' -es -u NONE -U NONE -i NONE --noplugin'
|
||||
\ . ' -c "profile start Xprofile_file.log"'
|
||||
\ . ' -c "profile file Xprofile_file.vim"'
|
||||
\ . ' -c "so Xprofile_file.vim"'
|
||||
\ . ' -c "so Xprofile_file.vim"'
|
||||
\ . ' -c "qall!"')
|
||||
call assert_equal(0, v:shell_error)
|
||||
|
||||
let lines = readfile('Xprofile_file.log')
|
||||
|
||||
call assert_equal(14, len(lines))
|
||||
|
||||
call assert_match('^SCRIPT .*Xprofile_file.vim$', lines[0])
|
||||
call assert_equal('Sourced 2 times', lines[1])
|
||||
call assert_match('^Total time:\s\+\d\+\.\d\+$', lines[2])
|
||||
call assert_match('^ Self time:\s\+\d\+\.\d\+$', lines[3])
|
||||
call assert_equal('', lines[4])
|
||||
call assert_equal('count total (s) self (s)', lines[5])
|
||||
call assert_equal(' func! Foo()', lines[6])
|
||||
call assert_equal(' endfunc', lines[7])
|
||||
" Loop iterates 10 times. Since script runs twice, body executes 20 times.
|
||||
" First line of loop executes one more time than body to detect end of loop.
|
||||
call assert_match('^\s*22\s\+\d\+\.\d\+\s\+for i in range(10)$', lines[8])
|
||||
call assert_equal(' " a comment', lines[9])
|
||||
call assert_match('^\s*20\s\+\d\+\.\d\+\s\+\d\+\.\d\+\s\+call Foo()$', lines[10])
|
||||
call assert_match('^\s*20\s\+\d\+\.\d\+\s\+endfor$', lines[11])
|
||||
" if self and total are equal we only get one number
|
||||
call assert_match('^\s*2\s\+\(\d\+\.\d\+\s\+\)\=\d\+\.\d\+\s\+call Foo()$', lines[12])
|
||||
call assert_equal('', lines[13])
|
||||
|
||||
call delete('Xprofile_file.vim')
|
||||
call delete('Xprofile_file.log')
|
||||
endfunc
|
||||
|
||||
func Test_profile_completion()
|
||||
call feedkeys(":profile \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"profile continue file func pause start', @:)
|
||||
|
||||
call feedkeys(":profile start test_prof\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_match('^"profile start.* test_profile\.vim', @:)
|
||||
endfunc
|
||||
|
||||
func Test_profile_errors()
|
||||
call assert_fails("profile func Foo", 'E750:')
|
||||
call assert_fails("profile pause", 'E750:')
|
||||
call assert_fails("profile continue", 'E750:')
|
||||
endfunc
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
func Test_put_block()
|
||||
if !has('multi_byte')
|
||||
return
|
||||
endif
|
||||
new
|
||||
call feedkeys("i\<C-V>u2500\<CR>x\<ESC>", 'x')
|
||||
call feedkeys("\<C-V>y", 'x')
|
||||
call feedkeys("gg0p", 'x')
|
||||
call assert_equal("\u2500x", getline(1))
|
||||
bwipe!
|
||||
endfunc
|
||||
@@ -0,0 +1,77 @@
|
||||
" Test :retab
|
||||
func SetUp()
|
||||
new
|
||||
call setline(1, "\ta \t b c ")
|
||||
endfunc
|
||||
|
||||
func TearDown()
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Retab(bang, n)
|
||||
let l:old_tabstop = &tabstop
|
||||
let l:old_line = getline(1)
|
||||
exe "retab" . a:bang . a:n
|
||||
let l:line = getline(1)
|
||||
call setline(1, l:old_line)
|
||||
if a:n > 0
|
||||
" :retab changes 'tabstop' to n with argument n > 0.
|
||||
call assert_equal(a:n, &tabstop)
|
||||
exe 'set tabstop=' . l:old_tabstop
|
||||
else
|
||||
" :retab does not change 'tabstop' with empty or n <= 0.
|
||||
call assert_equal(l:old_tabstop, &tabstop)
|
||||
endif
|
||||
return l:line
|
||||
endfunc
|
||||
|
||||
func Test_retab()
|
||||
set tabstop=8 noexpandtab
|
||||
call assert_equal("\ta\t b c ", Retab('', ''))
|
||||
call assert_equal("\ta\t b c ", Retab('', 0))
|
||||
call assert_equal("\ta\t b c ", Retab('', 8))
|
||||
call assert_equal("\ta\t b\t c\t ", Retab('!', ''))
|
||||
call assert_equal("\ta\t b\t c\t ", Retab('!', 0))
|
||||
call assert_equal("\ta\t b\t c\t ", Retab('!', 8))
|
||||
|
||||
call assert_equal("\t\ta\t\t\tb c ", Retab('', 4))
|
||||
call assert_equal("\t\ta\t\t\tb\t\t c\t ", Retab('!', 4))
|
||||
|
||||
call assert_equal(" a\t\tb c ", Retab('', 10))
|
||||
call assert_equal(" a\t\tb c ", Retab('!', 10))
|
||||
|
||||
set tabstop=8 expandtab
|
||||
call assert_equal(" a b c ", Retab('', ''))
|
||||
call assert_equal(" a b c ", Retab('', 0))
|
||||
call assert_equal(" a b c ", Retab('', 8))
|
||||
call assert_equal(" a b c ", Retab('!', ''))
|
||||
call assert_equal(" a b c ", Retab('!', 0))
|
||||
call assert_equal(" a b c ", Retab('!', 8))
|
||||
|
||||
call assert_equal(" a b c ", Retab(' ', 4))
|
||||
call assert_equal(" a b c ", Retab('!', 4))
|
||||
|
||||
call assert_equal(" a b c ", Retab(' ', 10))
|
||||
call assert_equal(" a b c ", Retab('!', 10))
|
||||
|
||||
set tabstop=4 noexpandtab
|
||||
call assert_equal("\ta\t\tb c ", Retab('', ''))
|
||||
call assert_equal("\ta\t\tb\t\t c\t ", Retab('!', ''))
|
||||
call assert_equal("\t a\t\t\tb c ", Retab('', 3))
|
||||
call assert_equal("\t a\t\t\tb\t\t\tc\t ", Retab('!', 3))
|
||||
call assert_equal(" a\t b c ", Retab('', 5))
|
||||
call assert_equal(" a\t b\t\t c\t ", Retab('!', 5))
|
||||
|
||||
set tabstop=4 expandtab
|
||||
call assert_equal(" a b c ", Retab('', ''))
|
||||
call assert_equal(" a b c ", Retab('!', ''))
|
||||
call assert_equal(" a b c ", Retab('', 3))
|
||||
call assert_equal(" a b c ", Retab('!', 3))
|
||||
call assert_equal(" a b c ", Retab('', 5))
|
||||
call assert_equal(" a b c ", Retab('!', 5))
|
||||
endfunc
|
||||
|
||||
func Test_retab_error()
|
||||
call assert_fails('retab -1', 'E487:')
|
||||
call assert_fails('retab! -1', 'E487:')
|
||||
endfunc
|
||||
@@ -156,9 +156,193 @@ func Test_syntax_completion()
|
||||
call feedkeys(":syn sync \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"syn sync ccomment clear fromstart linebreaks= linecont lines= match maxlines= minlines= region', @:)
|
||||
|
||||
" Check that clearing "Aap" avoids it showing up before Boolean.
|
||||
hi Aap ctermfg=blue
|
||||
call feedkeys(":syn list \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_match('^"syn list Aap Boolean Character ', @:)
|
||||
hi clear Aap
|
||||
|
||||
call feedkeys(":syn list \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_match('^"syn list Boolean Character ', @:)
|
||||
|
||||
call feedkeys(":syn match \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_match('^"syn match Boolean Character ', @:)
|
||||
endfunc
|
||||
|
||||
func Test_syntax_arg_skipped()
|
||||
syn clear
|
||||
syntax case ignore
|
||||
if 0
|
||||
syntax case match
|
||||
endif
|
||||
call assert_match('case ignore', execute('syntax case'))
|
||||
|
||||
syn keyword Foo foo
|
||||
call assert_match('Foo', execute('syntax'))
|
||||
syn clear
|
||||
call assert_match('case match', execute('syntax case'))
|
||||
call assert_notmatch('Foo', execute('syntax'))
|
||||
|
||||
if has('conceal')
|
||||
syn clear
|
||||
syntax conceal on
|
||||
if 0
|
||||
syntax conceal off
|
||||
endif
|
||||
call assert_match('conceal on', execute('syntax conceal'))
|
||||
syn clear
|
||||
call assert_match('conceal off', execute('syntax conceal'))
|
||||
|
||||
syntax conceal on
|
||||
syntax conceal off
|
||||
call assert_match('conceal off', execute('syntax conceal'))
|
||||
endif
|
||||
|
||||
syntax region Bar start=/</ end=/>/
|
||||
if 0
|
||||
syntax region NotTest start=/</ end=/>/ contains=@Spell
|
||||
endif
|
||||
call assert_match('Bar', execute('syntax'))
|
||||
call assert_notmatch('NotTest', execute('syntax'))
|
||||
call assert_notmatch('Spell', execute('syntax'))
|
||||
|
||||
hi Foo ctermfg=blue
|
||||
let a = execute('hi Foo')
|
||||
if 0
|
||||
syntax rest
|
||||
endif
|
||||
call assert_equal(a, execute('hi Foo'))
|
||||
hi clear Bar
|
||||
hi clear Foo
|
||||
|
||||
set ft=tags
|
||||
syn off
|
||||
if 0
|
||||
syntax enable
|
||||
endif
|
||||
call assert_match('No Syntax items defined', execute('syntax'))
|
||||
syntax enable
|
||||
call assert_match('tagComment', execute('syntax'))
|
||||
set ft=
|
||||
|
||||
syn clear
|
||||
if 0
|
||||
syntax include @Spell nothing
|
||||
endif
|
||||
call assert_notmatch('Spell', execute('syntax'))
|
||||
|
||||
syn clear
|
||||
syn iskeyword 48-57,$,_
|
||||
call assert_match('48-57,$,_', execute('syntax iskeyword'))
|
||||
if 0
|
||||
syn clear
|
||||
syn iskeyword clear
|
||||
endif
|
||||
call assert_match('48-57,$,_', execute('syntax iskeyword'))
|
||||
syn iskeyword clear
|
||||
call assert_match('not set', execute('syntax iskeyword'))
|
||||
syn iskeyword 48-57,$,_
|
||||
syn clear
|
||||
call assert_match('not set', execute('syntax iskeyword'))
|
||||
|
||||
syn clear
|
||||
syn keyword Foo foo
|
||||
if 0
|
||||
syn keyword NotAdded bar
|
||||
endif
|
||||
call assert_match('Foo', execute('syntax'))
|
||||
call assert_notmatch('NotAdded', execute('highlight'))
|
||||
|
||||
syn clear
|
||||
syn keyword Foo foo
|
||||
call assert_match('Foo', execute('syntax'))
|
||||
call assert_match('Foo', execute('syntax list'))
|
||||
call assert_notmatch('Foo', execute('if 0 | syntax | endif'))
|
||||
call assert_notmatch('Foo', execute('if 0 | syntax list | endif'))
|
||||
|
||||
syn clear
|
||||
syn match Fopi /asdf/
|
||||
if 0
|
||||
syn match Fopx /asdf/
|
||||
endif
|
||||
call assert_match('Fopi', execute('syntax'))
|
||||
call assert_notmatch('Fopx', execute('syntax'))
|
||||
|
||||
syn clear
|
||||
syn spell toplevel
|
||||
call assert_match('spell toplevel', execute('syntax spell'))
|
||||
if 0
|
||||
syn spell notoplevel
|
||||
endif
|
||||
call assert_match('spell toplevel', execute('syntax spell'))
|
||||
syn spell notoplevel
|
||||
call assert_match('spell notoplevel', execute('syntax spell'))
|
||||
syn spell default
|
||||
call assert_match('spell default', execute('syntax spell'))
|
||||
|
||||
syn clear
|
||||
if 0
|
||||
syntax cluster Spell
|
||||
endif
|
||||
call assert_notmatch('Spell', execute('syntax'))
|
||||
|
||||
syn clear
|
||||
syn keyword Foo foo
|
||||
syn sync ccomment
|
||||
syn sync maxlines=5
|
||||
if 0
|
||||
syn sync maxlines=11
|
||||
endif
|
||||
call assert_match('on C-style comments', execute('syntax sync'))
|
||||
call assert_match('maximal 5 lines', execute('syntax sync'))
|
||||
syn sync clear
|
||||
if 0
|
||||
syn sync ccomment
|
||||
endif
|
||||
call assert_notmatch('on C-style comments', execute('syntax sync'))
|
||||
|
||||
syn clear
|
||||
endfunc
|
||||
|
||||
func Test_invalid_arg()
|
||||
call assert_fails('syntax case asdf', 'E390:')
|
||||
if has('conceal')
|
||||
call assert_fails('syntax conceal asdf', 'E390:')
|
||||
endif
|
||||
call assert_fails('syntax spell asdf', 'E390:')
|
||||
endfunc
|
||||
|
||||
func Test_syn_sync()
|
||||
syntax region HereGroup start=/this/ end=/that/
|
||||
syntax sync match SyncHere grouphere HereGroup "pattern"
|
||||
call assert_match('SyncHere', execute('syntax sync'))
|
||||
syn sync clear
|
||||
call assert_notmatch('SyncHere', execute('syntax sync'))
|
||||
syn clear
|
||||
endfunc
|
||||
|
||||
func Test_syn_clear()
|
||||
syntax keyword Foo foo
|
||||
syntax keyword Bar tar
|
||||
call assert_match('Foo', execute('syntax'))
|
||||
call assert_match('Bar', execute('syntax'))
|
||||
syn clear Foo
|
||||
call assert_notmatch('Foo', execute('syntax'))
|
||||
call assert_match('Bar', execute('syntax'))
|
||||
syn clear Foo Bar
|
||||
call assert_notmatch('Foo', execute('syntax'))
|
||||
call assert_notmatch('Bar', execute('syntax'))
|
||||
hi clear Foo
|
||||
hi clear Bar
|
||||
endfunc
|
||||
|
||||
func Test_invalid_name()
|
||||
syn clear
|
||||
syn keyword Nop yes
|
||||
call assert_fails("syntax keyword Wr\x17ong bar", 'E669:')
|
||||
syntax keyword @Wrong bar
|
||||
call assert_match('W18:', execute('1messages'))
|
||||
syn clear
|
||||
hi clear Nop
|
||||
hi clear @Wrong
|
||||
endfunc
|
||||
|
||||
@@ -46,3 +46,47 @@ function! Test_System()
|
||||
|
||||
call assert_fails('call system("wc -l", 99999)', 'E86:')
|
||||
endfunction
|
||||
|
||||
function! Test_system_exmode()
|
||||
if has('unix') " echo $? only works on Unix
|
||||
let cmd = ' -es -u NONE -c "source Xscript" +q; echo $?'
|
||||
" Need to put this in a script, "catch" isn't found after an unknown
|
||||
" function.
|
||||
call writefile(['try', 'call doesnotexist()', 'catch', 'endtry'], 'Xscript')
|
||||
let a = system(v:progpath . cmd)
|
||||
call assert_equal('0', a[0])
|
||||
call assert_equal(0, v:shell_error)
|
||||
endif
|
||||
|
||||
" Error before try does set error flag.
|
||||
call writefile(['call nosuchfunction()', 'try', 'call doesnotexist()', 'catch', 'endtry'], 'Xscript')
|
||||
if has('unix') " echo $? only works on Unix
|
||||
let a = system(v:progpath . cmd)
|
||||
call assert_notequal('0', a[0])
|
||||
endif
|
||||
|
||||
let cmd = ' -es -u NONE -c "source Xscript" +q'
|
||||
let a = system(v:progpath . cmd)
|
||||
call assert_notequal(0, v:shell_error)
|
||||
call delete('Xscript')
|
||||
|
||||
if has('unix') " echo $? only works on Unix
|
||||
let cmd = ' -es -u NONE -c "call doesnotexist()" +q; echo $?'
|
||||
let a = system(v:progpath. cmd)
|
||||
call assert_notequal(0, a[0])
|
||||
endif
|
||||
|
||||
let cmd = ' -es -u NONE -c "call doesnotexist()" +q'
|
||||
let a = system(v:progpath. cmd)
|
||||
call assert_notequal(0, v:shell_error)
|
||||
|
||||
if has('unix') " echo $? only works on Unix
|
||||
let cmd = ' -es -u NONE -c "call doesnotexist()|let a=1" +q; echo $?'
|
||||
let a = system(v:progpath. cmd)
|
||||
call assert_notequal(0, a[0])
|
||||
endif
|
||||
|
||||
let cmd = ' -es -u NONE -c "call doesnotexist()|let a=1" +q'
|
||||
let a = system(v:progpath. cmd)
|
||||
call assert_notequal(0, v:shell_error)
|
||||
endfunc
|
||||
|
||||
@@ -23,6 +23,24 @@ func Test_cancel_ptjump()
|
||||
quit
|
||||
endfunc
|
||||
|
||||
func Test_static_tagjump()
|
||||
set tags=Xtags
|
||||
call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//",
|
||||
\ "one\tXfile1\t/^one/;\"\tf\tfile:\tsignature:(void)",
|
||||
\ "word\tXfile2\tcmd2"],
|
||||
\ 'Xtags')
|
||||
new Xfile1
|
||||
call setline(1, ['empty', 'one()', 'empty'])
|
||||
write
|
||||
tag one
|
||||
call assert_equal(2, line('.'))
|
||||
|
||||
set tags&
|
||||
call delete('Xtags')
|
||||
call delete('Xfile1')
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Tests for [ CTRL-I and CTRL-W CTRL-I commands
|
||||
function Test_keyword_jump()
|
||||
call writefile(["#include Xinclude", "",
|
||||
|
||||
@@ -176,7 +176,17 @@ func Test_undojoin()
|
||||
call assert_equal(['aaaa', 'bbbb', 'cccc'], getline(2, '$'))
|
||||
call feedkeys("u", 'xt')
|
||||
call assert_equal(['aaaa'], getline(2, '$'))
|
||||
close!
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_undojoin_redo()
|
||||
new
|
||||
call setline(1, ['first line', 'second line'])
|
||||
call feedkeys("ixx\<Esc>", 'xt')
|
||||
call feedkeys(":undojoin | redo\<CR>", 'xt')
|
||||
call assert_equal('xxfirst line', getline(1))
|
||||
call assert_equal('second line', getline(2))
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_undo_write()
|
||||
|
||||
@@ -1226,7 +1226,7 @@ func Test_num64()
|
||||
|
||||
call assert_equal( 9223372036854775807, 1 / 0)
|
||||
call assert_equal(-9223372036854775807, -1 / 0)
|
||||
call assert_equal(-9223372036854775808, 0 / 0)
|
||||
call assert_equal(-9223372036854775807 - 1, 0 / 0)
|
||||
|
||||
call assert_equal( 0x7FFFffffFFFFffff, float2nr( 1.0e150))
|
||||
call assert_equal(-0x7FFFffffFFFFffff, float2nr(-1.0e150))
|
||||
@@ -1238,6 +1238,77 @@ func Test_num64()
|
||||
call assert_equal(rng, sort(range(0x100000001, 0xFFFFffff, -1), 'N'))
|
||||
endfunc
|
||||
|
||||
"-------------------------------------------------------------------------------
|
||||
" Test 95: lines of :append, :change, :insert {{{1
|
||||
"-------------------------------------------------------------------------------
|
||||
|
||||
function! DefineFunction(name, body)
|
||||
let func = join(['function! ' . a:name . '()'] + a:body + ['endfunction'], "\n")
|
||||
exec func
|
||||
endfunction
|
||||
|
||||
func Test_script_lines()
|
||||
" :append
|
||||
try
|
||||
call DefineFunction('T_Append', [
|
||||
\ 'append',
|
||||
\ 'py <<EOS',
|
||||
\ '.',
|
||||
\ ])
|
||||
catch
|
||||
call assert_false(1, "Can't define function")
|
||||
endtry
|
||||
try
|
||||
call DefineFunction('T_Append', [
|
||||
\ 'append',
|
||||
\ 'abc',
|
||||
\ ])
|
||||
call assert_false(1, "Shouldn't be able to define function")
|
||||
catch
|
||||
call assert_exception('Vim(function):E126: Missing :endfunction')
|
||||
endtry
|
||||
|
||||
" :change
|
||||
try
|
||||
call DefineFunction('T_Change', [
|
||||
\ 'change',
|
||||
\ 'py <<EOS',
|
||||
\ '.',
|
||||
\ ])
|
||||
catch
|
||||
call assert_false(1, "Can't define function")
|
||||
endtry
|
||||
try
|
||||
call DefineFunction('T_Change', [
|
||||
\ 'change',
|
||||
\ 'abc',
|
||||
\ ])
|
||||
call assert_false(1, "Shouldn't be able to define function")
|
||||
catch
|
||||
call assert_exception('Vim(function):E126: Missing :endfunction')
|
||||
endtry
|
||||
|
||||
" :insert
|
||||
try
|
||||
call DefineFunction('T_Insert', [
|
||||
\ 'insert',
|
||||
\ 'py <<EOS',
|
||||
\ '.',
|
||||
\ ])
|
||||
catch
|
||||
call assert_false(1, "Can't define function")
|
||||
endtry
|
||||
try
|
||||
call DefineFunction('T_Insert', [
|
||||
\ 'insert',
|
||||
\ 'abc',
|
||||
\ ])
|
||||
call assert_false(1, "Shouldn't be able to define function")
|
||||
catch
|
||||
call assert_exception('Vim(function):E126: Missing :endfunction')
|
||||
endtry
|
||||
endfunc
|
||||
|
||||
"-------------------------------------------------------------------------------
|
||||
" Modelines {{{1
|
||||
" vim: ts=8 sw=4 tw=80 fdm=marker
|
||||
|
||||
+2
-5
@@ -3136,11 +3136,8 @@ ex_undojoin(exarg_T *eap UNUSED)
|
||||
if (get_undolevel() < 0)
|
||||
return; /* no entries, nothing to do */
|
||||
else
|
||||
{
|
||||
/* Go back to the last entry */
|
||||
curbuf->b_u_curhead = curbuf->b_u_newhead;
|
||||
curbuf->b_u_synced = FALSE; /* no entries, nothing to do */
|
||||
}
|
||||
/* Append next change to the last entry */
|
||||
curbuf->b_u_synced = FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+6
-1
@@ -2085,9 +2085,14 @@ ex_function(exarg_T *eap)
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for ":append" or ":insert". */
|
||||
/* Check for ":append", ":change", ":insert". */
|
||||
p = skip_range(p, NULL);
|
||||
if ((p[0] == 'a' && (!ASCII_ISALPHA(p[1]) || p[1] == 'p'))
|
||||
|| (p[0] == 'c'
|
||||
&& (!ASCII_ISALPHA(p[1]) || (p[1] == 'h'
|
||||
&& (!ASCII_ISALPHA(p[2]) || (p[2] == 'a'
|
||||
&& (STRNCMP(&p[3], "nge", 3) != 0
|
||||
|| !ASCII_ISALPHA(p[6])))))))
|
||||
|| (p[0] == 'i'
|
||||
&& (!ASCII_ISALPHA(p[1]) || (p[1] == 'n'
|
||||
&& (!ASCII_ISALPHA(p[2]) || (p[2] == 's'))))))
|
||||
|
||||
+100
@@ -779,6 +779,106 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
222,
|
||||
/**/
|
||||
221,
|
||||
/**/
|
||||
220,
|
||||
/**/
|
||||
219,
|
||||
/**/
|
||||
218,
|
||||
/**/
|
||||
217,
|
||||
/**/
|
||||
216,
|
||||
/**/
|
||||
215,
|
||||
/**/
|
||||
214,
|
||||
/**/
|
||||
213,
|
||||
/**/
|
||||
212,
|
||||
/**/
|
||||
211,
|
||||
/**/
|
||||
210,
|
||||
/**/
|
||||
209,
|
||||
/**/
|
||||
208,
|
||||
/**/
|
||||
207,
|
||||
/**/
|
||||
206,
|
||||
/**/
|
||||
205,
|
||||
/**/
|
||||
204,
|
||||
/**/
|
||||
203,
|
||||
/**/
|
||||
202,
|
||||
/**/
|
||||
201,
|
||||
/**/
|
||||
200,
|
||||
/**/
|
||||
199,
|
||||
/**/
|
||||
198,
|
||||
/**/
|
||||
197,
|
||||
/**/
|
||||
196,
|
||||
/**/
|
||||
195,
|
||||
/**/
|
||||
194,
|
||||
/**/
|
||||
193,
|
||||
/**/
|
||||
192,
|
||||
/**/
|
||||
191,
|
||||
/**/
|
||||
190,
|
||||
/**/
|
||||
189,
|
||||
/**/
|
||||
188,
|
||||
/**/
|
||||
187,
|
||||
/**/
|
||||
186,
|
||||
/**/
|
||||
185,
|
||||
/**/
|
||||
184,
|
||||
/**/
|
||||
183,
|
||||
/**/
|
||||
182,
|
||||
/**/
|
||||
181,
|
||||
/**/
|
||||
180,
|
||||
/**/
|
||||
179,
|
||||
/**/
|
||||
178,
|
||||
/**/
|
||||
177,
|
||||
/**/
|
||||
176,
|
||||
/**/
|
||||
175,
|
||||
/**/
|
||||
174,
|
||||
/**/
|
||||
173,
|
||||
/**/
|
||||
172,
|
||||
/**/
|
||||
|
||||
@@ -576,6 +576,7 @@ extern char *(*dyn_libintl_ngettext)(const char *msgid, const char *msgid_plural
|
||||
extern char *(*dyn_libintl_bindtextdomain)(const char *domainname, const char *dirname);
|
||||
extern char *(*dyn_libintl_bind_textdomain_codeset)(const char *domainname, const char *codeset);
|
||||
extern char *(*dyn_libintl_textdomain)(const char *domainname);
|
||||
extern int (*dyn_libintl_putenv)(const char *envstring);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -594,6 +595,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
|
||||
# define HAVE_BIND_TEXTDOMAIN_CODESET 1
|
||||
# endif
|
||||
# define textdomain(domain) (*dyn_libintl_textdomain)(domain)
|
||||
# define libintl_putenv(envstring) (*dyn_libintl_putenv)(envstring)
|
||||
# else
|
||||
# include <libintl.h>
|
||||
# define _(x) gettext((char *)(x))
|
||||
@@ -2109,6 +2111,14 @@ typedef enum
|
||||
ASSERT_OTHER
|
||||
} assert_type_T;
|
||||
|
||||
/* Mode for bracketed_paste(). */
|
||||
typedef enum {
|
||||
PASTE_INSERT, /* insert mode */
|
||||
PASTE_CMDLINE, /* command line */
|
||||
PASTE_EX, /* ex mode line */
|
||||
PASTE_ONE_CHAR /* return first character */
|
||||
} paste_mode_T;
|
||||
|
||||
#include "ex_cmds.h" /* Ex command defines */
|
||||
#include "spell.h" /* spell checking stuff */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user