|
Karsten Hopp |
81c285 |
To: vim-dev@vim.org
|
|
Karsten Hopp |
81c285 |
Subject: Patch 7.2.169
|
|
Karsten Hopp |
81c285 |
Fcc: outbox
|
|
Karsten Hopp |
81c285 |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
81c285 |
Mime-Version: 1.0
|
|
Karsten Hopp |
81c285 |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
81c285 |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
81c285 |
------------
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
Patch 7.2.169
|
|
Karsten Hopp |
81c285 |
Problem: Splint complains about a lot of things.
|
|
Karsten Hopp |
81c285 |
Solution: Add type casts, #ifdefs and other changes to avoid warnings.
|
|
Karsten Hopp |
81c285 |
Change colnr_T from unsigned to int. Avoids mistakes with
|
|
Karsten Hopp |
81c285 |
subtracting columns.
|
|
Karsten Hopp |
81c285 |
Files: src/cleanlint.vim, src/diff.c, src/edit.c, src/ex_cmds.c,
|
|
Karsten Hopp |
81c285 |
src/ex_cmds2.c, src/ex_docmd.c, src/proto/ex_cmds.pro,
|
|
Karsten Hopp |
81c285 |
src/proto/spell.pro, src/quickfix.c, src/spell.c, src/structs.h,
|
|
Karsten Hopp |
81c285 |
src/term.h, src/vim.h
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.168/src/cleanlint.vim 2009-05-13 12:46:36.000000000 +0200
|
|
Karsten Hopp |
81c285 |
--- src/cleanlint.vim 2009-05-13 18:03:11.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1,27 ****
|
|
Karsten Hopp |
81c285 |
" Vim tool: Filter output of splint
|
|
Karsten Hopp |
81c285 |
"
|
|
Karsten Hopp |
81c285 |
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
|
Karsten Hopp |
81c285 |
! " Last Change: 2009 May 05
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
" Usage: redirect output of "make lint" to a file, edit that file with Vim and
|
|
Karsten Hopp |
81c285 |
" :call CleanLint()
|
|
Karsten Hopp |
81c285 |
" This deletes irrelevant messages. What remains might be valid warnings.
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
fun! CleanLint()
|
|
Karsten Hopp |
81c285 |
- g/^ Types are incompatible/lockmarks d
|
|
Karsten Hopp |
81c285 |
g/Assignment of dev_t to __dev_t:/lockmarks d
|
|
Karsten Hopp |
81c285 |
g/Assignment of __dev_t to dev_t:/lockmarks d
|
|
Karsten Hopp |
81c285 |
g/Operands of == have incompatible types (__dev_t, dev_t): /lockmarks d
|
|
Karsten Hopp |
81c285 |
! g/Operands of == have incompatible types (unsigned int, int): /lockmarks d
|
|
Karsten Hopp |
81c285 |
g/Assignment of char to char_u: /lockmarks d
|
|
Karsten Hopp |
81c285 |
g/Assignment of unsigned int to int: /lockmarks d
|
|
Karsten Hopp |
81c285 |
! g/Assignment of colnr_T to int: /lockmarks d
|
|
Karsten Hopp |
81c285 |
g/Assignment of int to char_u: /lockmarks d
|
|
Karsten Hopp |
81c285 |
g/Function .* expects arg . to be wint_t gets int: /lockmarks d
|
|
Karsten Hopp |
81c285 |
! g/^digraph.c.*digraphdefault.*is type char, expects char_u:/lockmarks d
|
|
Karsten Hopp |
81c285 |
g/^digraph.c.*Additional initialization errors for digraphdefault not reported/lockmarks d
|
|
Karsten Hopp |
81c285 |
g/Function strncasecmp expects arg 3 to be int gets size_t: /lockmarks d
|
|
Karsten Hopp |
81c285 |
g/ To ignore signs in type comparisons use +ignoresigns/lockmarks d
|
|
Karsten Hopp |
81c285 |
g/ To allow arbitrary integral types to match any integral type, use +matchanyintegral./lockmarks d
|
|
Karsten Hopp |
81c285 |
g/ To allow arbitrary integral types to match long unsigned, use +longintegral./lockmarks d
|
|
Karsten Hopp |
81c285 |
endfun
|
|
Karsten Hopp |
81c285 |
--- 1,32 ----
|
|
Karsten Hopp |
81c285 |
" Vim tool: Filter output of splint
|
|
Karsten Hopp |
81c285 |
"
|
|
Karsten Hopp |
81c285 |
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
|
Karsten Hopp |
81c285 |
! " Last Change: 2009 May 13
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
" Usage: redirect output of "make lint" to a file, edit that file with Vim and
|
|
Karsten Hopp |
81c285 |
" :call CleanLint()
|
|
Karsten Hopp |
81c285 |
" This deletes irrelevant messages. What remains might be valid warnings.
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
fun! CleanLint()
|
|
Karsten Hopp |
81c285 |
g/Assignment of dev_t to __dev_t:/lockmarks d
|
|
Karsten Hopp |
81c285 |
g/Assignment of __dev_t to dev_t:/lockmarks d
|
|
Karsten Hopp |
81c285 |
g/Operands of == have incompatible types (__dev_t, dev_t): /lockmarks d
|
|
Karsten Hopp |
81c285 |
! g/Operands of == have incompatible types (char_u, int): /lockmarks d
|
|
Karsten Hopp |
81c285 |
g/Assignment of char to char_u: /lockmarks d
|
|
Karsten Hopp |
81c285 |
g/Assignment of unsigned int to int: /lockmarks d
|
|
Karsten Hopp |
81c285 |
! g/Assignment of int to unsigned int: /lockmarks d
|
|
Karsten Hopp |
81c285 |
! g/Assignment of unsigned int to long int: /lockmarks d
|
|
Karsten Hopp |
81c285 |
g/Assignment of int to char_u: /lockmarks d
|
|
Karsten Hopp |
81c285 |
g/Function .* expects arg . to be wint_t gets int: /lockmarks d
|
|
Karsten Hopp |
81c285 |
! g/Function .* expects arg . to be size_t gets int: /lockmarks d
|
|
Karsten Hopp |
81c285 |
! g/Initial value of .* is type char, expects char_u: /lockmarks d
|
|
Karsten Hopp |
81c285 |
! g/^ex_cmds.h:.* Function types are inconsistent. Parameter 1 is implicitly temp, but unqualified in assigned function:/lockmarks d
|
|
Karsten Hopp |
81c285 |
! g/^ex_docmd.c:.* nospec_str/lockmarks d
|
|
Karsten Hopp |
81c285 |
g/^digraph.c.*Additional initialization errors for digraphdefault not reported/lockmarks d
|
|
Karsten Hopp |
81c285 |
g/Function strncasecmp expects arg 3 to be int gets size_t: /lockmarks d
|
|
Karsten Hopp |
81c285 |
+ g/^ Types are incompatible/lockmarks d
|
|
Karsten Hopp |
81c285 |
g/ To ignore signs in type comparisons use +ignoresigns/lockmarks d
|
|
Karsten Hopp |
81c285 |
g/ To allow arbitrary integral types to match any integral type, use +matchanyintegral./lockmarks d
|
|
Karsten Hopp |
81c285 |
g/ To allow arbitrary integral types to match long unsigned, use +longintegral./lockmarks d
|
|
Karsten Hopp |
81c285 |
+ g+ A variable is declared but never used. Use /.@unused@./ in front of declaration to suppress message.+lockmarks d
|
|
Karsten Hopp |
81c285 |
endfun
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.168/src/diff.c 2009-03-11 12:45:44.000000000 +0100
|
|
Karsten Hopp |
81c285 |
--- src/diff.c 2009-05-13 16:16:11.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 827,832 ****
|
|
Karsten Hopp |
81c285 |
--- 827,833 ----
|
|
Karsten Hopp |
81c285 |
char_u *tmp_diff;
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
char_u *cmd;
|
|
Karsten Hopp |
81c285 |
+ size_t len;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
#ifdef FEAT_EVAL
|
|
Karsten Hopp |
81c285 |
if (*p_dex != NUL)
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 835,842 ****
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! cmd = alloc((unsigned)(STRLEN(tmp_orig) + STRLEN(tmp_new)
|
|
Karsten Hopp |
81c285 |
! + STRLEN(tmp_diff) + STRLEN(p_srr) + 27));
|
|
Karsten Hopp |
81c285 |
if (cmd != NULL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
/* We don't want $DIFF_OPTIONS to get in the way. */
|
|
Karsten Hopp |
81c285 |
--- 836,844 ----
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! len = STRLEN(tmp_orig) + STRLEN(tmp_new)
|
|
Karsten Hopp |
81c285 |
! + STRLEN(tmp_diff) + STRLEN(p_srr) + 27;
|
|
Karsten Hopp |
81c285 |
! cmd = alloc((unsigned)len);
|
|
Karsten Hopp |
81c285 |
if (cmd != NULL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
/* We don't want $DIFF_OPTIONS to get in the way. */
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 846,852 ****
|
|
Karsten Hopp |
81c285 |
/* Build the diff command and execute it. Always use -a, binary
|
|
Karsten Hopp |
81c285 |
* differences are of no use. Ignore errors, diff returns
|
|
Karsten Hopp |
81c285 |
* non-zero when differences have been found. */
|
|
Karsten Hopp |
81c285 |
! sprintf((char *)cmd, "diff %s%s%s%s%s %s",
|
|
Karsten Hopp |
81c285 |
diff_a_works == FALSE ? "" : "-a ",
|
|
Karsten Hopp |
81c285 |
#if defined(MSWIN) || defined(MSDOS)
|
|
Karsten Hopp |
81c285 |
diff_bin_works == TRUE ? "--binary " : "",
|
|
Karsten Hopp |
81c285 |
--- 848,854 ----
|
|
Karsten Hopp |
81c285 |
/* Build the diff command and execute it. Always use -a, binary
|
|
Karsten Hopp |
81c285 |
* differences are of no use. Ignore errors, diff returns
|
|
Karsten Hopp |
81c285 |
* non-zero when differences have been found. */
|
|
Karsten Hopp |
81c285 |
! vim_snprintf((char *)cmd, len, "diff %s%s%s%s%s %s",
|
|
Karsten Hopp |
81c285 |
diff_a_works == FALSE ? "" : "-a ",
|
|
Karsten Hopp |
81c285 |
#if defined(MSWIN) || defined(MSDOS)
|
|
Karsten Hopp |
81c285 |
diff_bin_works == TRUE ? "--binary " : "",
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 856,862 ****
|
|
Karsten Hopp |
81c285 |
(diff_flags & DIFF_IWHITE) ? "-b " : "",
|
|
Karsten Hopp |
81c285 |
(diff_flags & DIFF_ICASE) ? "-i " : "",
|
|
Karsten Hopp |
81c285 |
tmp_orig, tmp_new);
|
|
Karsten Hopp |
81c285 |
! append_redir(cmd, p_srr, tmp_diff);
|
|
Karsten Hopp |
81c285 |
#ifdef FEAT_AUTOCMD
|
|
Karsten Hopp |
81c285 |
block_autocmds(); /* Avoid ShellCmdPost stuff */
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
--- 858,864 ----
|
|
Karsten Hopp |
81c285 |
(diff_flags & DIFF_IWHITE) ? "-b " : "",
|
|
Karsten Hopp |
81c285 |
(diff_flags & DIFF_ICASE) ? "-i " : "",
|
|
Karsten Hopp |
81c285 |
tmp_orig, tmp_new);
|
|
Karsten Hopp |
81c285 |
! append_redir(cmd, (int)len, p_srr, tmp_diff);
|
|
Karsten Hopp |
81c285 |
#ifdef FEAT_AUTOCMD
|
|
Karsten Hopp |
81c285 |
block_autocmds(); /* Avoid ShellCmdPost stuff */
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 881,886 ****
|
|
Karsten Hopp |
81c285 |
--- 883,889 ----
|
|
Karsten Hopp |
81c285 |
char_u *tmp_orig; /* name of original temp file */
|
|
Karsten Hopp |
81c285 |
char_u *tmp_new; /* name of patched temp file */
|
|
Karsten Hopp |
81c285 |
char_u *buf = NULL;
|
|
Karsten Hopp |
81c285 |
+ size_t buflen;
|
|
Karsten Hopp |
81c285 |
win_T *old_curwin = curwin;
|
|
Karsten Hopp |
81c285 |
char_u *newname = NULL; /* name of patched file buffer */
|
|
Karsten Hopp |
81c285 |
#ifdef UNIX
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 920,930 ****
|
|
Karsten Hopp |
81c285 |
/* Get the absolute path of the patchfile, changing directory below. */
|
|
Karsten Hopp |
81c285 |
fullname = FullName_save(eap->arg, FALSE);
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
! buf = alloc((unsigned)(STRLEN(tmp_orig) + (
|
|
Karsten Hopp |
81c285 |
# ifdef UNIX
|
|
Karsten Hopp |
81c285 |
fullname != NULL ? STRLEN(fullname) :
|
|
Karsten Hopp |
81c285 |
# endif
|
|
Karsten Hopp |
81c285 |
! STRLEN(eap->arg)) + STRLEN(tmp_new) + 16));
|
|
Karsten Hopp |
81c285 |
if (buf == NULL)
|
|
Karsten Hopp |
81c285 |
goto theend;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--- 923,934 ----
|
|
Karsten Hopp |
81c285 |
/* Get the absolute path of the patchfile, changing directory below. */
|
|
Karsten Hopp |
81c285 |
fullname = FullName_save(eap->arg, FALSE);
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
! buflen = STRLEN(tmp_orig) + (
|
|
Karsten Hopp |
81c285 |
# ifdef UNIX
|
|
Karsten Hopp |
81c285 |
fullname != NULL ? STRLEN(fullname) :
|
|
Karsten Hopp |
81c285 |
# endif
|
|
Karsten Hopp |
81c285 |
! STRLEN(eap->arg)) + STRLEN(tmp_new) + 16;
|
|
Karsten Hopp |
81c285 |
! buf = alloc((unsigned)buflen);
|
|
Karsten Hopp |
81c285 |
if (buf == NULL)
|
|
Karsten Hopp |
81c285 |
goto theend;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 961,967 ****
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
/* Build the patch command and execute it. Ignore errors. Switch to
|
|
Karsten Hopp |
81c285 |
* cooked mode to allow the user to respond to prompts. */
|
|
Karsten Hopp |
81c285 |
! sprintf((char *)buf, "patch -o %s %s < \"%s\"", tmp_new, tmp_orig,
|
|
Karsten Hopp |
81c285 |
# ifdef UNIX
|
|
Karsten Hopp |
81c285 |
fullname != NULL ? fullname :
|
|
Karsten Hopp |
81c285 |
# endif
|
|
Karsten Hopp |
81c285 |
--- 965,972 ----
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
/* Build the patch command and execute it. Ignore errors. Switch to
|
|
Karsten Hopp |
81c285 |
* cooked mode to allow the user to respond to prompts. */
|
|
Karsten Hopp |
81c285 |
! vim_snprintf((char *)buf, buflen, "patch -o %s %s < \"%s\"",
|
|
Karsten Hopp |
81c285 |
! tmp_new, tmp_orig,
|
|
Karsten Hopp |
81c285 |
# ifdef UNIX
|
|
Karsten Hopp |
81c285 |
fullname != NULL ? fullname :
|
|
Karsten Hopp |
81c285 |
# endif
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.168/src/edit.c 2009-05-13 12:46:36.000000000 +0200
|
|
Karsten Hopp |
81c285 |
--- src/edit.c 2009-05-13 18:29:21.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 169,175 ****
|
|
Karsten Hopp |
81c285 |
static int ins_compl_key2count __ARGS((int c));
|
|
Karsten Hopp |
81c285 |
static int ins_compl_use_match __ARGS((int c));
|
|
Karsten Hopp |
81c285 |
static int ins_complete __ARGS((int c));
|
|
Karsten Hopp |
81c285 |
! static int quote_meta __ARGS((char_u *dest, char_u *str, int len));
|
|
Karsten Hopp |
81c285 |
#endif /* FEAT_INS_EXPAND */
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
#define BACKSPACE_CHAR 1
|
|
Karsten Hopp |
81c285 |
--- 169,175 ----
|
|
Karsten Hopp |
81c285 |
static int ins_compl_key2count __ARGS((int c));
|
|
Karsten Hopp |
81c285 |
static int ins_compl_use_match __ARGS((int c));
|
|
Karsten Hopp |
81c285 |
static int ins_complete __ARGS((int c));
|
|
Karsten Hopp |
81c285 |
! static unsigned quote_meta __ARGS((char_u *dest, char_u *str, int len));
|
|
Karsten Hopp |
81c285 |
#endif /* FEAT_INS_EXPAND */
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
#define BACKSPACE_CHAR 1
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 757,763 ****
|
|
Karsten Hopp |
81c285 |
* there is nothing to add, CTRL-L works like CTRL-P then. */
|
|
Karsten Hopp |
81c285 |
if (c == Ctrl_L
|
|
Karsten Hopp |
81c285 |
&& (ctrl_x_mode != CTRL_X_WHOLE_LINE
|
|
Karsten Hopp |
81c285 |
! || STRLEN(compl_shown_match->cp_str)
|
|
Karsten Hopp |
81c285 |
> curwin->w_cursor.col - compl_col))
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
ins_compl_addfrommatch();
|
|
Karsten Hopp |
81c285 |
--- 757,763 ----
|
|
Karsten Hopp |
81c285 |
* there is nothing to add, CTRL-L works like CTRL-P then. */
|
|
Karsten Hopp |
81c285 |
if (c == Ctrl_L
|
|
Karsten Hopp |
81c285 |
&& (ctrl_x_mode != CTRL_X_WHOLE_LINE
|
|
Karsten Hopp |
81c285 |
! || (int)STRLEN(compl_shown_match->cp_str)
|
|
Karsten Hopp |
81c285 |
> curwin->w_cursor.col - compl_col))
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
ins_compl_addfrommatch();
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 3837,3843 ****
|
|
Karsten Hopp |
81c285 |
--- 3837,3847 ----
|
|
Karsten Hopp |
81c285 |
char_u *word;
|
|
Karsten Hopp |
81c285 |
int icase = FALSE;
|
|
Karsten Hopp |
81c285 |
int adup = FALSE;
|
|
Karsten Hopp |
81c285 |
+ #ifdef S_SPLINT_S /* splint doesn't parse array of pointers correctly */
|
|
Karsten Hopp |
81c285 |
+ char_u **cptext;
|
|
Karsten Hopp |
81c285 |
+ #else
|
|
Karsten Hopp |
81c285 |
char_u *(cptext[CPT_COUNT]);
|
|
Karsten Hopp |
81c285 |
+ #endif
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 3994,4000 ****
|
|
Karsten Hopp |
81c285 |
else if (*e_cpt == ']' || *e_cpt == 't')
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
type = CTRL_X_TAGS;
|
|
Karsten Hopp |
81c285 |
! sprintf((char*)IObuff, _("Scanning tags."));
|
|
Karsten Hopp |
81c285 |
(void)msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R));
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
--- 3998,4004 ----
|
|
Karsten Hopp |
81c285 |
else if (*e_cpt == ']' || *e_cpt == 't')
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
type = CTRL_X_TAGS;
|
|
Karsten Hopp |
81c285 |
! vim_snprintf((char *)IObuff, IOSIZE, _("Scanning tags."));
|
|
Karsten Hopp |
81c285 |
(void)msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R));
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 4093,4099 ****
|
|
Karsten Hopp |
81c285 |
case CTRL_X_SPELL:
|
|
Karsten Hopp |
81c285 |
#ifdef FEAT_SPELL
|
|
Karsten Hopp |
81c285 |
num_matches = expand_spelling(first_match_pos.lnum,
|
|
Karsten Hopp |
81c285 |
! first_match_pos.col, compl_pattern, &matches);
|
|
Karsten Hopp |
81c285 |
if (num_matches > 0)
|
|
Karsten Hopp |
81c285 |
ins_compl_add_matches(num_matches, matches, p_ic);
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
--- 4097,4103 ----
|
|
Karsten Hopp |
81c285 |
case CTRL_X_SPELL:
|
|
Karsten Hopp |
81c285 |
#ifdef FEAT_SPELL
|
|
Karsten Hopp |
81c285 |
num_matches = expand_spelling(first_match_pos.lnum,
|
|
Karsten Hopp |
81c285 |
! compl_pattern, &matches);
|
|
Karsten Hopp |
81c285 |
if (num_matches > 0)
|
|
Karsten Hopp |
81c285 |
ins_compl_add_matches(num_matches, matches, p_ic);
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 4803,4812 ****
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
char_u *prefix = (char_u *)"\\<";
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! /* we need 3 extra chars, 1 for the NUL and
|
|
Karsten Hopp |
81c285 |
! * 2 >= strlen(prefix) -- Acevedo */
|
|
Karsten Hopp |
81c285 |
compl_pattern = alloc(quote_meta(NULL, line + compl_col,
|
|
Karsten Hopp |
81c285 |
! compl_length) + 3);
|
|
Karsten Hopp |
81c285 |
if (compl_pattern == NULL)
|
|
Karsten Hopp |
81c285 |
return FAIL;
|
|
Karsten Hopp |
81c285 |
if (!vim_iswordp(line + compl_col)
|
|
Karsten Hopp |
81c285 |
--- 4807,4815 ----
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
char_u *prefix = (char_u *)"\\<";
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! /* we need up to 2 extra chars for the prefix */
|
|
Karsten Hopp |
81c285 |
compl_pattern = alloc(quote_meta(NULL, line + compl_col,
|
|
Karsten Hopp |
81c285 |
! compl_length) + 2);
|
|
Karsten Hopp |
81c285 |
if (compl_pattern == NULL)
|
|
Karsten Hopp |
81c285 |
return FAIL;
|
|
Karsten Hopp |
81c285 |
if (!vim_iswordp(line + compl_col)
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 4881,4887 ****
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
compl_pattern = alloc(quote_meta(NULL, line + compl_col,
|
|
Karsten Hopp |
81c285 |
! compl_length) + 3);
|
|
Karsten Hopp |
81c285 |
if (compl_pattern == NULL)
|
|
Karsten Hopp |
81c285 |
return FAIL;
|
|
Karsten Hopp |
81c285 |
STRCPY((char *)compl_pattern, "\\<");
|
|
Karsten Hopp |
81c285 |
--- 4884,4890 ----
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
compl_pattern = alloc(quote_meta(NULL, line + compl_col,
|
|
Karsten Hopp |
81c285 |
! compl_length) + 2);
|
|
Karsten Hopp |
81c285 |
if (compl_pattern == NULL)
|
|
Karsten Hopp |
81c285 |
return FAIL;
|
|
Karsten Hopp |
81c285 |
STRCPY((char *)compl_pattern, "\\<");
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 4963,4969 ****
|
|
Karsten Hopp |
81c285 |
if (col < 0)
|
|
Karsten Hopp |
81c285 |
col = curs_col;
|
|
Karsten Hopp |
81c285 |
compl_col = col;
|
|
Karsten Hopp |
81c285 |
! if ((colnr_T)compl_col > curs_col)
|
|
Karsten Hopp |
81c285 |
compl_col = curs_col;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* Setup variables for completion. Need to obtain "line" again,
|
|
Karsten Hopp |
81c285 |
--- 4966,4972 ----
|
|
Karsten Hopp |
81c285 |
if (col < 0)
|
|
Karsten Hopp |
81c285 |
col = curs_col;
|
|
Karsten Hopp |
81c285 |
compl_col = col;
|
|
Karsten Hopp |
81c285 |
! if (compl_col > curs_col)
|
|
Karsten Hopp |
81c285 |
compl_col = curs_col;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* Setup variables for completion. Need to obtain "line" again,
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 5236,5250 ****
|
|
Karsten Hopp |
81c285 |
* a backslash) the metachars, and dest would be NUL terminated.
|
|
Karsten Hopp |
81c285 |
* Returns the length (needed) of dest
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
! static int
|
|
Karsten Hopp |
81c285 |
quote_meta(dest, src, len)
|
|
Karsten Hopp |
81c285 |
char_u *dest;
|
|
Karsten Hopp |
81c285 |
char_u *src;
|
|
Karsten Hopp |
81c285 |
int len;
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! int m;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! for (m = len; --len >= 0; src++)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
switch (*src)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
--- 5239,5253 ----
|
|
Karsten Hopp |
81c285 |
* a backslash) the metachars, and dest would be NUL terminated.
|
|
Karsten Hopp |
81c285 |
* Returns the length (needed) of dest
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
! static unsigned
|
|
Karsten Hopp |
81c285 |
quote_meta(dest, src, len)
|
|
Karsten Hopp |
81c285 |
char_u *dest;
|
|
Karsten Hopp |
81c285 |
char_u *src;
|
|
Karsten Hopp |
81c285 |
int len;
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! unsigned m = (unsigned)len + 1; /* one extra for the NUL */
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! for ( ; --len >= 0; src++)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
switch (*src)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 6073,6079 ****
|
|
Karsten Hopp |
81c285 |
* in 'formatoptions' and there is a single character before the cursor.
|
|
Karsten Hopp |
81c285 |
* Otherwise the line would be broken and when typing another non-white
|
|
Karsten Hopp |
81c285 |
* next they are not joined back together. */
|
|
Karsten Hopp |
81c285 |
! wasatend = (pos.col == STRLEN(old));
|
|
Karsten Hopp |
81c285 |
if (*old != NUL && !trailblank && wasatend)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
dec_cursor();
|
|
Karsten Hopp |
81c285 |
--- 6076,6082 ----
|
|
Karsten Hopp |
81c285 |
* in 'formatoptions' and there is a single character before the cursor.
|
|
Karsten Hopp |
81c285 |
* Otherwise the line would be broken and when typing another non-white
|
|
Karsten Hopp |
81c285 |
* next they are not joined back together. */
|
|
Karsten Hopp |
81c285 |
! wasatend = (pos.col == (colnr_T)STRLEN(old));
|
|
Karsten Hopp |
81c285 |
if (*old != NUL && !trailblank && wasatend)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
dec_cursor();
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 6250,6256 ****
|
|
Karsten Hopp |
81c285 |
* three digits. */
|
|
Karsten Hopp |
81c285 |
if (VIM_ISDIGIT(c))
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! sprintf((char *)buf, "%03d", c);
|
|
Karsten Hopp |
81c285 |
AppendToRedobuff(buf);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
--- 6253,6259 ----
|
|
Karsten Hopp |
81c285 |
* three digits. */
|
|
Karsten Hopp |
81c285 |
if (VIM_ISDIGIT(c))
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! vim_snprintf((char *)buf, sizeof(buf), "%03d", c);
|
|
Karsten Hopp |
81c285 |
AppendToRedobuff(buf);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 6453,6462 ****
|
|
Karsten Hopp |
81c285 |
* deleted characters. */
|
|
Karsten Hopp |
81c285 |
if (VIsual_active && VIsual.lnum == curwin->w_cursor.lnum)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! cc = (int)STRLEN(ml_get_curline());
|
|
Karsten Hopp |
81c285 |
! if (VIsual.col > (colnr_T)cc)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! VIsual.col = cc;
|
|
Karsten Hopp |
81c285 |
# ifdef FEAT_VIRTUALEDIT
|
|
Karsten Hopp |
81c285 |
VIsual.coladd = 0;
|
|
Karsten Hopp |
81c285 |
# endif
|
|
Karsten Hopp |
81c285 |
--- 6457,6467 ----
|
|
Karsten Hopp |
81c285 |
* deleted characters. */
|
|
Karsten Hopp |
81c285 |
if (VIsual_active && VIsual.lnum == curwin->w_cursor.lnum)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! int len = (int)STRLEN(ml_get_curline());
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! if (VIsual.col > len)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! VIsual.col = len;
|
|
Karsten Hopp |
81c285 |
# ifdef FEAT_VIRTUALEDIT
|
|
Karsten Hopp |
81c285 |
VIsual.coladd = 0;
|
|
Karsten Hopp |
81c285 |
# endif
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 8315,8320 ****
|
|
Karsten Hopp |
81c285 |
--- 8320,8326 ----
|
|
Karsten Hopp |
81c285 |
linenr_T lnum;
|
|
Karsten Hopp |
81c285 |
int cc;
|
|
Karsten Hopp |
81c285 |
int temp = 0; /* init for GCC */
|
|
Karsten Hopp |
81c285 |
+ colnr_T save_col;
|
|
Karsten Hopp |
81c285 |
colnr_T mincol;
|
|
Karsten Hopp |
81c285 |
int did_backspace = FALSE;
|
|
Karsten Hopp |
81c285 |
int in_indent;
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 8472,8484 ****
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
while (cc > 0)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! temp = curwin->w_cursor.col;
|
|
Karsten Hopp |
81c285 |
#ifdef FEAT_MBYTE
|
|
Karsten Hopp |
81c285 |
mb_replace_pop_ins(cc);
|
|
Karsten Hopp |
81c285 |
#else
|
|
Karsten Hopp |
81c285 |
ins_char(cc);
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
! curwin->w_cursor.col = temp;
|
|
Karsten Hopp |
81c285 |
cc = replace_pop();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
/* restore the characters that NL replaced */
|
|
Karsten Hopp |
81c285 |
--- 8478,8490 ----
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
while (cc > 0)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! save_col = curwin->w_cursor.col;
|
|
Karsten Hopp |
81c285 |
#ifdef FEAT_MBYTE
|
|
Karsten Hopp |
81c285 |
mb_replace_pop_ins(cc);
|
|
Karsten Hopp |
81c285 |
#else
|
|
Karsten Hopp |
81c285 |
ins_char(cc);
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
! curwin->w_cursor.col = save_col;
|
|
Karsten Hopp |
81c285 |
cc = replace_pop();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
/* restore the characters that NL replaced */
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 8510,8520 ****
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! temp = curwin->w_cursor.col;
|
|
Karsten Hopp |
81c285 |
beginline(BL_WHITE);
|
|
Karsten Hopp |
81c285 |
if (curwin->w_cursor.col < (colnr_T)temp)
|
|
Karsten Hopp |
81c285 |
mincol = curwin->w_cursor.col;
|
|
Karsten Hopp |
81c285 |
! curwin->w_cursor.col = temp;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
--- 8516,8526 ----
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! save_col = curwin->w_cursor.col;
|
|
Karsten Hopp |
81c285 |
beginline(BL_WHITE);
|
|
Karsten Hopp |
81c285 |
if (curwin->w_cursor.col < (colnr_T)temp)
|
|
Karsten Hopp |
81c285 |
mincol = curwin->w_cursor.col;
|
|
Karsten Hopp |
81c285 |
! curwin->w_cursor.col = save_col;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.168/src/ex_cmds.c 2009-05-13 12:46:36.000000000 +0200
|
|
Karsten Hopp |
81c285 |
--- src/ex_cmds.c 2009-05-13 18:24:18.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 87,99 ****
|
|
Karsten Hopp |
81c285 |
))
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
transchar_nonprint(buf3, c);
|
|
Karsten Hopp |
81c285 |
! sprintf(buf1, " <%s>", (char *)buf3);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
buf1[0] = NUL;
|
|
Karsten Hopp |
81c285 |
#ifndef EBCDIC
|
|
Karsten Hopp |
81c285 |
if (c >= 0x80)
|
|
Karsten Hopp |
81c285 |
! sprintf(buf2, " <M-%s>", transchar(c & 0x7f));
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
buf2[0] = NUL;
|
|
Karsten Hopp |
81c285 |
--- 87,100 ----
|
|
Karsten Hopp |
81c285 |
))
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
transchar_nonprint(buf3, c);
|
|
Karsten Hopp |
81c285 |
! vim_snprintf(buf1, sizeof(buf1), " <%s>", (char *)buf3);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
buf1[0] = NUL;
|
|
Karsten Hopp |
81c285 |
#ifndef EBCDIC
|
|
Karsten Hopp |
81c285 |
if (c >= 0x80)
|
|
Karsten Hopp |
81c285 |
! vim_snprintf(buf2, sizeof(buf2), " <M-%s>",
|
|
Karsten Hopp |
81c285 |
! (char *)transchar(c & 0x7f));
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
buf2[0] = NUL;
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 358,364 ****
|
|
Karsten Hopp |
81c285 |
linenr_T lnum;
|
|
Karsten Hopp |
81c285 |
long maxlen = 0;
|
|
Karsten Hopp |
81c285 |
sorti_T *nrs;
|
|
Karsten Hopp |
81c285 |
! size_t count = eap->line2 - eap->line1 + 1;
|
|
Karsten Hopp |
81c285 |
size_t i;
|
|
Karsten Hopp |
81c285 |
char_u *p;
|
|
Karsten Hopp |
81c285 |
char_u *s;
|
|
Karsten Hopp |
81c285 |
--- 359,365 ----
|
|
Karsten Hopp |
81c285 |
linenr_T lnum;
|
|
Karsten Hopp |
81c285 |
long maxlen = 0;
|
|
Karsten Hopp |
81c285 |
sorti_T *nrs;
|
|
Karsten Hopp |
81c285 |
! size_t count = (size_t)(eap->line2 - eap->line1 + 1);
|
|
Karsten Hopp |
81c285 |
size_t i;
|
|
Karsten Hopp |
81c285 |
char_u *p;
|
|
Karsten Hopp |
81c285 |
char_u *s;
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 957,963 ****
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
len += (int)STRLEN(prevcmd);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
! if ((t = alloc(len)) == NULL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
vim_free(newcmd);
|
|
Karsten Hopp |
81c285 |
return;
|
|
Karsten Hopp |
81c285 |
--- 958,964 ----
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
len += (int)STRLEN(prevcmd);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
! if ((t = alloc((unsigned)len)) == NULL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
vim_free(newcmd);
|
|
Karsten Hopp |
81c285 |
return;
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1548,1554 ****
|
|
Karsten Hopp |
81c285 |
* redirecting input and/or output.
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
if (itmp != NULL || otmp != NULL)
|
|
Karsten Hopp |
81c285 |
! sprintf((char *)buf, "(%s)", (char *)cmd);
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
STRCPY(buf, cmd);
|
|
Karsten Hopp |
81c285 |
if (itmp != NULL)
|
|
Karsten Hopp |
81c285 |
--- 1549,1555 ----
|
|
Karsten Hopp |
81c285 |
* redirecting input and/or output.
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
if (itmp != NULL || otmp != NULL)
|
|
Karsten Hopp |
81c285 |
! vim_snprintf((char *)buf, len, "(%s)", (char *)cmd);
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
STRCPY(buf, cmd);
|
|
Karsten Hopp |
81c285 |
if (itmp != NULL)
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1597,1633 ****
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
if (otmp != NULL)
|
|
Karsten Hopp |
81c285 |
! append_redir(buf, p_srr, otmp);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
return buf;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
! * Append output redirection for file "fname" to the end of string buffer "buf"
|
|
Karsten Hopp |
81c285 |
* Works with the 'shellredir' and 'shellpipe' options.
|
|
Karsten Hopp |
81c285 |
* The caller should make sure that there is enough room:
|
|
Karsten Hopp |
81c285 |
* STRLEN(opt) + STRLEN(fname) + 3
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
void
|
|
Karsten Hopp |
81c285 |
! append_redir(buf, opt, fname)
|
|
Karsten Hopp |
81c285 |
char_u *buf;
|
|
Karsten Hopp |
81c285 |
char_u *opt;
|
|
Karsten Hopp |
81c285 |
char_u *fname;
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
char_u *p;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! buf += STRLEN(buf);
|
|
Karsten Hopp |
81c285 |
/* find "%s", skipping "%%" */
|
|
Karsten Hopp |
81c285 |
for (p = opt; (p = vim_strchr(p, '%')) != NULL; ++p)
|
|
Karsten Hopp |
81c285 |
if (p[1] == 's')
|
|
Karsten Hopp |
81c285 |
break;
|
|
Karsten Hopp |
81c285 |
if (p != NULL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! *buf = ' '; /* not really needed? Not with sh, ksh or bash */
|
|
Karsten Hopp |
81c285 |
! sprintf((char *)buf + 1, (char *)opt, (char *)fname);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
! sprintf((char *)buf,
|
|
Karsten Hopp |
81c285 |
#ifdef FEAT_QUICKFIX
|
|
Karsten Hopp |
81c285 |
# ifndef RISCOS
|
|
Karsten Hopp |
81c285 |
opt != p_sp ? " %s%s" :
|
|
Karsten Hopp |
81c285 |
--- 1598,1638 ----
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
if (otmp != NULL)
|
|
Karsten Hopp |
81c285 |
! append_redir(buf, (int)len, p_srr, otmp);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
return buf;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
! * Append output redirection for file "fname" to the end of string buffer
|
|
Karsten Hopp |
81c285 |
! * "buf[buflen]"
|
|
Karsten Hopp |
81c285 |
* Works with the 'shellredir' and 'shellpipe' options.
|
|
Karsten Hopp |
81c285 |
* The caller should make sure that there is enough room:
|
|
Karsten Hopp |
81c285 |
* STRLEN(opt) + STRLEN(fname) + 3
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
void
|
|
Karsten Hopp |
81c285 |
! append_redir(buf, buflen, opt, fname)
|
|
Karsten Hopp |
81c285 |
char_u *buf;
|
|
Karsten Hopp |
81c285 |
+ int buflen;
|
|
Karsten Hopp |
81c285 |
char_u *opt;
|
|
Karsten Hopp |
81c285 |
char_u *fname;
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
char_u *p;
|
|
Karsten Hopp |
81c285 |
+ char_u *end;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! end = buf + STRLEN(buf);
|
|
Karsten Hopp |
81c285 |
/* find "%s", skipping "%%" */
|
|
Karsten Hopp |
81c285 |
for (p = opt; (p = vim_strchr(p, '%')) != NULL; ++p)
|
|
Karsten Hopp |
81c285 |
if (p[1] == 's')
|
|
Karsten Hopp |
81c285 |
break;
|
|
Karsten Hopp |
81c285 |
if (p != NULL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! *end = ' '; /* not really needed? Not with sh, ksh or bash */
|
|
Karsten Hopp |
81c285 |
! vim_snprintf((char *)end + 1, (size_t)(buflen - (end + 1 - buf)),
|
|
Karsten Hopp |
81c285 |
! (char *)opt, (char *)fname);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
! vim_snprintf((char *)end, (size_t)(buflen - (end - buf)),
|
|
Karsten Hopp |
81c285 |
#ifdef FEAT_QUICKFIX
|
|
Karsten Hopp |
81c285 |
# ifndef RISCOS
|
|
Karsten Hopp |
81c285 |
opt != p_sp ? " %s%s" :
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 2390,2396 ****
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
if (curwin->w_p_nu || use_number)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! sprintf((char *)numbuf, "%*ld ", number_width(curwin), (long)lnum);
|
|
Karsten Hopp |
81c285 |
msg_puts_attr(numbuf, hl_attr(HLF_N)); /* Highlight line nrs */
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
msg_prt_line(ml_get(lnum), list);
|
|
Karsten Hopp |
81c285 |
--- 2395,2402 ----
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
if (curwin->w_p_nu || use_number)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! vim_snprintf((char *)numbuf, sizeof(numbuf),
|
|
Karsten Hopp |
81c285 |
! "%*ld ", number_width(curwin), (long)lnum);
|
|
Karsten Hopp |
81c285 |
msg_puts_attr(numbuf, hl_attr(HLF_N)); /* Highlight line nrs */
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
msg_prt_line(ml_get(lnum), list);
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 4486,4492 ****
|
|
Karsten Hopp |
81c285 |
char_u *p1;
|
|
Karsten Hopp |
81c285 |
int did_sub = FALSE;
|
|
Karsten Hopp |
81c285 |
int lastone;
|
|
Karsten Hopp |
81c285 |
! unsigned len, needed_len;
|
|
Karsten Hopp |
81c285 |
long nmatch_tl = 0; /* nr of lines matched below lnum */
|
|
Karsten Hopp |
81c285 |
int do_again; /* do it again after joining lines */
|
|
Karsten Hopp |
81c285 |
int skip_match = FALSE;
|
|
Karsten Hopp |
81c285 |
--- 4492,4498 ----
|
|
Karsten Hopp |
81c285 |
char_u *p1;
|
|
Karsten Hopp |
81c285 |
int did_sub = FALSE;
|
|
Karsten Hopp |
81c285 |
int lastone;
|
|
Karsten Hopp |
81c285 |
! int len, copy_len, needed_len;
|
|
Karsten Hopp |
81c285 |
long nmatch_tl = 0; /* nr of lines matched below lnum */
|
|
Karsten Hopp |
81c285 |
int do_again; /* do it again after joining lines */
|
|
Karsten Hopp |
81c285 |
int skip_match = FALSE;
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 4631,4636 ****
|
|
Karsten Hopp |
81c285 |
--- 4637,4644 ----
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
if (do_ask)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
+ int typed;
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
/* change State to CONFIRM, so that the mouse works
|
|
Karsten Hopp |
81c285 |
* properly */
|
|
Karsten Hopp |
81c285 |
save_State = State;
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 4669,4675 ****
|
|
Karsten Hopp |
81c285 |
resp = getexmodeline('?', NULL, 0);
|
|
Karsten Hopp |
81c285 |
if (resp != NULL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! i = *resp;
|
|
Karsten Hopp |
81c285 |
vim_free(resp);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
--- 4677,4683 ----
|
|
Karsten Hopp |
81c285 |
resp = getexmodeline('?', NULL, 0);
|
|
Karsten Hopp |
81c285 |
if (resp != NULL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! typed = *resp;
|
|
Karsten Hopp |
81c285 |
vim_free(resp);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 4721,4727 ****
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
++no_mapping; /* don't map this key */
|
|
Karsten Hopp |
81c285 |
++allow_keys; /* allow special keys */
|
|
Karsten Hopp |
81c285 |
! i = plain_vgetc();
|
|
Karsten Hopp |
81c285 |
--allow_keys;
|
|
Karsten Hopp |
81c285 |
--no_mapping;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--- 4729,4735 ----
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
++no_mapping; /* don't map this key */
|
|
Karsten Hopp |
81c285 |
++allow_keys; /* allow special keys */
|
|
Karsten Hopp |
81c285 |
! typed = plain_vgetc();
|
|
Karsten Hopp |
81c285 |
--allow_keys;
|
|
Karsten Hopp |
81c285 |
--no_mapping;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 4732,4766 ****
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
need_wait_return = FALSE; /* no hit-return prompt */
|
|
Karsten Hopp |
81c285 |
! if (i == 'q' || i == ESC || i == Ctrl_C
|
|
Karsten Hopp |
81c285 |
#ifdef UNIX
|
|
Karsten Hopp |
81c285 |
! || i == intr_char
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
got_quit = TRUE;
|
|
Karsten Hopp |
81c285 |
break;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
! if (i == 'n')
|
|
Karsten Hopp |
81c285 |
break;
|
|
Karsten Hopp |
81c285 |
! if (i == 'y')
|
|
Karsten Hopp |
81c285 |
break;
|
|
Karsten Hopp |
81c285 |
! if (i == 'l')
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
/* last: replace and then stop */
|
|
Karsten Hopp |
81c285 |
do_all = FALSE;
|
|
Karsten Hopp |
81c285 |
line2 = lnum;
|
|
Karsten Hopp |
81c285 |
break;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
! if (i == 'a')
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
do_ask = FALSE;
|
|
Karsten Hopp |
81c285 |
break;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
#ifdef FEAT_INS_EXPAND
|
|
Karsten Hopp |
81c285 |
! if (i == Ctrl_E)
|
|
Karsten Hopp |
81c285 |
scrollup_clamp();
|
|
Karsten Hopp |
81c285 |
! else if (i == Ctrl_Y)
|
|
Karsten Hopp |
81c285 |
scrolldown_clamp();
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
--- 4740,4774 ----
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
need_wait_return = FALSE; /* no hit-return prompt */
|
|
Karsten Hopp |
81c285 |
! if (typed == 'q' || typed == ESC || typed == Ctrl_C
|
|
Karsten Hopp |
81c285 |
#ifdef UNIX
|
|
Karsten Hopp |
81c285 |
! || typed == intr_char
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
got_quit = TRUE;
|
|
Karsten Hopp |
81c285 |
break;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
! if (typed == 'n')
|
|
Karsten Hopp |
81c285 |
break;
|
|
Karsten Hopp |
81c285 |
! if (typed == 'y')
|
|
Karsten Hopp |
81c285 |
break;
|
|
Karsten Hopp |
81c285 |
! if (typed == 'l')
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
/* last: replace and then stop */
|
|
Karsten Hopp |
81c285 |
do_all = FALSE;
|
|
Karsten Hopp |
81c285 |
line2 = lnum;
|
|
Karsten Hopp |
81c285 |
break;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
! if (typed == 'a')
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
do_ask = FALSE;
|
|
Karsten Hopp |
81c285 |
break;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
#ifdef FEAT_INS_EXPAND
|
|
Karsten Hopp |
81c285 |
! if (typed == Ctrl_E)
|
|
Karsten Hopp |
81c285 |
scrollup_clamp();
|
|
Karsten Hopp |
81c285 |
! else if (typed == Ctrl_Y)
|
|
Karsten Hopp |
81c285 |
scrolldown_clamp();
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 4771,4777 ****
|
|
Karsten Hopp |
81c285 |
if (vim_strchr(p_cpo, CPO_UNDO) != NULL)
|
|
Karsten Hopp |
81c285 |
--no_u_sync;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! if (i == 'n')
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
/* For a multi-line match, put matchcol at the NUL at
|
|
Karsten Hopp |
81c285 |
* the end of the line and set nmatch to one, so that
|
|
Karsten Hopp |
81c285 |
--- 4779,4785 ----
|
|
Karsten Hopp |
81c285 |
if (vim_strchr(p_cpo, CPO_UNDO) != NULL)
|
|
Karsten Hopp |
81c285 |
--no_u_sync;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! if (typed == 'n')
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
/* For a multi-line match, put matchcol at the NUL at
|
|
Karsten Hopp |
81c285 |
* the end of the line and set nmatch to one, so that
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 4822,4830 ****
|
|
Karsten Hopp |
81c285 |
p1 = ml_get(sub_firstlnum + nmatch - 1);
|
|
Karsten Hopp |
81c285 |
nmatch_tl += nmatch - 1;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
! i = regmatch.startpos[0].col - copycol;
|
|
Karsten Hopp |
81c285 |
! needed_len = i + ((unsigned)STRLEN(p1) - regmatch.endpos[0].col)
|
|
Karsten Hopp |
81c285 |
! + sublen + 1;
|
|
Karsten Hopp |
81c285 |
if (new_start == NULL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
--- 4830,4838 ----
|
|
Karsten Hopp |
81c285 |
p1 = ml_get(sub_firstlnum + nmatch - 1);
|
|
Karsten Hopp |
81c285 |
nmatch_tl += nmatch - 1;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
! copy_len = regmatch.startpos[0].col - copycol;
|
|
Karsten Hopp |
81c285 |
! needed_len = copy_len + ((unsigned)STRLEN(p1)
|
|
Karsten Hopp |
81c285 |
! - regmatch.endpos[0].col) + sublen + 1;
|
|
Karsten Hopp |
81c285 |
if (new_start == NULL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 4847,4853 ****
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
len = (unsigned)STRLEN(new_start);
|
|
Karsten Hopp |
81c285 |
needed_len += len;
|
|
Karsten Hopp |
81c285 |
! if (needed_len > new_start_len)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
new_start_len = needed_len + 50;
|
|
Karsten Hopp |
81c285 |
if ((p1 = alloc_check(new_start_len)) == NULL)
|
|
Karsten Hopp |
81c285 |
--- 4855,4861 ----
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
len = (unsigned)STRLEN(new_start);
|
|
Karsten Hopp |
81c285 |
needed_len += len;
|
|
Karsten Hopp |
81c285 |
! if (needed_len > (int)new_start_len)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
new_start_len = needed_len + 50;
|
|
Karsten Hopp |
81c285 |
if ((p1 = alloc_check(new_start_len)) == NULL)
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 4865,4872 ****
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
* copy the text up to the part that matched
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
! mch_memmove(new_end, sub_firstline + copycol, (size_t)i);
|
|
Karsten Hopp |
81c285 |
! new_end += i;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
(void)vim_regsub_multi(®match,
|
|
Karsten Hopp |
81c285 |
sub_firstlnum - regmatch.startpos[0].lnum,
|
|
Karsten Hopp |
81c285 |
--- 4873,4880 ----
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
* copy the text up to the part that matched
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
! mch_memmove(new_end, sub_firstline + copycol, (size_t)copy_len);
|
|
Karsten Hopp |
81c285 |
! new_end += copy_len;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
(void)vim_regsub_multi(®match,
|
|
Karsten Hopp |
81c285 |
sub_firstlnum - regmatch.startpos[0].lnum,
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 5768,5773 ****
|
|
Karsten Hopp |
81c285 |
--- 5776,5785 ----
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
char_u *s, *d;
|
|
Karsten Hopp |
81c285 |
int i;
|
|
Karsten Hopp |
81c285 |
+ #ifdef S_SPLINT_S /* splint doesn't understand array of pointers */
|
|
Karsten Hopp |
81c285 |
+ static char **mtable;
|
|
Karsten Hopp |
81c285 |
+ static char **rtable;
|
|
Karsten Hopp |
81c285 |
+ #else
|
|
Karsten Hopp |
81c285 |
static char *(mtable[]) = {"*", "g*", "[*", "]*", ":*",
|
|
Karsten Hopp |
81c285 |
"/*", "/\\*", "\"*", "**",
|
|
Karsten Hopp |
81c285 |
"/\\(\\)",
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 5782,5787 ****
|
|
Karsten Hopp |
81c285 |
--- 5794,5800 ----
|
|
Karsten Hopp |
81c285 |
"/\\\\?", "/\\\\z(\\\\)", "\\\\=", ":s\\\\=",
|
|
Karsten Hopp |
81c285 |
"\\[count]", "\\[quotex]", "\\[range]",
|
|
Karsten Hopp |
81c285 |
"\\[pattern]", "\\\\bar", "/\\\\%\\$"};
|
|
Karsten Hopp |
81c285 |
+ #endif
|
|
Karsten Hopp |
81c285 |
int flags;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
d = IObuff; /* assume IObuff is long enough! */
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 5790,5796 ****
|
|
Karsten Hopp |
81c285 |
* Recognize a few exceptions to the rule. Some strings that contain '*'
|
|
Karsten Hopp |
81c285 |
* with "star". Otherwise '*' is recognized as a wildcard.
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
! for (i = sizeof(mtable) / sizeof(char *); --i >= 0; )
|
|
Karsten Hopp |
81c285 |
if (STRCMP(arg, mtable[i]) == 0)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
STRCPY(d, rtable[i]);
|
|
Karsten Hopp |
81c285 |
--- 5803,5809 ----
|
|
Karsten Hopp |
81c285 |
* Recognize a few exceptions to the rule. Some strings that contain '*'
|
|
Karsten Hopp |
81c285 |
* with "star". Otherwise '*' is recognized as a wildcard.
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
! for (i = (int)(sizeof(mtable) / sizeof(char *)); --i >= 0; )
|
|
Karsten Hopp |
81c285 |
if (STRCMP(arg, mtable[i]) == 0)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
STRCPY(d, rtable[i]);
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.168/src/ex_cmds2.c 2009-02-05 20:47:14.000000000 +0100
|
|
Karsten Hopp |
81c285 |
--- src/ex_cmds2.c 2009-05-13 16:22:33.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 3373,3379 ****
|
|
Karsten Hopp |
81c285 |
p = skipwhite(sp->nextline);
|
|
Karsten Hopp |
81c285 |
if (*p != '\\')
|
|
Karsten Hopp |
81c285 |
break;
|
|
Karsten Hopp |
81c285 |
! s = alloc((int)(STRLEN(line) + STRLEN(p)));
|
|
Karsten Hopp |
81c285 |
if (s == NULL) /* out of memory */
|
|
Karsten Hopp |
81c285 |
break;
|
|
Karsten Hopp |
81c285 |
STRCPY(s, line);
|
|
Karsten Hopp |
81c285 |
--- 3373,3379 ----
|
|
Karsten Hopp |
81c285 |
p = skipwhite(sp->nextline);
|
|
Karsten Hopp |
81c285 |
if (*p != '\\')
|
|
Karsten Hopp |
81c285 |
break;
|
|
Karsten Hopp |
81c285 |
! s = alloc((unsigned)(STRLEN(line) + STRLEN(p)));
|
|
Karsten Hopp |
81c285 |
if (s == NULL) /* out of memory */
|
|
Karsten Hopp |
81c285 |
break;
|
|
Karsten Hopp |
81c285 |
STRCPY(s, line);
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.168/src/ex_docmd.c 2009-04-29 18:44:38.000000000 +0200
|
|
Karsten Hopp |
81c285 |
--- src/ex_docmd.c 2009-05-13 17:56:44.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 2737,2743 ****
|
|
Karsten Hopp |
81c285 |
int i;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
for (i = 0; cmd[i] != NUL; ++i)
|
|
Karsten Hopp |
81c285 |
! if (cmd[i] != (*pp)[i])
|
|
Karsten Hopp |
81c285 |
break;
|
|
Karsten Hopp |
81c285 |
if (i >= len && !isalpha((*pp)[i]))
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
--- 2737,2743 ----
|
|
Karsten Hopp |
81c285 |
int i;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
for (i = 0; cmd[i] != NUL; ++i)
|
|
Karsten Hopp |
81c285 |
! if (((char_u *)cmd)[i] != (*pp)[i])
|
|
Karsten Hopp |
81c285 |
break;
|
|
Karsten Hopp |
81c285 |
if (i >= len && !isalpha((*pp)[i]))
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 2803,2809 ****
|
|
Karsten Hopp |
81c285 |
/* Check for ":dl", ":dell", etc. to ":deletel": that's
|
|
Karsten Hopp |
81c285 |
* :delete with the 'l' flag. Same for 'p'. */
|
|
Karsten Hopp |
81c285 |
for (i = 0; i < len; ++i)
|
|
Karsten Hopp |
81c285 |
! if (eap->cmd[i] != "delete"[i])
|
|
Karsten Hopp |
81c285 |
break;
|
|
Karsten Hopp |
81c285 |
if (i == len - 1)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
--- 2803,2809 ----
|
|
Karsten Hopp |
81c285 |
/* Check for ":dl", ":dell", etc. to ":deletel": that's
|
|
Karsten Hopp |
81c285 |
* :delete with the 'l' flag. Same for 'p'. */
|
|
Karsten Hopp |
81c285 |
for (i = 0; i < len; ++i)
|
|
Karsten Hopp |
81c285 |
! if (eap->cmd[i] != ((char_u *)"delete")[i])
|
|
Karsten Hopp |
81c285 |
break;
|
|
Karsten Hopp |
81c285 |
if (i == len - 1)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 3823,3829 ****
|
|
Karsten Hopp |
81c285 |
char_u *cmd;
|
|
Karsten Hopp |
81c285 |
int *ctx; /* pointer to xp_context or NULL */
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! int delim;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
while (vim_strchr((char_u *)" \t0123456789.$%'/?-+,;", *cmd) != NULL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
--- 3823,3829 ----
|
|
Karsten Hopp |
81c285 |
char_u *cmd;
|
|
Karsten Hopp |
81c285 |
int *ctx; /* pointer to xp_context or NULL */
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! unsigned delim;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
while (vim_strchr((char_u *)" \t0123456789.$%'/?-+,;", *cmd) != NULL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 9417,9423 ****
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
int len;
|
|
Karsten Hopp |
81c285 |
int i;
|
|
Karsten Hopp |
81c285 |
! static char *(spec_str[]) = {
|
|
Karsten Hopp |
81c285 |
"%",
|
|
Karsten Hopp |
81c285 |
#define SPEC_PERC 0
|
|
Karsten Hopp |
81c285 |
"#",
|
|
Karsten Hopp |
81c285 |
--- 9417,9429 ----
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
int len;
|
|
Karsten Hopp |
81c285 |
int i;
|
|
Karsten Hopp |
81c285 |
! #ifdef S_SPLINT_S /* splint can't handle array of pointers */
|
|
Karsten Hopp |
81c285 |
! static char **spec_str;
|
|
Karsten Hopp |
81c285 |
! static char *(nospec_str[])
|
|
Karsten Hopp |
81c285 |
! #else
|
|
Karsten Hopp |
81c285 |
! static char *(spec_str[])
|
|
Karsten Hopp |
81c285 |
! #endif
|
|
Karsten Hopp |
81c285 |
! = {
|
|
Karsten Hopp |
81c285 |
"%",
|
|
Karsten Hopp |
81c285 |
#define SPEC_PERC 0
|
|
Karsten Hopp |
81c285 |
"#",
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 9443,9451 ****
|
|
Karsten Hopp |
81c285 |
# define SPEC_CLIENT 9
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
};
|
|
Karsten Hopp |
81c285 |
- #define SPEC_COUNT (sizeof(spec_str) / sizeof(char *))
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! for (i = 0; i < SPEC_COUNT; ++i)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
len = (int)STRLEN(spec_str[i]);
|
|
Karsten Hopp |
81c285 |
if (STRNCMP(src, spec_str[i], len) == 0)
|
|
Karsten Hopp |
81c285 |
--- 9449,9456 ----
|
|
Karsten Hopp |
81c285 |
# define SPEC_CLIENT 9
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
};
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! for (i = 0; i < (int)(sizeof(spec_str) / sizeof(char *)); ++i)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
len = (int)STRLEN(spec_str[i]);
|
|
Karsten Hopp |
81c285 |
if (STRNCMP(src, spec_str[i], len) == 0)
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 9796,9802 ****
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* allocate memory */
|
|
Karsten Hopp |
81c285 |
! retval = alloc(len + 1);
|
|
Karsten Hopp |
81c285 |
if (retval == NULL)
|
|
Karsten Hopp |
81c285 |
break;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
--- 9801,9807 ----
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* allocate memory */
|
|
Karsten Hopp |
81c285 |
! retval = alloc((unsigned)len + 1);
|
|
Karsten Hopp |
81c285 |
if (retval == NULL)
|
|
Karsten Hopp |
81c285 |
break;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.168/src/proto/ex_cmds.pro 2009-04-29 18:44:38.000000000 +0200
|
|
Karsten Hopp |
81c285 |
--- src/proto/ex_cmds.pro 2009-05-13 15:53:39.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 9,15 ****
|
|
Karsten Hopp |
81c285 |
void do_bang __ARGS((int addr_count, exarg_T *eap, int forceit, int do_in, int do_out));
|
|
Karsten Hopp |
81c285 |
void do_shell __ARGS((char_u *cmd, int flags));
|
|
Karsten Hopp |
81c285 |
char_u *make_filter_cmd __ARGS((char_u *cmd, char_u *itmp, char_u *otmp));
|
|
Karsten Hopp |
81c285 |
! void append_redir __ARGS((char_u *buf, char_u *opt, char_u *fname));
|
|
Karsten Hopp |
81c285 |
int viminfo_error __ARGS((char *errnum, char *message, char_u *line));
|
|
Karsten Hopp |
81c285 |
int read_viminfo __ARGS((char_u *file, int flags));
|
|
Karsten Hopp |
81c285 |
void write_viminfo __ARGS((char_u *file, int forceit));
|
|
Karsten Hopp |
81c285 |
--- 9,15 ----
|
|
Karsten Hopp |
81c285 |
void do_bang __ARGS((int addr_count, exarg_T *eap, int forceit, int do_in, int do_out));
|
|
Karsten Hopp |
81c285 |
void do_shell __ARGS((char_u *cmd, int flags));
|
|
Karsten Hopp |
81c285 |
char_u *make_filter_cmd __ARGS((char_u *cmd, char_u *itmp, char_u *otmp));
|
|
Karsten Hopp |
81c285 |
! void append_redir __ARGS((char_u *buf, int buflen, char_u *opt, char_u *fname));
|
|
Karsten Hopp |
81c285 |
int viminfo_error __ARGS((char *errnum, char *message, char_u *line));
|
|
Karsten Hopp |
81c285 |
int read_viminfo __ARGS((char_u *file, int flags));
|
|
Karsten Hopp |
81c285 |
void write_viminfo __ARGS((char_u *file, int forceit));
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.168/src/proto/spell.pro 2007-05-05 19:19:19.000000000 +0200
|
|
Karsten Hopp |
81c285 |
--- src/proto/spell.pro 2009-05-13 16:43:13.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 22,26 ****
|
|
Karsten Hopp |
81c285 |
char_u *spell_to_word_end __ARGS((char_u *start, buf_T *buf));
|
|
Karsten Hopp |
81c285 |
int spell_word_start __ARGS((int startcol));
|
|
Karsten Hopp |
81c285 |
void spell_expand_check_cap __ARGS((colnr_T col));
|
|
Karsten Hopp |
81c285 |
! int expand_spelling __ARGS((linenr_T lnum, int col, char_u *pat, char_u ***matchp));
|
|
Karsten Hopp |
81c285 |
/* vim: set ft=c : */
|
|
Karsten Hopp |
81c285 |
--- 22,26 ----
|
|
Karsten Hopp |
81c285 |
char_u *spell_to_word_end __ARGS((char_u *start, buf_T *buf));
|
|
Karsten Hopp |
81c285 |
int spell_word_start __ARGS((int startcol));
|
|
Karsten Hopp |
81c285 |
void spell_expand_check_cap __ARGS((colnr_T col));
|
|
Karsten Hopp |
81c285 |
! int expand_spelling __ARGS((linenr_T lnum, char_u *pat, char_u ***matchp));
|
|
Karsten Hopp |
81c285 |
/* vim: set ft=c : */
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.168/src/quickfix.c 2009-04-29 11:49:57.000000000 +0200
|
|
Karsten Hopp |
81c285 |
--- src/quickfix.c 2009-05-13 15:53:18.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 2774,2780 ****
|
|
Karsten Hopp |
81c285 |
sprintf((char *)cmd, "%s%s%s", (char *)p_shq, (char *)eap->arg,
|
|
Karsten Hopp |
81c285 |
(char *)p_shq);
|
|
Karsten Hopp |
81c285 |
if (*p_sp != NUL)
|
|
Karsten Hopp |
81c285 |
! append_redir(cmd, p_sp, fname);
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
* Output a newline if there's something else than the :make command that
|
|
Karsten Hopp |
81c285 |
* was typed (in which case the cursor is in column 0).
|
|
Karsten Hopp |
81c285 |
--- 2774,2780 ----
|
|
Karsten Hopp |
81c285 |
sprintf((char *)cmd, "%s%s%s", (char *)p_shq, (char *)eap->arg,
|
|
Karsten Hopp |
81c285 |
(char *)p_shq);
|
|
Karsten Hopp |
81c285 |
if (*p_sp != NUL)
|
|
Karsten Hopp |
81c285 |
! append_redir(cmd, len, p_sp, fname);
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
* Output a newline if there's something else than the :make command that
|
|
Karsten Hopp |
81c285 |
* was typed (in which case the cursor is in column 0).
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.168/src/spell.c 2009-02-11 17:57:43.000000000 +0100
|
|
Karsten Hopp |
81c285 |
--- src/spell.c 2009-05-13 16:31:15.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 16151,16161 ****
|
|
Karsten Hopp |
81c285 |
* Returns the number of matches. The matches are in "matchp[]", array of
|
|
Karsten Hopp |
81c285 |
* allocated strings.
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
- /*ARGSUSED*/
|
|
Karsten Hopp |
81c285 |
int
|
|
Karsten Hopp |
81c285 |
! expand_spelling(lnum, col, pat, matchp)
|
|
Karsten Hopp |
81c285 |
linenr_T lnum;
|
|
Karsten Hopp |
81c285 |
- int col;
|
|
Karsten Hopp |
81c285 |
char_u *pat;
|
|
Karsten Hopp |
81c285 |
char_u ***matchp;
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
--- 16151,16159 ----
|
|
Karsten Hopp |
81c285 |
* Returns the number of matches. The matches are in "matchp[]", array of
|
|
Karsten Hopp |
81c285 |
* allocated strings.
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
int
|
|
Karsten Hopp |
81c285 |
! expand_spelling(lnum, pat, matchp)
|
|
Karsten Hopp |
81c285 |
linenr_T lnum;
|
|
Karsten Hopp |
81c285 |
char_u *pat;
|
|
Karsten Hopp |
81c285 |
char_u ***matchp;
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.168/src/structs.h 2009-05-13 12:46:36.000000000 +0200
|
|
Karsten Hopp |
81c285 |
--- src/structs.h 2009-05-13 16:45:51.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 16,22 ****
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
#if defined(SASC) && SASC < 658
|
|
Karsten Hopp |
81c285 |
typedef long linenr_T;
|
|
Karsten Hopp |
81c285 |
! typedef unsigned colnr_T;
|
|
Karsten Hopp |
81c285 |
typedef unsigned short short_u;
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--- 16,22 ----
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
#if defined(SASC) && SASC < 658
|
|
Karsten Hopp |
81c285 |
typedef long linenr_T;
|
|
Karsten Hopp |
81c285 |
! typedef int colnr_T;
|
|
Karsten Hopp |
81c285 |
typedef unsigned short short_u;
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.168/src/term.h 2005-03-16 10:53:56.000000000 +0100
|
|
Karsten Hopp |
81c285 |
--- src/term.h 2009-05-13 17:27:41.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 96,102 ****
|
|
Karsten Hopp |
81c285 |
--- 96,106 ----
|
|
Karsten Hopp |
81c285 |
* - there should be code in term.c to obtain the value from the termcap
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
+ #ifdef S_SPLINT_S /* splint doesn't understand array of pointers */
|
|
Karsten Hopp |
81c285 |
+ extern char_u **term_strings; /* current terminal strings */
|
|
Karsten Hopp |
81c285 |
+ #else
|
|
Karsten Hopp |
81c285 |
extern char_u *(term_strings[]); /* current terminal strings */
|
|
Karsten Hopp |
81c285 |
+ #endif
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
* strings used for terminal
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.168/src/vim.h 2009-04-29 18:44:38.000000000 +0200
|
|
Karsten Hopp |
81c285 |
--- src/vim.h 2009-05-13 16:45:39.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1460,1467 ****
|
|
Karsten Hopp |
81c285 |
# define PERROR(msg) perror(msg)
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! typedef long linenr_T; /* line number type */
|
|
Karsten Hopp |
81c285 |
! typedef unsigned colnr_T; /* column number type */
|
|
Karsten Hopp |
81c285 |
typedef unsigned short disptick_T; /* display tick type */
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
#define MAXLNUM (0x7fffffffL) /* maximum (invalid) line number */
|
|
Karsten Hopp |
81c285 |
--- 1460,1467 ----
|
|
Karsten Hopp |
81c285 |
# define PERROR(msg) perror(msg)
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! typedef long linenr_T; /* line number type */
|
|
Karsten Hopp |
81c285 |
! typedef int colnr_T; /* column number type */
|
|
Karsten Hopp |
81c285 |
typedef unsigned short disptick_T; /* display tick type */
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
#define MAXLNUM (0x7fffffffL) /* maximum (invalid) line number */
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.168/src/version.c 2009-05-13 14:48:55.000000000 +0200
|
|
Karsten Hopp |
81c285 |
--- src/version.c 2009-05-13 18:44:28.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 678,679 ****
|
|
Karsten Hopp |
81c285 |
--- 678,681 ----
|
|
Karsten Hopp |
81c285 |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
81c285 |
+ /**/
|
|
Karsten Hopp |
81c285 |
+ 169,
|
|
Karsten Hopp |
81c285 |
/**/
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--
|
|
Karsten Hopp |
81c285 |
Females are strictly forbidden to appear unshaven in public.
|
|
Karsten Hopp |
81c285 |
[real standing law in New Mexico, United States of America]
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
81c285 |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
81c285 |
\\\ download, build and distribute -- http://www.A-A-P.org ///
|
|
Karsten Hopp |
81c285 |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|