Compare commits

...

22 Commits

Author SHA1 Message Date
Bram Moolenaar
f1eeae94fd updated for version 7.2.433
Problem:    Can't use cscope with QuickFixCmdPre and QuickFixCmdPost.
Solution:   Add cscope support for these autocmd events. (Bryan Venteicher)
2010-05-14 23:14:42 +02:00
Bram Moolenaar
70b11cdd56 updated for version 7.2.432
Problem:    When menus are translated they can only be found by the translated
            name.  That makes ":emenu" difficult to use.
Solution:   Store the untranslated name and use it for completion and :emenu.
            (Edward L. Fox / Liang Peng / Bezetek James)
2010-05-14 22:24:40 +02:00
Bram Moolenaar
7871a50071 updated for version 7.2.431
Problem:    ":amenu" moves the cursor when in Insert mode.
Solution:   Use CTRL-\ CTRL-O instead of CTRL-O. (Christian Brabandt)
2010-05-14 21:19:23 +02:00
Bram Moolenaar
9c0044df7c updated for version 7.2.430
Problem:    The ++bad argument is handled wrong, resulting in an invalid
            memory access.
Solution:   Use the bad_char field only for the replacement character, add
            bad_char_idx to store the position. (Dominique Pelle)
2010-05-14 20:41:05 +02:00
Bram Moolenaar
2efbc66e26 updated for version 7.2.429
Problem:    A file that exists but access is denied may result in a "new file"
            message.  E.g. when its directory is unreadable.
Solution:   Specifically check for ENOENT to decide a file doesn't exist.
            (partly by James Vega)
2010-05-14 18:56:38 +02:00
Bram Moolenaar
f9ddb94283 updated for version 7.2.428
Problem:    Using setqflist([]) to clear the error list doesn't work properly.
Solution:   Set qf_nonevalid to TRUE when appropriate. (Christian Brabandt)
2010-05-14 18:10:27 +02:00
Bram Moolenaar
9dbe4758b1 updated for version 7.2.427
Problem:    The swapfile is created using the destination of a symlink, but
            recovery doesn't follow symlinks.
Solution:   When recovering, resolve symlinks. (James Vega)
2010-05-14 17:52:42 +02:00
Bram Moolenaar
6af0506370 updated for version 7.2.426
Problem:    Commas in 'langmap' are not always handled correctly.
Solution:   Require commas to be backslash escaped. (James Vega)
2010-05-14 17:32:58 +02:00
Bram Moolenaar
2321c9255e updated for version 7.2.425
Problem:    Some compilers complain about fourth EX() argument.
Solution:   Add cast to long_u.
2010-05-14 15:42:53 +02:00
Bram Moolenaar
e685079848 updated for version 7.2.424
Problem:    ":colorscheme" without an argument doesn't do anything.
Solution:   Make it echo the current color scheme name.  (partly by Christian
            Brabandt)
2010-05-14 15:28:44 +02:00
Bram Moolenaar
9577c3e973 updated for version 7.2.423
Problem:    Crash when assigning s: to variable. (Yukihiro Nakadaira)
Solution:   Make ga_scripts contain pointer to scriptvar_T instead of
            scriptvar_T itself. (Dominique Pelle)
2010-05-14 12:16:25 +02:00
Bram Moolenaar
54ab0f1e54 updated for version 7.2.422
Problem:    May get E763 when using spell dictionaries.
Solution:   Avoid utf-8 case folded character to be truncated to 8 bits and
            differ from latin1. (Dominique Pelle)
2010-05-13 17:46:58 +02:00
Bram Moolenaar
38ab0e21b8 updated for version 7.2.421
Problem:    Folds are sometimes not updated properly and there is no way to
            force an update.
Solution:   Make "zx" and "zX" recompute folds (suggested by Christian
            Brabandt)
2010-05-13 17:35:59 +02:00
Bram Moolenaar
eb4883fabc updated for version 7.2.420
Problem:    ":argedit" does not accept "++enc=utf8" as documented. (Dominique
            Pelle)
Solution:   Add the ARGOPT flag to ":argedit".
2010-05-13 16:46:21 +02:00
Bram Moolenaar
103e6efc84 updated for version 7.2.419
Problem:    Memory leak in Motif when clicking on "Search Vim Help".
Solution:   Free string returned by XmTextGetString(). (Dominique Pelle)
2010-05-13 16:31:25 +02:00
Bram Moolenaar
ccbab93b42 updated for version 7.2.418
Problem:    Vim tries to set the background or foreground color in a terminal
            to -1.  (Graywh)  Happens with ":hi Normal ctermbg=NONE".
Solution:   When resetting the foreground or background color don't set the
            color, let the clear screen code do that.
2010-05-13 15:40:30 +02:00
Bram Moolenaar
ae61bcf0ab updated for version 7.2.417
Problem:    When 'shell' has an argument with a slash then 'shellpipe' is not
            set properly. (Britton Kerin)
Solution:   Assume there are no spaces in the path, arguments follow.
2010-05-13 13:12:06 +02:00
Bram Moolenaar
0387e653c8 updated for version 7.2.416
Problem:    Logtalk.dict is not installed.
Solution:   Add it to the install target. (Markus Heidelberg)
2010-05-07 16:54:37 +02:00
Bram Moolenaar
ad249fb74c updated for version 7.2.415
Problem:    Win32: Can't open a remote file when starting Vim.
Solution:   Don't invoke cygwin_conv_path() for URLs. (Tomoya Adachi)
2010-05-07 16:35:04 +02:00
Bram Moolenaar
ceb45be4d3 updated for version 7.2.414
Problem:    CTRK-K <space> <space> does not produce 0xa0 as expected. (Tony
            Mechelynck)
Solution:   Remove the Unicode range 0xe000 - 0xefff from digraphs, these are
            not valid characters.
2010-05-07 16:18:14 +02:00
Bram Moolenaar
317fd3ae3b updated for version 7.2.413
Problem:    Large file support is incorrect.
Solution:   Add AC_SYS_LARGEFILE to configure. (James Vega)
2010-05-07 16:05:55 +02:00
Bram Moolenaar
5ea0ac77b3 updated for version 7.2.412
Problem:    [ or ] followed by mouse click doesn't work.
Solution:   Reverse check for key being a mouse event. (Dominique Pelle)
2010-05-07 15:52:08 +02:00
22 changed files with 831 additions and 248 deletions

View File

@@ -678,10 +678,10 @@ MenuPopup Just before showing the popup menu (under the
QuickFixCmdPre Before a quickfix command is run (|:make|,
|:lmake|, |:grep|, |:lgrep|, |:grepadd|,
|:lgrepadd|, |:vimgrep|, |:lvimgrep|,
|:vimgrepadd|, |:lvimgrepadd|). The pattern is
matched against the command being run. When
|:grep| is used but 'grepprg' is set to
"internal" it still matches "grep".
|:vimgrepadd|, |:lvimgrepadd|, |:cscope|).
The pattern is matched against the command
being run. When |:grep| is used but 'grepprg'
is set to "internal" it still matches "grep".
This command cannot be used to set the
'makeprg' and 'grepprg' variables.
If this command causes an error, the quickfix

View File

@@ -30,7 +30,7 @@
# want to disable using X11 libraries. This speeds up starting Vim,
# but the window title will not be set and the X11 selection can not
# used.
# - Uncomment the line "CONF_OPT_XSMP = --without-xsmp" if you have the
# - Uncomment the line "CONF_OPT_XSMP = --disable-xsmp" if you have the
# X11 Session Management Protocol (XSMP) library (libSM) but do not
# want to use it.
# This can speedup Vim startup but Vim loses the ability to catch the
@@ -1882,7 +1882,7 @@ installrtbase: $(HELPSOURCE)/vim.1 $(DEST_VIM) $(DEST_RT) \
cd $(PLUGSOURCE); $(INSTALL_DATA) *.vim README.txt $(DEST_PLUG)
cd $(DEST_PLUG); chmod $(HELPMOD) *.vim README.txt
# install the ftplugin files
cd $(FTPLUGSOURCE); $(INSTALL_DATA) *.vim README.txt $(DEST_FTP)
cd $(FTPLUGSOURCE); $(INSTALL_DATA) *.vim README.txt logtalk.dict $(DEST_FTP)
cd $(DEST_FTP); chmod $(HELPMOD) *.vim README.txt
# install the compiler files
cd $(COMPSOURCE); $(INSTALL_DATA) *.vim README.txt $(DEST_COMP)

359
src/auto/configure vendored
View File

@@ -821,6 +821,7 @@ with_gnome_libs
with_gnome
with_motif_lib
with_tlib
enable_largefile
enable_acl
enable_gpm
enable_sysmouse
@@ -1485,6 +1486,7 @@ Optional Features:
--enable-nextaw-check If auto-select GUI, check for neXtaw default=yes
--enable-carbon-check If auto-select GUI, check for Carbon default=yes
--disable-gtktest Do not try to compile and run a test GTK program
--disable-largefile omit support for large files
--disable-acl Don't check for ACL support.
--disable-gpm Don't use gpm (Linux mouse daemon).
--disable-sysmouse Don't use sysmouse (mouse in *BSD console).
@@ -14345,6 +14347,363 @@ _ACEOF
fi
# Check whether --enable-largefile was given.
if test "${enable_largefile+set}" = set; then
enableval=$enable_largefile;
fi
if test "$enable_largefile" != no; then
{ $as_echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
if test "${ac_cv_sys_largefile_CC+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_cv_sys_largefile_CC=no
if test "$GCC" != yes; then
ac_save_CC=$CC
while :; do
# IRIX 6.2 and later do not support large files by default,
# so use the C compiler's -n32 option if that helps.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly.
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
int
main ()
{
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
break
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext
CC="$CC -n32"
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_sys_largefile_CC=' -n32'; break
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext
break
done
CC=$ac_save_CC
rm -f conftest.$ac_ext
fi
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
$as_echo "$ac_cv_sys_largefile_CC" >&6; }
if test "$ac_cv_sys_largefile_CC" != no; then
CC=$CC$ac_cv_sys_largefile_CC
fi
{ $as_echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
if test "${ac_cv_sys_file_offset_bits+set}" = set; then
$as_echo_n "(cached) " >&6
else
while :; do
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly.
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
int
main ()
{
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_sys_file_offset_bits=no; break
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#define _FILE_OFFSET_BITS 64
#include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly.
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
int
main ()
{
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_sys_file_offset_bits=64; break
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_sys_file_offset_bits=unknown
break
done
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
case $ac_cv_sys_file_offset_bits in #(
no | unknown) ;;
*)
cat >>confdefs.h <<_ACEOF
#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
_ACEOF
;;
esac
rm -rf conftest*
if test $ac_cv_sys_file_offset_bits = unknown; then
{ $as_echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
if test "${ac_cv_sys_large_files+set}" = set; then
$as_echo_n "(cached) " >&6
else
while :; do
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly.
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
int
main ()
{
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_sys_large_files=no; break
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#define _LARGE_FILES 1
#include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly.
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
int
main ()
{
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_sys_large_files=1; break
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_sys_large_files=unknown
break
done
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
$as_echo "$ac_cv_sys_large_files" >&6; }
case $ac_cv_sys_large_files in #(
no | unknown) ;;
*)
cat >>confdefs.h <<_ACEOF
#define _LARGE_FILES $ac_cv_sys_large_files
_ACEOF
;;
esac
rm -rf conftest*
fi
fi
{ $as_echo "$as_me:$LINENO: checking for st_blksize" >&5
$as_echo_n "checking for st_blksize... " >&6; }
cat >conftest.$ac_ext <<_ACEOF

View File

@@ -196,6 +196,11 @@
#undef HAVE_UTIME
#undef HAVE_BIND_TEXTDOMAIN_CODESET
/* Define, if needed, for accessing large files. */
#undef _LARGE_FILES
#undef _FILE_OFFSET_BITS
#undef _LARGEFILE_SOURCE
/* Define if you do not have utime(), but do have the utimes() function. */
#undef HAVE_UTIMES

View File

@@ -2669,6 +2669,10 @@ AC_CHECK_FUNCS(bcmp fchdir fchown fsync getcwd getpseudotty \
usleep utime utimes)
AC_FUNC_FSEEKO
dnl define _LARGE_FILES, _FILE_OFFSET_BITS and _LARGEFILE_SOURCE when
dnl appropriate, so that off_t is 64 bits when needed.
AC_SYS_LARGEFILE
dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible
AC_MSG_CHECKING(for st_blksize)
AC_TRY_COMPILE(

View File

@@ -1933,45 +1933,8 @@ static digr_T digraphdefault[] =
{'7', 'c', 0x3226},
{'8', 'c', 0x3227},
{'9', 'c', 0x3228},
{' ', ' ', 0xe000},
{'/', 'c', 0xe001},
{'U', 'A', 0xe002},
{'U', 'B', 0xe003},
{'"', '3', 0xe004},
{'"', '1', 0xe005},
{'"', '!', 0xe006},
{'"', '\'', 0xe007},
{'"', '>', 0xe008},
{'"', '?', 0xe009},
{'"', '-', 0xe00a},
{'"', '(', 0xe00b},
{'"', '.', 0xe00c},
{'"', ':', 0xe00d},
{'"', '0', 0xe00e},
{'"', '"', 0xe00f},
{'"', '<', 0xe010},
{'"', ',', 0xe011},
{'"', ';', 0xe012},
{'"', '_', 0xe013},
{'"', '=', 0xe014},
{'"', '/', 0xe015},
{'"', 'i', 0xe016},
{'"', 'd', 0xe017},
{'"', 'p', 0xe018},
{';', ';', 0xe019},
{',', ',', 0xe01a},
{'b', '3', 0xe01b},
{'C', 'i', 0xe01c},
{'f', '(', 0xe01d},
{'e', 'd', 0xe01e},
{'a', 'm', 0xe01f},
{'p', 'm', 0xe020},
{'F', 'l', 0xe023},
{'G', 'F', 0xe024},
{'>', 'V', 0xe025},
{'!', '*', 0xe026},
{'?', '*', 0xe027},
{'J', '<', 0xe028},
/* code points 0xe000 - 0xefff excluded, they have no assigned
* characters, only used in proposals. */
{'f', 'f', 0xfb00},
{'f', 'i', 0xfb01},
{'f', 'l', 0xfb02},

View File

@@ -145,9 +145,9 @@ typedef struct
dict_T sv_dict;
} scriptvar_T;
static garray_T ga_scripts = {0, 0, sizeof(scriptvar_T), 4, NULL};
#define SCRIPT_SV(id) (((scriptvar_T *)ga_scripts.ga_data)[(id) - 1])
#define SCRIPT_VARS(id) (SCRIPT_SV(id).sv_dict.dv_hashtab)
static garray_T ga_scripts = {0, 0, sizeof(scriptvar_T *), 4, NULL};
#define SCRIPT_SV(id) (((scriptvar_T **)ga_scripts.ga_data)[(id) - 1])
#define SCRIPT_VARS(id) (SCRIPT_SV(id)->sv_dict.dv_hashtab)
static int echo_attr = 0; /* attributes used for ":echo" */
@@ -866,10 +866,6 @@ eval_clear()
hash_init(&vimvarht); /* garbage_collect() will access it */
hash_clear(&compat_hashtab);
/* script-local variables */
for (i = 1; i <= ga_scripts.ga_len; ++i)
vars_clear(&SCRIPT_VARS(i));
ga_clear(&ga_scripts);
free_scriptnames();
/* global variables */
@@ -878,6 +874,14 @@ eval_clear()
/* autoloaded script names */
ga_clear_strings(&ga_loaded);
/* script-local variables */
for (i = 1; i <= ga_scripts.ga_len; ++i)
{
vars_clear(&SCRIPT_VARS(i));
vim_free(SCRIPT_SV(i));
}
ga_clear(&ga_scripts);
/* unreferenced lists and dicts */
(void)garbage_collect();
@@ -18305,8 +18309,8 @@ set_cmdarg(eap, oldarg)
# ifdef FEAT_MBYTE
if (eap->force_enc != 0)
len += (unsigned)STRLEN(eap->cmd + eap->force_enc) + 7;
if (eap->bad_char != 0)
len += (unsigned)STRLEN(eap->cmd + eap->bad_char) + 7;
if (eap->bad_char_idx != 0)
len += (unsigned)STRLEN(eap->cmd + eap->bad_char_idx) + 7;
# endif
newval = alloc(len + 1);
@@ -18330,9 +18334,9 @@ set_cmdarg(eap, oldarg)
if (eap->force_enc != 0)
sprintf((char *)newval + STRLEN(newval), " ++enc=%s",
eap->cmd + eap->force_enc);
if (eap->bad_char != 0)
if (eap->bad_char_idx != 0)
sprintf((char *)newval + STRLEN(newval), " ++bad=%s",
eap->cmd + eap->bad_char);
eap->cmd + eap->bad_char_idx);
# endif
vimvars[VV_CMDARG].vv_str = newval;
return oldval;
@@ -18803,7 +18807,7 @@ find_var_in_ht(ht, varname, writing)
/* Must be something like "s:", otherwise "ht" would be NULL. */
switch (varname[-2])
{
case 's': return &SCRIPT_SV(current_SID).sv_var;
case 's': return &SCRIPT_SV(current_SID)->sv_var;
case 'g': return &globvars_var;
case 'v': return &vimvars_var;
case 'b': return &curbuf->b_bufvar;
@@ -18928,13 +18932,14 @@ new_script_vars(id)
ht = &SCRIPT_VARS(i);
if (ht->ht_mask == HT_INIT_SIZE - 1)
ht->ht_array = ht->ht_smallarray;
sv = &SCRIPT_SV(i);
sv = SCRIPT_SV(i);
sv->sv_var.di_tv.vval.v_dict = &sv->sv_dict;
}
while (ga_scripts.ga_len < id)
{
sv = &SCRIPT_SV(ga_scripts.ga_len + 1);
sv = SCRIPT_SV(ga_scripts.ga_len + 1) =
(scriptvar_T *)alloc_clear(sizeof(scriptvar_T));
init_var_dict(&sv->sv_dict, &sv->sv_var);
++ga_scripts.ga_len;
}
@@ -21931,7 +21936,7 @@ write_viminfo_varlist(fp)
if (find_viminfo_parameter('!') == NULL)
return;
fprintf(fp, _("\n# global variables:\n"));
fputs(_("\n# global variables:\n"), fp);
todo = (int)globvarht.ht_used;
for (hi = globvarht.ht_array; todo > 0; ++hi)

View File

@@ -52,7 +52,7 @@
#define ARGOPT 0x40000L /* allow "++opt=val" argument */
#define SBOXOK 0x80000L /* allowed in the sandbox */
#define CMDWIN 0x100000L /* allowed in cmdline window */
#define MODIFY 0x200000L /* forbidden in non-'modifiable' buffer */
#define MODIFY 0x200000L /* forbidden in non-'modifiable' buffer */
#define EXFLAGS 0x400000L /* allow flags after count in argument */
#define FILES (XFILE | EXTRA) /* multiple extra files allowed */
#define WORD1 (EXTRA | NOSPC) /* one extra word allowed */
@@ -74,7 +74,7 @@ typedef struct exarg exarg_T;
# undef EX /* just in case */
#endif
#ifdef DO_DECLARE_EXCMD
# define EX(a, b, c, d) {(char_u *)b, c, d}
# define EX(a, b, c, d) {(char_u *)b, c, (long_u)(d)}
typedef void (*ex_func_T) __ARGS((exarg_T *eap));
@@ -116,7 +116,7 @@ EX(CMD_argdelete, "argdelete", ex_argdelete,
EX(CMD_argdo, "argdo", ex_listdo,
BANG|NEEDARG|EXTRA|NOTRLCOM),
EX(CMD_argedit, "argedit", ex_argedit,
BANG|NEEDARG|RANGE|NOTADR|FILE1|EDITCMD|TRLBAR),
BANG|NEEDARG|RANGE|NOTADR|FILE1|EDITCMD|ARGOPT|TRLBAR),
EX(CMD_argglobal, "argglobal", ex_args,
BANG|FILES|EDITCMD|ARGOPT|TRLBAR),
EX(CMD_arglocal, "arglocal", ex_args,
@@ -256,7 +256,7 @@ EX(CMD_copy, "copy", ex_copymove,
EX(CMD_colder, "colder", qf_age,
RANGE|NOTADR|COUNT|TRLBAR),
EX(CMD_colorscheme, "colorscheme", ex_colorscheme,
NEEDARG|WORD1|TRLBAR|CMDWIN),
WORD1|TRLBAR|CMDWIN),
EX(CMD_command, "command", ex_command,
EXTRA|BANG|NOTRLCOM|USECTRLV|CMDWIN),
EX(CMD_comclear, "comclear", ex_comclear,
@@ -1152,7 +1152,8 @@ struct exarg
int force_ff; /* ++ff= argument (index in cmd[]) */
#ifdef FEAT_MBYTE
int force_enc; /* ++enc= argument (index in cmd[]) */
int bad_char; /* ++bad= argument (index in cmd[]) */
int bad_char_idx; /* ++bad= argument (index in cmd[]) */
int bad_char; /* BAD_KEEP, BAD_DROP or replacement char */
#endif
#ifdef FEAT_USR_CMDS
int useridx; /* user command index */

View File

@@ -4739,7 +4739,7 @@ getargopt(eap)
else if (STRNCMP(arg, "bad", 3) == 0)
{
arg += 3;
pp = &eap->bad_char;
pp = &eap->bad_char_idx;
}
#endif
@@ -4770,7 +4770,7 @@ getargopt(eap)
{
/* Check ++bad= argument. Must be a single-byte character, "keep" or
* "drop". */
p = eap->cmd + eap->bad_char;
p = eap->cmd + eap->bad_char_idx;
if (STRICMP(p, "keep") == 0)
eap->bad_char = BAD_KEEP;
else if (STRICMP(p, "drop") == 0)
@@ -6226,7 +6226,31 @@ parse_compl_arg(value, vallen, complp, argt, compl_arg)
ex_colorscheme(eap)
exarg_T *eap;
{
if (load_colors(eap->arg) == FAIL)
if (*eap->arg == NUL)
{
#ifdef FEAT_EVAL
char_u *expr = vim_strsave((char_u *)"g:colors_name");
char_u *p = NULL;
if (expr != NULL)
{
++emsg_off;
p = eval_to_string(expr, NULL, FALSE);
--emsg_off;
vim_free(expr);
}
if (p != NULL)
{
MSG(p);
vim_free(p);
}
else
MSG("default");
#else
MSG(_("unknown"));
#endif
}
else if (load_colors(eap->arg) == FAIL)
EMSG2(_("E185: Cannot find color scheme %s"), eap->arg);
}

View File

@@ -595,7 +595,11 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
#endif
if (newfile)
{
if (perm < 0)
if (perm < 0
#ifdef ENOENT
&& errno == ENOENT
#endif
)
{
/*
* Set the 'new-file' flag, so that when the file has
@@ -663,6 +667,9 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
filemess(curbuf, sfname, (char_u *)(
# ifdef EFBIG
(errno == EFBIG) ? _("[File too big]") :
# endif
# ifdef EOVERFLOW
(errno == EOVERFLOW) ? _("[File too big]") :
# endif
_("[Permission Denied]")), 0);
curbuf->b_p_ro = TRUE; /* must use "w!" now */

View File

@@ -2917,6 +2917,7 @@ gui_mch_dialog(type, title, message, button_names, dfltbutton, textfield)
*textfield = NUL;
else
vim_strncpy(textfield, p, IOSIZE - 1);
XtFree((char *)p);
}
suppress_dialog_mnemonics(dialogform);

View File

@@ -1113,6 +1113,70 @@ cs_find_common(opt, pat, forceit, verbose, use_ll)
#ifdef FEAT_QUICKFIX
char cmdletter;
char *qfpos;
/* get cmd letter */
switch (opt[0])
{
case '0' :
cmdletter = 's';
break;
case '1' :
cmdletter = 'g';
break;
case '2' :
cmdletter = 'd';
break;
case '3' :
cmdletter = 'c';
break;
case '4' :
cmdletter = 't';
break;
case '6' :
cmdletter = 'e';
break;
case '7' :
cmdletter = 'f';
break;
case '8' :
cmdletter = 'i';
break;
default :
cmdletter = opt[0];
}
qfpos = (char *)vim_strchr(p_csqf, cmdletter);
if (qfpos != NULL)
{
qfpos++;
/* next symbol must be + or - */
if (strchr(CSQF_FLAGS, *qfpos) == NULL)
{
char *nf = _("E469: invalid cscopequickfix flag %c for %c");
char *buf = (char *)alloc((unsigned)strlen(nf));
/* strlen will be enough because we use chars */
if (buf != NULL)
{
sprintf(buf, nf, *qfpos, *(qfpos-1));
(void)EMSG(buf);
vim_free(buf);
}
return FALSE;
}
# ifdef FEAT_AUTOCMD
if (*qfpos != '0')
{
apply_autocmds(EVENT_QUICKFIXCMDPRE, (char_u *)"cscope",
curbuf->b_fname, TRUE, curbuf);
# ifdef FEAT_EVAL
if (did_throw || force_abort)
return FALSE;
# endif
}
# endif
}
#endif
/* create the actual command to send to cscope */
@@ -1174,58 +1238,6 @@ cs_find_common(opt, pat, forceit, verbose, use_ll)
}
#ifdef FEAT_QUICKFIX
/* get cmd letter */
switch (opt[0])
{
case '0' :
cmdletter = 's';
break;
case '1' :
cmdletter = 'g';
break;
case '2' :
cmdletter = 'd';
break;
case '3' :
cmdletter = 'c';
break;
case '4' :
cmdletter = 't';
break;
case '6' :
cmdletter = 'e';
break;
case '7' :
cmdletter = 'f';
break;
case '8' :
cmdletter = 'i';
break;
default :
cmdletter = opt[0];
}
qfpos = (char *)vim_strchr(p_csqf, cmdletter);
if (qfpos != NULL)
{
qfpos++;
/* next symbol must be + or - */
if (strchr(CSQF_FLAGS, *qfpos) == NULL)
{
char *nf = _("E469: invalid cscopequickfix flag %c for %c");
char *buf = (char *)alloc((unsigned)strlen(nf));
/* strlen will be enough because we use chars */
if (buf != NULL)
{
sprintf(buf, nf, *qfpos, *(qfpos-1));
(void)EMSG(buf);
vim_free(buf);
}
vim_free(nummatches);
return FALSE;
}
}
if (qfpos != NULL && *qfpos != '0' && totmatches > 0)
{
/* fill error list */
@@ -1258,6 +1270,11 @@ cs_find_common(opt, pat, forceit, verbose, use_ll)
postponed_split = 0;
}
# endif
# ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_QUICKFIXCMDPOST, (char_u *)"cscope",
curbuf->b_fname, TRUE, curbuf);
# endif
if (use_ll)
/*
* In the location list window, use the displayed location

View File

@@ -1477,7 +1477,7 @@ parse_command_name(parmp)
++initstr;
}
/* Avoid using evim mode for "editor". */
/* Use evim mode for "evim" and "egvim", not for "editor". */
if (TOLOWER_ASC(initstr[0]) == 'e'
&& (TOLOWER_ASC(initstr[1]) == 'v'
|| TOLOWER_ASC(initstr[1]) == 'g'))
@@ -2262,7 +2262,7 @@ scripterror:
* Look for evidence of non-Cygwin paths before we bother.
* This is only for when using the Unix files.
*/
if (strpbrk(p, "\\:") != NULL)
if (strpbrk(p, "\\:") != NULL && !path_with_url(p))
{
char posix_path[PATH_MAX];

View File

@@ -245,6 +245,9 @@ static char_u *make_percent_swname __ARGS((char_u *dir, char_u *name));
#ifdef FEAT_BYTEOFF
static void ml_updatechunk __ARGS((buf_T *buf, long line, long len, int updtype));
#endif
#ifdef HAVE_READLINK
static int resolve_symlink __ARGS((char_u *fname, char_u *buf));
#endif
/*
* Open a new memline for "buf".
@@ -1401,10 +1404,19 @@ recover_names(fname, list, nr)
int i;
char_u *dirp;
char_u *dir_name;
char_u *fname_res = *fname;
#ifdef HAVE_READLINK
char_u fname_buf[MAXPATHL];
/* Expand symlink in the file name, because the swap file is created with
* the actual file instead of with the symlink. */
if (resolve_symlink(*fname, fname_buf) == OK)
fname_res = fname_buf;
#endif
if (list)
{
/* use msg() to start the scrolling properly */
/* use msg() to start the scrolling properly */
msg((char_u *)_("Swap files found:"));
msg_putchar('\n');
}
@@ -1453,7 +1465,7 @@ recover_names(fname, list, nr)
#endif
}
else
num_names = recov_file_names(names, *fname, TRUE);
num_names = recov_file_names(names, fname_res, TRUE);
}
else /* check directory dir_name */
{
@@ -1490,12 +1502,12 @@ recover_names(fname, list, nr)
if (after_pathsep(dir_name, p) && p[-1] == p[-2])
{
/* Ends with '//', Use Full path for swap name */
tail = make_percent_swname(dir_name, *fname);
tail = make_percent_swname(dir_name, fname_res);
}
else
#endif
{
tail = gettail(*fname);
tail = gettail(fname_res);
tail = concat_fnames(dir_name, tail, TRUE);
}
if (tail == NULL)
@@ -1535,11 +1547,13 @@ recover_names(fname, list, nr)
struct stat st;
char_u *swapname;
swapname = modname(fname_res,
#if defined(VMS) || defined(RISCOS)
swapname = modname(*fname, (char_u *)"_swp", FALSE);
(char_u *)"_swp", FALSE
#else
swapname = modname(*fname, (char_u *)".swp", TRUE);
(char_u *)".swp", TRUE
#endif
);
if (swapname != NULL)
{
if (mch_stat((char *)swapname, &st) != -1) /* It exists! */
@@ -3508,8 +3522,6 @@ ml_lineadd(buf, count)
}
#ifdef HAVE_READLINK
static int resolve_symlink __ARGS((char_u *fname, char_u *buf));
/*
* Resolve a symlink in the last component of a file name.
* Note that f_resolve() does it for every part of the path, we don't do that
@@ -3601,9 +3613,9 @@ makeswapname(fname, ffname, buf, dir_name)
char_u *dir_name;
{
char_u *r, *s;
char_u *fname_res = fname;
#ifdef HAVE_READLINK
char_u fname_buf[MAXPATHL];
char_u *fname_res;
#endif
#if defined(UNIX) || defined(WIN3264) /* Need _very_ long file names */
@@ -3625,8 +3637,6 @@ makeswapname(fname, ffname, buf, dir_name)
* actual file instead of with the symlink. */
if (resolve_symlink(fname, fname_buf) == OK)
fname_res = fname_buf;
else
fname_res = fname;
#endif
r = buf_modname(
@@ -3639,11 +3649,7 @@ makeswapname(fname, ffname, buf, dir_name)
/* Avoid problems if fname has special chars, eg <Wimp$Scrap> */
ffname,
#else
# ifdef HAVE_READLINK
fname_res,
# else
fname,
# endif
#endif
(char_u *)
#if defined(VMS) || defined(RISCOS)

View File

@@ -58,6 +58,9 @@ static char_u *menu_skip_part __ARGS((char_u *p));
static char_u *menutrans_lookup __ARGS((char_u *name, int len));
#endif
static char_u *menu_translate_tab_and_shift __ARGS((char_u *arg_start));
static void menu_unescape_name __ARGS((char_u *p));
/* The character for each menu mode */
static char_u menu_mode_chars[] = {'n', 'v', 's', 'o', 'i', 'c', 't'};
@@ -106,10 +109,6 @@ ex_menu(eap)
int pri_tab[MENUDEPTH + 1];
int enable = MAYBE; /* TRUE for "menu enable", FALSE for "menu
* disable */
#ifdef FEAT_MULTI_LANG
char_u *tofree = NULL;
char_u *new_cmd;
#endif
#ifdef FEAT_TOOLBAR
char_u *icon = NULL;
#endif
@@ -251,41 +250,6 @@ ex_menu(eap)
}
#endif
#ifdef FEAT_MULTI_LANG
/*
* Translate menu names as specified with ":menutrans" commands.
*/
menu_path = arg;
while (*menu_path)
{
/* find the end of one part and check if it should be translated */
p = menu_skip_part(menu_path);
map_to = menutrans_lookup(menu_path, (int)(p - menu_path));
if (map_to != NULL)
{
/* found a match: replace with the translated part */
i = (int)STRLEN(map_to);
new_cmd = alloc((unsigned)STRLEN(arg) + i + 1);
if (new_cmd == NULL)
break;
mch_memmove(new_cmd, arg, menu_path - arg);
mch_memmove(new_cmd + (menu_path - arg), map_to, (size_t)i);
STRCPY(new_cmd + (menu_path - arg) + i, p);
p = new_cmd + (menu_path - arg) + i;
vim_free(tofree);
tofree = new_cmd;
arg = new_cmd;
}
if (*p != '.')
break;
menu_path = p + 1;
}
#endif
/*
* Isolate the menu name.
* Skip the menu name, and translate <Tab> into a real TAB.
*/
menu_path = arg;
if (*menu_path == '.')
{
@@ -293,21 +257,7 @@ ex_menu(eap)
goto theend;
}
while (*arg && !vim_iswhite(*arg))
{
if ((*arg == '\\' || *arg == Ctrl_V) && arg[1] != NUL)
arg++;
else if (STRNICMP(arg, "<TAB>", 5) == 0)
{
*arg = TAB;
STRMOVE(arg + 1, arg + 5);
}
arg++;
}
if (*arg != NUL)
*arg++ = NUL;
arg = skipwhite(arg);
map_to = arg;
map_to = menu_translate_tab_and_shift(arg);
/*
* If there is only a menu name, display menus with that name.
@@ -453,11 +403,7 @@ ex_menu(eap)
#endif
theend:
#ifdef FEAT_MULTI_LANG
vim_free(tofree);
#else
;
#endif
}
/*
@@ -490,6 +436,7 @@ add_menu_path(menu_path, menuarg, pri_tab, call_data
char_u *next_name;
int i;
int c;
int d;
#ifdef FEAT_GUI
int idx;
int new_idx;
@@ -497,6 +444,10 @@ add_menu_path(menu_path, menuarg, pri_tab, call_data
int pri_idx = 0;
int old_modes = 0;
int amenu;
#ifdef FEAT_MULTI_LANG
char_u *en_name;
char_u *map_to = NULL;
#endif
/* Make a copy so we can stuff around with it, since it could be const */
path_name = vim_strsave(menu_path);
@@ -510,6 +461,16 @@ add_menu_path(menu_path, menuarg, pri_tab, call_data
/* Get name of this element in the menu hierarchy, and the simplified
* name (without mnemonic and accelerator text). */
next_name = menu_name_skip(name);
#ifdef FEAT_MULTI_LANG
map_to = menutrans_lookup(name,STRLEN(name));
if (map_to != NULL)
{
en_name = name;
name = map_to;
}
else
en_name = NULL;
#endif
dname = menu_text(name, NULL, NULL);
if (dname == NULL)
goto erret;
@@ -593,6 +554,18 @@ add_menu_path(menu_path, menuarg, pri_tab, call_data
menu->name = vim_strsave(name);
/* separate mnemonic and accelerator text from actual menu name */
menu->dname = menu_text(name, &menu->mnemonic, &menu->actext);
#ifdef FEAT_MULTI_LANG
if (en_name != NULL)
{
menu->en_name = vim_strsave(en_name);
menu->en_dname = menu_text(en_name, NULL, NULL);
}
else
{
menu->en_name = NULL;
menu->en_dname = NULL;
}
#endif
menu->priority = pri_tab[pri_idx];
menu->parent = parent;
#ifdef FEAT_GUI_MOTIF
@@ -746,6 +719,7 @@ add_menu_path(menu_path, menuarg, pri_tab, call_data
* Don't do this if adding a tearbar (addtearoff == FALSE).
* Don't do this for "<Nop>". */
c = 0;
d = 0;
if (amenu && call_data != NULL && *call_data != NUL
#ifdef FEAT_GUI_W32
&& addtearoff
@@ -761,18 +735,25 @@ add_menu_path(menu_path, menuarg, pri_tab, call_data
c = Ctrl_C;
break;
case MENU_INSERT_MODE:
c = Ctrl_O;
c = Ctrl_BSL;
d = Ctrl_O;
break;
}
}
if (c)
if (c != 0)
{
menu->strings[i] = alloc((unsigned)(STRLEN(call_data) + 4));
menu->strings[i] = alloc((unsigned)(STRLEN(call_data) + 5 ));
if (menu->strings[i] != NULL)
{
menu->strings[i][0] = c;
STRCPY(menu->strings[i] + 1, call_data);
if (d == 0)
STRCPY(menu->strings[i] + 1, call_data);
else
{
menu->strings[i][1] = d;
STRCPY(menu->strings[i] + 2, call_data);
}
if (c == Ctrl_C)
{
int len = (int)STRLEN(menu->strings[i]);
@@ -1031,6 +1012,10 @@ free_menu(menup)
*menup = menu->next;
vim_free(menu->name);
vim_free(menu->dname);
#ifdef FEAT_MULTI_LANG
vim_free(menu->en_name);
vim_free(menu->en_dname);
#endif
vim_free(menu->actext);
#ifdef FEAT_TOOLBAR
vim_free(menu->iconfile);
@@ -1348,9 +1333,15 @@ get_menu_name(xp, idx)
{
static vimmenu_T *menu = NULL;
char_u *str;
#ifdef FEAT_MULTI_LANG
static int should_advance = FALSE;
#endif
if (idx == 0) /* first call: start at first item */
{
menu = expand_menu;
should_advance = FALSE;
}
/* Skip PopUp[nvoci]. */
while (menu != NULL && (menu_is_hidden(menu->dname)
@@ -1363,12 +1354,30 @@ get_menu_name(xp, idx)
return NULL;
if (menu->modes & expand_modes)
str = menu->dname;
#ifdef FEAT_MULTI_LANG
if (should_advance)
str = menu->en_dname;
else
{
#endif
str = menu->dname;
#ifdef FEAT_MULTI_LANG
if (menu->en_dname == NULL)
should_advance = TRUE;
}
#endif
else
str = (char_u *)"";
/* Advance to next menu entry. */
menu = menu->next;
#ifdef FEAT_MULTI_LANG
if (should_advance)
#endif
/* Advance to next menu entry. */
menu = menu->next;
#ifdef FEAT_MULTI_LANG
should_advance = !should_advance;
#endif
return str;
}
@@ -1385,9 +1394,15 @@ get_menu_names(xp, idx)
static vimmenu_T *menu = NULL;
static char_u tbuffer[256]; /*hack*/
char_u *str;
#ifdef FEAT_MULTI_LANG
static int should_advance = FALSE;
#endif
if (idx == 0) /* first call: start at first item */
{
menu = expand_menu;
should_advance = FALSE;
}
/* Skip Browse-style entries, popup menus and separators. */
while (menu != NULL
@@ -1407,20 +1422,51 @@ get_menu_names(xp, idx)
{
if (menu->children != NULL)
{
STRCPY(tbuffer, menu->dname);
#ifdef FEAT_MULTI_LANG
if (should_advance)
STRCPY(tbuffer, menu->en_dname);
else
{
#endif
STRCPY(tbuffer, menu->dname);
#ifdef FEAT_MULTI_LANG
if (menu->en_dname == NULL)
should_advance = TRUE;
}
#endif
/* hack on menu separators: use a 'magic' char for the separator
* so that '.' in names gets escaped properly */
STRCAT(tbuffer, "\001");
str = tbuffer;
}
else
str = menu->dname;
#ifdef FEAT_MULTI_LANG
{
if (should_advance)
str = menu->en_dname;
else
{
#endif
str = menu->dname;
#ifdef FEAT_MULTI_LANG
if (menu->en_dname == NULL)
should_advance = TRUE;
}
}
#endif
}
else
str = (char_u *)"";
/* Advance to next menu entry. */
menu = menu->next;
#ifdef FEAT_MULTI_LANG
if (should_advance)
#endif
/* Advance to next menu entry. */
menu = menu->next;
#ifdef FEAT_MULTI_LANG
should_advance = !should_advance;
#endif
return str;
}
@@ -1460,7 +1506,11 @@ menu_name_equal(name, menu)
char_u *name;
vimmenu_T *menu;
{
return (menu_namecmp(name, menu->name) || menu_namecmp(name, menu->dname));
if (menu->en_name != NULL
&& (menu_namecmp(name,menu->en_name)
|| menu_namecmp(name,menu->en_dname)))
return TRUE;
return menu_namecmp(name, menu->name) || menu_namecmp(name, menu->dname);
}
static int
@@ -2393,6 +2443,10 @@ ex_menutranslate(eap)
to = vim_strnsave(to, (int)(arg - to));
if (from_noamp != NULL && to != NULL)
{
menu_translate_tab_and_shift(from);
menu_translate_tab_and_shift(to);
menu_unescape_name(from);
menu_unescape_name(to);
tp[menutrans_ga.ga_len].from = from;
tp[menutrans_ga.ga_len].from_noamp = from_noamp;
tp[menutrans_ga.ga_len].to = to;
@@ -2467,4 +2521,46 @@ menutrans_lookup(name, len)
}
#endif /* FEAT_MULTI_LANG */
/*
* Unescape the name in the translate dictionary table.
*/
static void
menu_unescape_name(name)
char_u *name;
{
char_u *p;
for (p = name; *p && *p != '.'; mb_ptr_adv(p))
if (*p == '\\')
STRMOVE(p, p + 1);
}
/*
* Isolate the menu name.
* Skip the menu name, and translate <Tab> into a real TAB.
*/
static char_u *
menu_translate_tab_and_shift(arg_start)
char_u *arg_start;
{
char_u *arg = arg_start;
while (*arg && !vim_iswhite(*arg))
{
if ((*arg == '\\' || *arg == Ctrl_V) && arg[1] != NUL)
arg++;
else if (STRNICMP(arg, "<TAB>", 5) == 0)
{
*arg = TAB;
STRMOVE(arg + 1, arg + 5);
}
arg++;
}
if (*arg != NUL)
*arg++ = NUL;
arg = skipwhite(arg);
return arg;
}
#endif /* FEAT_MENU */

View File

@@ -3196,7 +3196,7 @@ get_mouse_class(p)
* There are a few special cases where we want certain combinations of
* characters to be considered as a single word. These are things like
* "->", "/ *", "*=", "+=", "&=", "<=", ">=", "!=" etc. Otherwise, each
* character is in it's own class.
* character is in its own class.
*/
if (c != NUL && vim_strchr((char_u *)"-+*/%<>&|^!=", c) != NULL)
return 1;
@@ -4085,7 +4085,7 @@ check_scrollbind(topline_diff, leftcol_diff)
/*
* Command character that's ignored.
* Used for CTRL-Q and CTRL-S to avoid problems with terminals that use
* xon/xoff
* xon/xoff.
*/
static void
nv_ignore(cap)
@@ -4936,13 +4936,15 @@ dozet:
/* "zx": re-apply 'foldlevel' and open folds at the cursor */
case 'x': curwin->w_p_fen = TRUE;
newFoldLevel(); /* update right now */
curwin->w_foldinvalid = TRUE; /* recompute folds */
newFoldLevel(); /* update right now */
foldOpenCursor();
break;
/* "zX": undo manual opens/closes, re-apply 'foldlevel' */
case 'X': curwin->w_p_fen = TRUE;
old_fdl = -1; /* force an update */
curwin->w_foldinvalid = TRUE; /* recompute folds */
old_fdl = -1; /* force an update */
break;
/* "zm": fold more */
@@ -6523,7 +6525,7 @@ nv_brackets(cap)
* [ or ] followed by a middle mouse click: put selected text with
* indent adjustment. Any other button just does as usual.
*/
else if (cap->nchar >= K_LEFTMOUSE && cap->nchar <= K_RIGHTRELEASE)
else if (cap->nchar >= K_RIGHTRELEASE && cap->nchar <= K_LEFTMOUSE)
{
(void)do_mouse(cap->oap, cap->nchar,
(cap->cmdchar == ']') ? FORWARD : BACKWARD,

View File

@@ -3696,9 +3696,32 @@ set_init_3()
* Isolate the name of the shell:
* - Skip beyond any path. E.g., "/usr/bin/csh -f" -> "csh -f".
* - Remove any argument. E.g., "csh -f" -> "csh".
* But don't allow a space in the path, so that this works:
* "/usr/bin/csh --rcfile ~/.cshrc"
* But don't do that for Windows, it's common to have a space in the path.
*/
#ifdef WIN3264
p = gettail(p_sh);
p = vim_strnsave(p, (int)(skiptowhite(p) - p));
#else
p = skiptowhite(p_sh);
if (*p == NUL)
{
/* No white space, use the tail. */
p = vim_strsave(gettail(p_sh));
}
else
{
char_u *p1, *p2;
/* Find the last path separator before the space. */
p1 = p_sh;
for (p2 = p_sh; p2 < p; mb_ptr_adv(p2))
if (vim_ispathsep(*p2))
p1 = p2 + 1;
p = vim_strnsave(p1, (int)(p - p1));
}
#endif
if (p != NULL)
{
/*
@@ -10409,6 +10432,11 @@ langmap_set()
p2 = NULL; /* aAbBcCdD form, p2 is NULL */
while (p[0])
{
if (p[0] == ',')
{
++p;
break;
}
if (p[0] == '\\' && p[1] != NUL)
++p;
#ifdef FEAT_MBYTE
@@ -10416,26 +10444,33 @@ langmap_set()
#else
from = p[0];
#endif
to = NUL;
if (p2 == NULL)
{
mb_ptr_adv(p);
if (p[0] == '\\')
++p;
if (p[0] != ',')
{
if (p[0] == '\\')
++p;
#ifdef FEAT_MBYTE
to = (*mb_ptr2char)(p);
to = (*mb_ptr2char)(p);
#else
to = p[0];
to = p[0];
#endif
}
}
else
{
if (p2[0] == '\\')
++p2;
if (p2[0] != ',')
{
if (p2[0] == '\\')
++p2;
#ifdef FEAT_MBYTE
to = (*mb_ptr2char)(p2);
to = (*mb_ptr2char)(p2);
#else
to = p2[0];
to = p2[0];
#endif
}
}
if (to == NUL)
{
@@ -10453,15 +10488,7 @@ langmap_set()
/* Advance to next pair */
mb_ptr_adv(p);
if (p2 == NULL)
{
if (p[0] == ',')
{
++p;
break;
}
}
else
if (p2 != NULL)
{
mb_ptr_adv(p2);
if (*p == ';')

View File

@@ -3654,7 +3654,11 @@ set_errorlist(wp, list, action)
}
}
qi->qf_lists[qi->qf_curlist].qf_nonevalid = FALSE;
if (qi->qf_lists[qi->qf_curlist].qf_index == 0)
/* empty list or no valid entry */
qi->qf_lists[qi->qf_curlist].qf_nonevalid = TRUE;
else
qi->qf_lists[qi->qf_curlist].qf_nonevalid = FALSE;
qi->qf_lists[qi->qf_curlist].qf_ptr = qi->qf_lists[qi->qf_curlist].qf_start;
qi->qf_lists[qi->qf_curlist].qf_index = 1;

View File

@@ -9780,10 +9780,16 @@ init_spell_chartab()
{
for (i = 128; i < 256; ++i)
{
int f = utf_fold(i);
int u = utf_toupper(i);
spelltab.st_isu[i] = utf_isupper(i);
spelltab.st_isw[i] = spelltab.st_isu[i] || utf_islower(i);
spelltab.st_fold[i] = utf_fold(i);
spelltab.st_upper[i] = utf_toupper(i);
/* The folded/upper-cased value is different between latin1 and
* utf8 for 0xb5, causing E763 for no good reason. Use the latin1
* value for utf-8 to avoid this. */
spelltab.st_fold[i] = (f < 256) ? f : i;
spelltab.st_upper[i] = (u < 256) ? u : i;
}
}
else

View File

@@ -232,7 +232,7 @@ struct wininfo_S
{
wininfo_T *wi_next; /* next entry or NULL for last entry */
wininfo_T *wi_prev; /* previous entry or NULL for first entry */
win_T *wi_win; /* pointer to window that did set wi_lnum */
win_T *wi_win; /* pointer to window that did set wi_fpos */
pos_T wi_fpos; /* last cursor position in the file */
int wi_optset; /* TRUE when wi_opt has useful values */
winopt_T wi_opt; /* local window options */
@@ -2207,8 +2207,14 @@ struct VimMenu
{
int modes; /* Which modes is this menu visible for? */
int enabled; /* for which modes the menu is enabled */
char_u *name; /* Name of menu */
char_u *dname; /* Displayed Name (without '&') */
char_u *name; /* Name of menu, possibly translated */
char_u *dname; /* Displayed Name ("name" without '&') */
#ifdef FEAT_MULTI_LANG
char_u *en_name; /* "name" untranslated, NULL when "name"
* was not translated */
char_u *en_dname; /* "dname" untranslated, NULL when "dname"
* was not translated */
#endif
int mnemonic; /* mnemonic key (after '&') */
char_u *actext; /* accelerator text (after TAB) */
int priority; /* Menu order priority */

View File

@@ -7136,7 +7136,8 @@ do_highlight(line, forceit, init)
}
}
}
/* Add one to the argument, to avoid zero */
/* Add one to the argument, to avoid zero. Zero is used for
* "NONE", then "color" is -1. */
if (key[5] == 'F')
{
HL_TABLE()[idx].sg_cterm_fg = color + 1;
@@ -7150,7 +7151,7 @@ do_highlight(line, forceit, init)
#endif
{
must_redraw = CLEAR;
if (termcap_active)
if (termcap_active && color >= 0)
term_fg_color(color);
}
}
@@ -7167,16 +7168,21 @@ do_highlight(line, forceit, init)
#endif
{
must_redraw = CLEAR;
if (termcap_active)
term_bg_color(color);
if (t_colors < 16)
i = (color == 0 || color == 4);
else
i = (color < 7 || color == 8);
/* Set the 'background' option if the value is wrong. */
if (i != (*p_bg == 'd'))
set_option_value((char_u *)"bg", 0L,
i ? (char_u *)"dark" : (char_u *)"light", 0);
if (color >= 0)
{
if (termcap_active)
term_bg_color(color);
if (t_colors < 16)
i = (color == 0 || color == 4);
else
i = (color < 7 || color == 8);
/* Set the 'background' option if the value is
* wrong. */
if (i != (*p_bg == 'd'))
set_option_value((char_u *)"bg", 0L,
i ? (char_u *)"dark"
: (char_u *)"light", 0);
}
}
}
}

View File

@@ -681,6 +681,50 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
433,
/**/
432,
/**/
431,
/**/
430,
/**/
429,
/**/
428,
/**/
427,
/**/
426,
/**/
425,
/**/
424,
/**/
423,
/**/
422,
/**/
421,
/**/
420,
/**/
419,
/**/
418,
/**/
417,
/**/
416,
/**/
415,
/**/
414,
/**/
413,
/**/
412,
/**/
411,
/**/