summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvimboss <devnull@localhost>2006-01-19 22:16:24 +0000
committervimboss <devnull@localhost>2006-01-19 22:16:24 +0000
commit4d4484d4eba32f1431a3f848ea1484c68a35c1cc (patch)
tree47f3570cfefb2433a4dda01a32fb11316cf9f5bc
parente858ce8a74eaa6a54debe3836b4638852d2e0607 (diff)
downloadvim-4d4484d4eba32f1431a3f848ea1484c68a35c1cc.tar.gz
updated for version 7.0182v7.0182v7-0182
-rw-r--r--runtime/doc/options.txt10
-rw-r--r--runtime/doc/starting.txt7
-rw-r--r--runtime/doc/syntax.txt9
-rw-r--r--runtime/doc/tags1
-rw-r--r--runtime/doc/todo.txt19
-rw-r--r--runtime/doc/version7.txt14
-rw-r--r--runtime/doc/windows.txt16
-rw-r--r--runtime/syntax/java.vim87
-rw-r--r--runtime/syntax/m4.vim10
-rw-r--r--src/edit.c7
-rw-r--r--src/ex_cmds.c12
-rw-r--r--src/ex_getln.c71
-rw-r--r--src/globals.h2
-rw-r--r--src/gui_gtk_x11.c1
-rw-r--r--src/structs.h4
-rw-r--r--src/undo.c72
-rw-r--r--src/version.h4
17 files changed, 201 insertions, 145 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index c6535366..16c36db2 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 7.0aa. Last change: 2006 Jan 04
+*options.txt* For Vim version 7.0aa. Last change: 2006 Jan 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1982,11 +1982,11 @@ A jump table for the options with a short description can be found at |Q_op|.
C-indenting.
*cpo--*
- When included, a vertical movement command fails when
- it would above the first line or below the last line.
- Without it the cursor moves to the first or last line,
- unless it already was in that line.
+ it would go above the first line or below the last
+ line. Without it the cursor moves to the first or
+ last line, unless it already was in that line.
Applies to the commands "-", "k", CTRL-P, "+", "j",
- CTRL-N and CTRL-J.
+ CTRL-N, CTRL-J and ":1234".
*cpo-+*
+ When included, a ":write file" command will reset the
'modified' flag of the buffer, even though the buffer
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index 55ca0735..1579e214 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -1,4 +1,4 @@
-*starting.txt* For Vim version 7.0aa. Last change: 2005 Dec 04
+*starting.txt* For Vim version 7.0aa. Last change: 2006 Jan 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -799,8 +799,9 @@ accordingly. Vim proceeds in this order:
- The |--noplugin| command line argument is used.
- The "-u NONE" command line argument is used |-u|.
- When Vim was compiled without the |+eval| feature.
- Note that using "-c set noloadplugins" doesn't work, because the
- commands from the command line have not been executed yet.
+ Note that using "-c 'set noloadplugins'" doesn't work, because the
+ commands from the command line have not been executed yet. You can
+ use "--cmd 'set noloadplugins'" |--cmd|.
5. Set 'shellpipe' and 'shellredir'
The 'shellpipe' and 'shellredir' options are set according to the
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 2ded3f2e..4b27b68f 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1,4 +1,4 @@
-*syntax.txt* For Vim version 7.0aa. Last change: 2005 Dec 31
+*syntax.txt* For Vim version 7.0aa. Last change: 2006 Jan 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1884,6 +1884,13 @@ If you want to fold blocks in if statements, etc. as well set the following: >
:let perl_fold_blocks = 1
+To avoid folding packages or subs when perl_fold is let, let the appropriate
+variable(s): >
+
+ :unlet perl_nofold_packages
+ :unlet perl_nofold_subs
+
+
PHP3 and PHP4 *php.vim* *php3.vim* *ft-php-syntax* *ft-php3-syntax*
diff --git a/runtime/doc/tags b/runtime/doc/tags
index b585a8b4..2174f20c 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -5349,7 +5349,6 @@ hebrew hebrew.txt /*hebrew*
hebrew.txt hebrew.txt /*hebrew.txt*
help various.txt /*help*
help-context help.txt /*help-context*
-help-tags tags 1
help-translated various.txt /*help-translated*
help-xterm-window various.txt /*help-xterm-window*
help.txt help.txt /*help.txt*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 5de02e68..da95e607 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt* For Vim version 7.0aa. Last change: 2006 Jan 14
+*todo.txt* For Vim version 7.0aa. Last change: 2006 Jan 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -30,12 +30,6 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
*known-bugs*
-------------------- Known bugs and current work -----------------------
-When the file "" exists, then ":!ls aap<Tab>" should put backslashes before
-'&', ';', '<' and '>'.
-
-Evaluating CTRL-R = in the sandbox causes trouble (G. Sumner Hayes). Can the
-rules for the commandline window be used?
-
Evaluate 'balloonexpr' in the sandbox only when it was set from an unsafe
place (e.g., modeline)? Patch from Sumner Hayes, Jan 12. Also use for other
options?
@@ -43,6 +37,13 @@ options?
":saveas asdf.c" should set 'filetype' to c when it's empty. Also for ":w
asdf.c" when it sets the buffer filename.
+When ":cclose" is used the buffer is not wiped out and is no longer recognized
+as a quickfix buffer, thus it's not reused either.
+
+Patch to support lists and dicts for the Python interface. (G. Sumner Hayes,
+Jan 12). Docs in a previous patch.
+Use free_tv() instead of clear_tv() and vim_free().
+
ccomplete:
- When using page-up/page-down in menu it sometimes jumps more than a page.
- When an option is set: In completion mode and the user types (identifier)
@@ -125,10 +126,6 @@ global_event_filter() for GTK.
Is it easy to have an item in a pattern that matches with a mark location?
Similar to |/\%>l| and |/\%c|. (Benji Fisher)
-Patch to support lists and dicts for the Python interface. (G. Sumner Hayes,
-Jan 12). Docs in a previous patch.
-Use free_tv() instead of clear_tv() and vim_free().
-
Win32 installer: Default _vimrc contains absolute path to diff.exe. After
upgrading it becomes invalid. Fix it automatically somehow? Use $VIMRUNTIME
in the path instead of filling it the path? At least give a clear error
diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt
index 00830d98..5743a797 100644
--- a/runtime/doc/version7.txt
+++ b/runtime/doc/version7.txt
@@ -1,4 +1,4 @@
-*version7.txt* For Vim version 7.0aa. Last change: 2006 Jan 14
+*version7.txt* For Vim version 7.0aa. Last change: 2006 Jan 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1527,8 +1527,9 @@ When 'esckeys' is not set don't send the xterm code to request the version
string, because it may cause trouble in Insert mode.
When evaluating an expression for CTRL-R = on the command line it was possible
-to open a new window, resulting in errors for incremental search, and many
-other nasty things were possible. Now evaluate the expression in the sandbox
+to call a function that opens a new window, resulting in errors for
+incremental search, and many other nasty things were possible. Now set
+"cmdline_busy" and disallow changing the buffer or jumpting to another window
to protect from unexpected behavior. Same for CTRL-\ e.
"d(" deleted the character under the cursor, while the documentation specified
@@ -1566,4 +1567,11 @@ Added mf_set_dirty().
Expanding wildcards in a command like ":e aap;<>!" didn't work. Put
backslashes before characters that are special to the shell. (Adri Verhoef)
+A CursorHold autocommand would cause a message to be cleared. Don't show the
+special key for the event for 'showcmd'.
+
+When expanding a file name for a shell command, as in "!cmd foo<Tab>" or ":r
+!cmd foo<Tab>" also escape characters that are special for the shell:
+"!;&()<>".
+
vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt
index 8fd96661..6912808c 100644
--- a/runtime/doc/windows.txt
+++ b/runtime/doc/windows.txt
@@ -1,4 +1,4 @@
-*windows.txt* For Vim version 7.0aa. Last change: 2005 Apr 01
+*windows.txt* For Vim version 7.0aa. Last change: 2006 Jan 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1100,18 +1100,18 @@ help Contains a help file. Will only be created with the |:help|
directory Displays directory contents. Can be used by a file explorer
plugin. The buffer is created with these settings: >
- :set buftype=nowrite
- :set bufhidden=delete
- :set noswapfile
+ :setlocal buftype=nowrite
+ :setlocal bufhidden=delete
+ :setlocal noswapfile
< The buffer name is the name of the directory and is adjusted
when using the |:cd| command.
scratch Contains text that can be discarded at any time. It is kept
when closing the window, it must be deleted explicitly.
Settings: >
- :set buftype=nofile
- :set bufhidden=hide
- :set noswapfile
+ :setlocal buftype=nofile
+ :setlocal bufhidden=hide
+ :setlocal noswapfile
< The buffer name can be used to identify the buffer.
*unlisted-buffer*
@@ -1119,7 +1119,7 @@ unlisted The buffer is not in the buffer list. It is not used for
normal editing, but to show a help file, remember a file name
or marks. The ":bdelete" command will also set this option,
thus it doesn't completely delete the buffer. Settings: >
- :set nobuflisted
+ :setlocal nobuflisted
<
vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim
index c6363d9d..0c250c64 100644
--- a/runtime/syntax/java.vim
+++ b/runtime/syntax/java.vim
@@ -2,7 +2,7 @@
" Language: Java
" Maintainer: Claudio Fleiner <claudio@fleiner.com>
" URL: http://www.fleiner.com/vim/syntax/java.vim
-" Last Change: 2005 Nov 04
+" Last Change: 2006 Jan 15
" Please check :help java.vim for comments on some of the options available.
@@ -65,48 +65,42 @@ syn match javaUserLabelRef "\k\+" contained
syn match javaVarArg "\.\.\."
syn keyword javaScopeDecl public protected private abstract
-if exists("java_highlight_java_lang_ids") || exists("java_highlight_java_lang") || exists("java_highlight_all")
+if exists("java_highlight_java_lang_ids")
+ let java_highlight_all=1
+endif
+if exists("java_highlight_all") || exists("java_highlight_java") || exists("java_highlight_java_lang")
" java.lang.*
syn match javaLangClass "\<System\>"
- syn keyword javaLangClass Cloneable Comparable Runnable Boolean Byte Class
- syn keyword javaLangClass Character CharSequence ClassLoader Compiler Double Float
- syn keyword javaLangClass Integer InheritableThreadLocal Long Math Number Object Package Process
- syn keyword javaLangClass Runtime RuntimePermission InheritableThreadLocal
- syn keyword javaLangClass SecurityManager Short String StrictMath StackTraceElement
- syn keyword javaLangClass StringBuffer Thread ThreadGroup
- syn keyword javaLangClass ThreadLocal Throwable Void ArithmeticException
- syn keyword javaLangClass ArrayIndexOutOfBoundsException AssertionError
- syn keyword javaLangClass ArrayStoreException ClassCastException
- syn keyword javaLangClass ClassNotFoundException
- syn keyword javaLangClass CloneNotSupportedException Exception
- syn keyword javaLangClass IllegalAccessException
- syn keyword javaLangClass IllegalArgumentException
- syn keyword javaLangClass IllegalMonitorStateException
- syn keyword javaLangClass IllegalStateException
- syn keyword javaLangClass IllegalThreadStateException
- syn keyword javaLangClass IndexOutOfBoundsException
- syn keyword javaLangClass InstantiationException InterruptedException
- syn keyword javaLangClass NegativeArraySizeException NoSuchFieldException
- syn keyword javaLangClass NoSuchMethodException NullPointerException
- syn keyword javaLangClass NumberFormatException RuntimeException
- syn keyword javaLangClass SecurityException StringIndexOutOfBoundsException
- syn keyword javaLangClass UnsupportedOperationException
- syn keyword javaLangClass AbstractMethodError ClassCircularityError
- syn keyword javaLangClass ClassFormatError Error ExceptionInInitializerError
- syn keyword javaLangClass IllegalAccessError InstantiationError
- syn keyword javaLangClass IncompatibleClassChangeError InternalError
- syn keyword javaLangClass LinkageError NoClassDefFoundError
- syn keyword javaLangClass NoSuchFieldError NoSuchMethodError
- syn keyword javaLangClass OutOfMemoryError StackOverflowError
- syn keyword javaLangClass ThreadDeath UnknownError UnsatisfiedLinkError
- syn keyword javaLangClass UnsupportedClassVersionError VerifyError
- syn keyword javaLangClass VirtualMachineError
+ syn keyword javaR_JavaLang NegativeArraySizeException ArrayStoreException IllegalStateException RuntimeException IndexOutOfBoundsException UnsupportedOperationException ArrayIndexOutOfBoundsException ArithmeticException ClassCastException EnumConstantNotPresentException StringIndexOutOfBoundsException IllegalArgumentException IllegalMonitorStateException IllegalThreadStateException NumberFormatException NullPointerException TypeNotPresentException SecurityException
+ syn cluster javaTop add=javaR_JavaLang
+ syn cluster javaClasses add=javaR_JavaLang
+ JavaHiLink javaR_JavaLang javaR_Java
+ syn keyword javaC_JavaLang Process RuntimePermission StringKeySet CharacterData01 Class ThreadLocal ThreadLocalMap CharacterData0E Package Character StringCoding Long ProcessImpl ProcessEnvironment Short AssertionStatusDirectives 1PackageInfoProxy UnicodeBlock InheritableThreadLocal AbstractStringBuilder StringEnvironment ClassLoader ConditionalSpecialCasing CharacterDataPrivateUse StringBuffer StringDecoder Entry StringEntry WrappedHook StringBuilder StrictMath State ThreadGroup Runtime CharacterData02 MethodArray Object CharacterDataUndefined Integer Gate Boolean Enum Variable Subset StringEncoder Void Terminator CharsetSD IntegerCache CharacterCache Byte CharsetSE Thread SystemClassLoaderAction CharacterDataLatin1 StringValues StackTraceElement Shutdown ShortCache String ConverterSD ByteCache Lock EnclosingMethodInfo Math Float Value Double SecurityManager LongCache ProcessBuilder StringEntrySet Compiler Number UNIXProcess ConverterSE ExternalData CaseInsensitiveComparator CharacterData00 NativeLibrary
+ syn cluster javaTop add=javaC_JavaLang
+ syn cluster javaClasses add=javaC_JavaLang
+ JavaHiLink javaC_JavaLang javaC_Java
+ syn keyword javaE_JavaLang IncompatibleClassChangeError InternalError UnknownError ClassCircularityError AssertionError ThreadDeath IllegalAccessError NoClassDefFoundError ClassFormatError UnsupportedClassVersionError NoSuchFieldError VerifyError ExceptionInInitializerError InstantiationError LinkageError NoSuchMethodError Error UnsatisfiedLinkError StackOverflowError AbstractMethodError VirtualMachineError OutOfMemoryError
+ syn cluster javaTop add=javaE_JavaLang
+ syn cluster javaClasses add=javaE_JavaLang
+ JavaHiLink javaE_JavaLang javaE_Java
+ syn keyword javaX_JavaLang CloneNotSupportedException Exception NoSuchMethodException IllegalAccessException NoSuchFieldException Throwable InterruptedException ClassNotFoundException InstantiationException
+ syn cluster javaTop add=javaX_JavaLang
+ syn cluster javaClasses add=javaX_JavaLang
+ JavaHiLink javaX_JavaLang javaX_Java
+
+ JavaHiLink javaR_Java javaR_
+ JavaHiLink javaC_Java javaC_
+ JavaHiLink javaE_Java javaE_
+ JavaHiLink javaX_Java javaX_
+ JavaHiLink javaX_ javaExceptions
+ JavaHiLink javaR_ javaExceptions
+ JavaHiLink javaE_ javaExceptions
+ JavaHiLink javaC_ javaConstant
+
syn keyword javaLangObject clone equals finalize getClass hashCode
syn keyword javaLangObject notify notifyAll toString wait
- JavaHiLink javaLangClass javaConstant
JavaHiLink javaLangObject javaConstant
- syn cluster javaTop add=javaLangObject,javaLangClass
- syn cluster javaClasses add=javaLangClass
+ syn cluster javaTop add=javaLangObject
endif
if filereadable(expand("<sfile>:p:h")."/javaid.vim")
@@ -162,13 +156,15 @@ if !exists("java_ignore_javadoc") && main_syntax != 'jsp'
" syntax coloring for javadoc comments (HTML)
syntax include @javaHtml <sfile>:p:h/html.vim
unlet b:current_syntax
- syn region javaDocComment start="/\*\*" end="\*/" keepend contains=javaCommentTitle,@javaHtml,javaDocTags,javaTodo,@Spell
- syn region javaCommentTitle contained matchgroup=javaDocComment start="/\*\*" matchgroup=javaCommentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@javaHtml,javaCommentStar,javaTodo,@Spell,javaDocTags
-
- syn region javaDocTags contained start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}"
- syn match javaDocTags contained "@\(see\|param\|exception\|throws\|since\)\s\+\S\+" contains=javaDocParam
- syn match javaDocParam contained "\s\S\+"
- syn match javaDocTags contained "@\(version\|author\|return\|deprecated\|serial\|serialField\|serialData\)\>"
+ syn region javaDocComment start="/\*\*" end="\*/" keepend contains=javaCommentTitle,@javaHtml,javaDocTags,javaDocSeeTag,javaTodo,@Spell
+ syn region javaCommentTitle contained matchgroup=javaDocComment start="/\*\*" matchgroup=javaCommentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@javaHtml,javaCommentStar,javaTodo,@Spell,javaDocTags,javaDocSeeTag
+
+ syn region javaDocTags contained start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}"
+ syn match javaDocTags contained "@\(param\|exception\|throws\|since\)\s\+\S\+" contains=javaDocParam
+ syn match javaDocParam contained "\s\S\+"
+ syn match javaDocTags contained "@\(version\|author\|return\|deprecated\|serial\|serialField\|serialData\)\>"
+ syn region javaDocSeeTag contained matchgroup=javaDocTags start="@see\s\+" matchgroup=NONE end="\_."re=e-1 contains=javaDocSeeTagParam
+ syn match javaDocSeeTagParam contained @"\_[^"]\+"\|<a\s\+\_.\{-}</a>\|\(\k\|\.\)*\(#\k\+\((\_[^)]\+)\)\=\)\=@ extend
syntax case match
endif
@@ -323,6 +319,7 @@ if version >= 508 || !exists("did_java_syn_inits")
JavaHiLink javaCommentTitle SpecialComment
JavaHiLink javaDocTags Special
JavaHiLink javaDocParam Function
+ JavaHiLink javaDocSeeTagParam Function
JavaHiLink javaCommentStar javaComment
JavaHiLink javaType Type
diff --git a/runtime/syntax/m4.vim b/runtime/syntax/m4.vim
index ef60a8ff..ba7a294d 100644
--- a/runtime/syntax/m4.vim
+++ b/runtime/syntax/m4.vim
@@ -1,8 +1,8 @@
" Vim syntax file
" Language: M4
-" Maintainer: Claudio Fleiner
+" Maintainer: Claudio Fleiner (claudio@fleiner.com)
" URL: http://www.fleiner.com/vim/syntax/m4.vim
-" Last Change: 2001 Apr 26
+" Last Change: 2005 Jan 15
" This file will highlight user function calls if they use only
" capital letters and have at least one argument (i.e. the '('
@@ -23,9 +23,9 @@ endif
" define the m4 syntax
syn match m4Variable contained "\$\d\+"
syn match m4Special contained "$[@*#]"
-syn match m4Comment "dnl\>.*" contains=SpellErrors
-syn match m4Constants "\(\<m4_\)\=__file__"
-syn match m4Constants "\(\<m4_\)\=__line__"
+syn match m4Comment "\<\(m4_\)\=dnl\>.*" contains=SpellErrors
+syn match m4Constants "\<\(m4_\)\=__file__"
+syn match m4Constants "\<\(m4_\)\=__line__"
syn keyword m4Constants divnum sysval m4_divnum m4_sysval
syn region m4Paren matchgroup=m4Delimiter start="(" end=")" contained contains=@m4Top
syn region m4Command matchgroup=m4Function start="\<\(m4_\)\=\(define\|defn\|pushdef\)(" end=")" contains=@m4Top
diff --git a/src/edit.c b/src/edit.c
index 298ebc3c..ab3558a9 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -289,6 +289,13 @@ edit(cmdchar, startln, count)
return FALSE;
}
#endif
+ /* Don't allow changes in the buffer while editing the cmdline. The
+ * caller of getcmdline() may get confused. */
+ if (cmdline_busy)
+ {
+ EMSG(_(e_secure));
+ return FALSE;
+ }
#ifdef FEAT_INS_EXPAND
ins_compl_clear(); /* clear stuff for CTRL-X mode */
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index c4fd0c4b..e192d100 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -2841,11 +2841,11 @@ check_readonly(forceit, buf)
}
/*
- * try to abandon current file and edit a new or existing file
- * 'fnum' is the number of the file, if zero use ffname/sfname
+ * Try to abandon current file and edit a new or existing file.
+ * 'fnum' is the number of the file, if zero use ffname/sfname.
*
- * return 1 for "normal" error, 2 for "not written" error, 0 for success
- * -1 for succesfully opening another file
+ * Return 1 for "normal" error, 2 for "not written" error, 0 for success
+ * -1 for succesfully opening another file.
* 'lnum' is the line number for the cursor in the new file (if non-zero).
*/
int
@@ -2861,10 +2861,8 @@ getfile(fnum, ffname, sfname, setpm, lnum, forceit)
int retval;
char_u *free_me = NULL;
-#ifdef FEAT_CMDWIN
- if (cmdwin_type != 0)
+ if (editing_cmdline())
return 1;
-#endif
if (fnum == 0)
{
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 95109534..b1142c47 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -258,6 +258,9 @@ getcmdline(firstc, count, indent)
}
xpc.xp_context = EXPAND_NOTHING;
xpc.xp_backslash = XP_BS_NONE;
+#ifndef BACKSLASH_IN_FILENAME
+ xpc.xp_shell = FALSE;
+#endif
#if defined(FEAT_EVAL)
if (ccline.input_fn)
@@ -658,17 +661,13 @@ getcmdline(firstc, count, indent)
restore_cmdline(&save_ccline);
if (c == '=')
{
- /* Need to save and restore ccline. And go into the
- * sandbox to avoid nasty things like going to another
- * buffer when evaluating an expression. */
+ /* Need to save and restore ccline. And set cmdline_busy
+ * to avoid nasty things like going to another buffer when
+ * evaluating an expression. */
save_cmdline(&save_ccline);
-#ifdef HAVE_SANDBOX
- ++sandbox;
-#endif
+ ++cmdline_busy;
p = get_expr_line();
-#ifdef HAVE_SANDBOX
- --sandbox;
-#endif
+ --cmdline_busy;
restore_cmdline(&save_ccline);
if (p != NULL && realloc_cmdbuff((int)STRLEN(p) + 1) == OK)
@@ -1875,6 +1874,35 @@ getcmdline_prompt(firstc, prompt, attr, xp_context, xp_arg)
}
#endif
+/*
+ * Return TRUE when the command line is being edited. That means the current
+ * buffer and window can't be changed.
+ */
+ int
+editing_cmdline()
+{
+#ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0)
+ return TRUE;
+#endif
+ return cmdline_busy;
+}
+
+/*
+ * Give an error message for a command that isn't allowed while the cmdline
+ * window is open or editing the cmdline in another way.
+ */
+ void
+editing_cmdline_msg()
+{
+#ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0)
+ EMSG(_(e_cmdwin));
+ else
+#endif
+ EMSG(_(e_secure));
+}
+
static int
cmdline_charsize(idx)
int idx;
@@ -2786,17 +2814,12 @@ cmdline_paste(regname, literally)
regname = may_get_selection(regname);
#endif
- /* Need to save and restore ccline. And go into the sandbox to avoid
- * nasty things like going to another buffer when evaluating an
- * expression. */
+ /* Need to save and restore ccline. And set cmdline_busy to avoid nasty
+ * things like going to another buffer when evaluating an expression. */
save_cmdline(&save_ccline);
-#ifdef HAVE_SANDBOX
- ++sandbox;
-#endif
+ ++cmdline_busy;
i = get_spec_reg(regname, &arg, &allocated, TRUE);
-#ifdef HAVE_SANDBOX
- --sandbox;
-#endif
+ --cmdline_busy;
restore_cmdline(&save_ccline);
if (i)
@@ -3368,8 +3391,14 @@ ExpandInit(xp)
expand_T *xp;
{
xp->xp_backslash = XP_BS_NONE;
+#ifndef BACKSLASH_IN_FILENAME
+ xp->xp_shell = FALSE;
+#endif
xp->xp_numfiles = -1;
xp->xp_files = NULL;
+#if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
+ xp->xp_arg = NULL;
+#endif
}
/*
@@ -3446,7 +3475,8 @@ ExpandEscape(xp, str, numfiles, files, options)
p = vim_strsave_escaped(files[i], buf);
}
#else
- p = vim_strsave_escaped(files[i], PATH_ESC_CHARS);
+ p = vim_strsave_escaped(files[i],
+ xp->xp_shell ? SHELL_ESC_CHARS : PATH_ESC_CHARS);
#endif
if (p != NULL)
{
@@ -4527,8 +4557,9 @@ globpath(path, file)
if (buf == NULL)
return NULL;
+ ExpandInit(&xpc);
xpc.xp_context = EXPAND_FILES;
- xpc.xp_backslash = XP_BS_NONE;
+
ga_init2(&ga, 1, 100);
/* Loop over all entries in {path}. */
diff --git a/src/globals.h b/src/globals.h
index c22466c0..9c81e4ef 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -86,6 +86,8 @@ EXTERN int clear_cmdline INIT(= FALSE); /* cmdline must be cleared */
#if defined(FEAT_CRYPT) || defined(FEAT_EVAL)
EXTERN int cmdline_star INIT(= FALSE); /* cmdline is crypted */
#endif
+EXTERN int cmdline_busy INIT(= FALSE); /* editing the cmdline */
+
EXTERN int exec_from_reg INIT(= FALSE); /* executing register */
EXTERN int screen_cleared INIT(= FALSE); /* screen has been cleared */
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 84c5fe40..1502e0c1 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -2328,7 +2328,6 @@ sm_client_die(GnomeClient *client, gpointer data)
vim_strncpy(IObuff,
_("Vim: Received \"die\" request from session manager\n"),
IOSIZE - 1);
- deadly_exit = TRUE;
preserve_exit();
}
diff --git a/src/structs.h b/src/structs.h
index 5420b4e4..b71f592b 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -401,6 +401,10 @@ typedef struct expand
int xp_scriptID; /* SID for completion function */
#endif
int xp_backslash; /* one of the XP_BS_ values */
+#ifndef BACKSLASH_IN_FILENAME
+ int xp_shell; /* for a shell command more characters
+ need to be escaped */
+#endif
int xp_numfiles; /* number of files found by
file name completion */
char_u **xp_files; /* list of files */
diff --git a/src/undo.c b/src/undo.c
index 34e1f400..1b69cf11 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -52,6 +52,7 @@
static u_entry_T *u_get_headentry __ARGS((void));
static void u_getbot __ARGS((void));
+static int undo_allowed __ARGS((void));
static int u_savecommon __ARGS((linenr_T, linenr_T, linenr_T));
static void u_doit __ARGS((int count));
static void u_undoredo __ARGS((void));
@@ -156,40 +157,57 @@ u_savedel(lnum, nlines)
nlines == curbuf->b_ml.ml_line_count ? 2 : lnum));
}
+/*
+ * Return TRUE when undo is allowed. Otherwise give an error message and
+ * return FALSE.
+ */
static int
-u_savecommon(top, bot, newbot)
- linenr_T top, bot;
- linenr_T newbot;
+undo_allowed()
{
- linenr_T lnum;
- long i;
- struct u_header *uhp;
- u_entry_T *uep;
- u_entry_T *prev_uep;
- long size;
-
- /*
- * Don't allow changes when 'modifiable' is off. Letting the
- * undo fail is a crude way to make all change commands fail.
- */
+ /* Don't allow changes when 'modifiable' is off. */
if (!curbuf->b_p_ma)
{
EMSG(_(e_modifiable));
- return FAIL;
+ return FALSE;
}
#ifdef HAVE_SANDBOX
- /*
- * In the sandbox it's not allowed to change the text. Letting the
- * undo fail is a crude way to make all change commands fail.
- */
+ /* In the sandbox it's not allowed to change the text. */
if (sandbox != 0)
{
EMSG(_(e_sandbox));
- return FAIL;
+ return FALSE;
}
#endif
+ /* Don't allow changes in the buffer while editing the cmdline. The
+ * caller of getcmdline() may get confused. */
+ if (cmdline_busy)
+ {
+ EMSG(_(e_secure));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+ static int
+u_savecommon(top, bot, newbot)
+ linenr_T top, bot;
+ linenr_T newbot;
+{
+ linenr_T lnum;
+ long i;
+ struct u_header *uhp;
+ u_entry_T *uep;
+ u_entry_T *prev_uep;
+ long size;
+
+ /* When making changes is not allowed return FAIL. It's a crude way to
+ * make all change commands fail. */
+ if (!undo_allowed())
+ return FAIL;
+
#ifdef FEAT_NETBEANS_INTG
/*
* Netbeans defines areas that cannot be modified. Bail out here when
@@ -484,20 +502,8 @@ u_redo(count)
u_doit(count)
int count;
{
- /* Don't allow changes when 'modifiable' is off. */
- if (!curbuf->b_p_ma)
- {
- EMSG(_(e_modifiable));
- return;
- }
-#ifdef HAVE_SANDBOX
- /* In the sandbox it's not allowed to change the text. */
- if (sandbox != 0)
- {
- EMSG(_(e_sandbox));
+ if (!undo_allowed())
return;
- }
-#endif
u_newcount = 0;
u_oldcount = 0;
diff --git a/src/version.h b/src/version.h
index 3cb3dd98..0251f806 100644
--- a/src/version.h
+++ b/src/version.h
@@ -36,5 +36,5 @@
#define VIM_VERSION_NODOT "vim70aa"
#define VIM_VERSION_SHORT "7.0aa"
#define VIM_VERSION_MEDIUM "7.0aa ALPHA"
-#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Jan 14)"
-#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Jan 14, compiled "
+#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Jan 19)"
+#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Jan 19, compiled "