Compare commits

...

11 Commits

Author SHA1 Message Date
Bram Moolenaar
db867d50ba updated for version 7.2-091 2009-01-28 15:04:42 +00:00
Bram Moolenaar
a850a711fa updated for version 7.2-090 2009-01-28 14:42:59 +00:00
Bram Moolenaar
370feaf87f updated for version 7.2-089 2009-01-28 13:18:26 +00:00
Bram Moolenaar
282937bc56 updated for version 7.2-088 2009-01-22 20:50:10 +00:00
Bram Moolenaar
6bab9fa19a updated for version 7.2-087 2009-01-22 20:32:12 +00:00
Bram Moolenaar
5cc6a6e739 updated for version 7.2-086 2009-01-22 19:48:55 +00:00
Bram Moolenaar
6768a3305a updated for version 7.2-085 2009-01-22 17:33:49 +00:00
Bram Moolenaar
d72b386a63 updated for version 7.2-084 2009-01-13 17:11:05 +00:00
Bram Moolenaar
51460cd634 updated for version 7.2-083 2009-01-13 16:28:21 +00:00
Bram Moolenaar
1418a0d586 updated for version 7.2-082 2009-01-13 15:58:01 +00:00
Bram Moolenaar
c937213e08 updated for version 7.2-081 2009-01-13 15:38:37 +00:00
13 changed files with 162 additions and 30 deletions

View File

@@ -8,7 +8,7 @@
*/
/*
* diff.c: code for diff'ing two or three buffers.
* diff.c: code for diff'ing two, three or four buffers.
*/
#include "vim.h"
@@ -116,7 +116,7 @@ diff_buf_adjust(win)
* Add a buffer to make diffs for.
* Call this when a new buffer is being edited in the current window where
* 'diff' is set.
* Marks the current buffer as being part of the diff and requireing updating.
* Marks the current buffer as being part of the diff and requiring updating.
* This must be done before any autocmd, because a command may use info
* about the screen contents.
*/
@@ -929,7 +929,7 @@ ex_diffpatch(eap)
goto theend;
#ifdef UNIX
/* Temporaraly chdir to /tmp, to avoid patching files in the current
/* Temporarily chdir to /tmp, to avoid patching files in the current
* directory when the patch file contains more than one patch. When we
* have our own temp dir use that instead, it will be cleaned up when we
* exit (any .rej files created). Don't change directory if we can't
@@ -2129,6 +2129,8 @@ ex_diffgetput(eap)
EMSG2(_("E102: Can't find buffer \"%s\""), eap->arg);
return;
}
if (buf == curbuf)
return; /* nothing to do */
idx_other = diff_buf_idx(buf);
if (idx_other == DB_COUNT)
{

View File

@@ -49,6 +49,7 @@ do_ascii(eap)
exarg_T *eap;
{
int c;
int cval;
char buf1[20];
char buf2[20];
char_u buf3[7];
@@ -75,6 +76,10 @@ do_ascii(eap)
{
if (c == NL) /* NUL is stored as NL */
c = NUL;
if (c == CAR && get_fileformat(curbuf) == EOL_MAC)
cval = NL; /* NL is stored as CR */
else
cval = c;
if (vim_isprintc_strict(c) && (c < ' '
#ifndef EBCDIC
|| c > '~'
@@ -94,7 +99,7 @@ do_ascii(eap)
buf2[0] = NUL;
vim_snprintf((char *)IObuff, IOSIZE,
_("<%s>%s%s %d, Hex %02x, Octal %03o"),
transchar(c), buf1, buf2, c, c, c);
transchar(c), buf1, buf2, cval, cval, cval);
#ifdef FEAT_MBYTE
if (enc_utf8)
c = cc[ci++];

View File

@@ -5482,6 +5482,9 @@ invalid_count:
return OK;
}
/*
* ":command ..."
*/
static void
ex_command(eap)
exarg_T *eap;
@@ -5914,6 +5917,7 @@ do_ucmd(eap)
char_u *start;
char_u *end;
char_u *ksp;
size_t len, totlen;
size_t split_len = 0;
@@ -5930,16 +5934,51 @@ do_ucmd(eap)
/*
* Replace <> in the command by the arguments.
* First round: "buf" is NULL, compute length, allocate "buf".
* Second round: copy result into "buf".
*/
buf = NULL;
for (;;)
{
p = cmd->uc_rep;
q = buf;
p = cmd->uc_rep; /* source */
q = buf; /* destinateion */
totlen = 0;
while ((start = vim_strchr(p, '<')) != NULL
&& (end = vim_strchr(start + 1, '>')) != NULL)
for (;;)
{
start = vim_strchr(p, '<');
if (start != NULL)
end = vim_strchr(start + 1, '>');
if (buf != NULL)
{
ksp = vim_strchr(p, K_SPECIAL);
if (ksp != NULL && (start == NULL || ksp < start || end == NULL)
&& ((ksp[1] == KS_SPECIAL && ksp[2] == KE_FILLER)
# ifdef FEAT_GUI
|| (ksp[1] == KS_EXTRA && ksp[2] == (int)KE_CSI)
# endif
))
{
/* K_SPECIAL han been put in the buffer as K_SPECIAL
* KS_SPECIAL KE_FILLER, like for mappings, but
* do_cmdline() doesn't handle that, so convert it back.
* Also change K_SPECIAL KS_EXTRA KE_CSI into CSI. */
len = ksp - p;
if (len > 0)
{
mch_memmove(q, p, len);
q += len;
}
*q++ = ksp[1] == KS_SPECIAL ? K_SPECIAL : CSI;
p = ksp + 3;
continue;
}
}
/* break if there no <item> is found */
if (start == NULL || end == NULL)
break;
/* Include the '>' */
++end;

View File

@@ -1663,8 +1663,17 @@ process_message(void)
if (msg.message == WM_OLE)
{
char_u *str = (char_u *)msg.lParam;
add_to_input_buf(str, (int)STRLEN(str));
vim_free(str);
if (str == NULL || *str == NUL)
{
/* Message can't be ours, forward it. Fixes problem with Ultramon
* 3.0.4 */
DispatchMessage(&msg);
}
else
{
add_to_input_buf(str, (int)STRLEN(str));
vim_free(str); /* was allocated in CVim::SendKeys() */
}
return;
}
#endif

View File

@@ -1177,8 +1177,16 @@ cs_help(eap)
(void)MSG_PUTS(_("cscope commands:\n"));
while (cmdp->name != NULL)
{
(void)smsg((char_u *)_("%-5s: %-30s (Usage: %s)"),
cmdp->name, _(cmdp->help), cmdp->usage);
char *help = _(cmdp->help);
int space_cnt = 30 - vim_strsize((char_u *)help);
/* Use %*s rather than %30s to ensure proper alignment in utf-8 */
if (space_cnt < 0)
space_cnt = 0;
(void)smsg((char_u *)_("%-5s: %s%*s (Usage: %s)"),
cmdp->name,
help, space_cnt, " ",
cmdp->usage);
if (strcmp(cmdp->name, "find") == 0)
MSG_PUTS(_("\n"
" c: Find functions calling this function\n"

View File

@@ -353,9 +353,13 @@ CVim::SendKeys(BSTR keys)
}
/* Pass the string to the main input loop. The memory will be freed when
* the message is processed.
* the message is processed. Except for an empty message, we don't need
* to post it then.
*/
PostMessage(NULL, WM_OLE, 0, (LPARAM)str);
if (*str == NUL)
vim_free(str);
else
PostMessage(NULL, WM_OLE, 0, (LPARAM)str);
return S_OK;
}

View File

@@ -1151,14 +1151,23 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookupDict)
/* Check if we run into a recursive loop. The item must be in lookupDict
* then and we can use it again. */
sprintf(ptrBuf, PRINTF_DECIMAL_LONG_U, (long_u)our_tv);
result = PyDict_GetItemString(lookupDict, ptrBuf);
if (result != NULL)
Py_INCREF(result);
else if (our_tv->v_type == VAR_STRING)
if ((our_tv->v_type == VAR_LIST && our_tv->vval.v_list != NULL)
|| (our_tv->v_type == VAR_DICT && our_tv->vval.v_dict != NULL))
{
sprintf(ptrBuf, PRINTF_DECIMAL_LONG_U,
our_tv->v_type == VAR_LIST ? (long_u)our_tv->vval.v_list
: (long_u)our_tv->vval.v_dict);
result = PyDict_GetItemString(lookupDict, ptrBuf);
if (result != NULL)
{
Py_INCREF(result);
return result;
}
}
if (our_tv->v_type == VAR_STRING)
{
result = Py_BuildValue("s", our_tv->vval.v_string);
PyDict_SetItemString(lookupDict, ptrBuf, result);
}
else if (our_tv->v_type == VAR_NUMBER)
{
@@ -1167,7 +1176,6 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookupDict)
/* For backwards compatibility numbers are stored as strings. */
sprintf(buf, "%ld", (long)our_tv->vval.v_number);
result = Py_BuildValue("s", buf);
PyDict_SetItemString(lookupDict, ptrBuf, result);
}
# ifdef FEAT_FLOAT
else if (our_tv->v_type == VAR_FLOAT)
@@ -1176,7 +1184,6 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookupDict)
sprintf(buf, "%f", our_tv->vval.v_float);
result = Py_BuildValue("s", buf);
PyDict_SetItemString(lookupDict, ptrBuf, result);
}
# endif
else if (our_tv->v_type == VAR_LIST)
@@ -1185,10 +1192,11 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookupDict)
listitem_T *curr;
result = PyList_New(0);
PyDict_SetItemString(lookupDict, ptrBuf, result);
if (list != NULL)
{
PyDict_SetItemString(lookupDict, ptrBuf, result);
for (curr = list->lv_first; curr != NULL; curr = curr->li_next)
{
newObj = VimToPython(&curr->li_tv, depth + 1, lookupDict);
@@ -1200,7 +1208,6 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookupDict)
else if (our_tv->v_type == VAR_DICT)
{
result = PyDict_New();
PyDict_SetItemString(lookupDict, ptrBuf, result);
if (our_tv->vval.v_dict != NULL)
{
@@ -1209,6 +1216,8 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookupDict)
hashitem_T *hi;
dictitem_T *di;
PyDict_SetItemString(lookupDict, ptrBuf, result);
for (hi = ht->ht_array; todo > 0; ++hi)
{
if (!HASHITEM_EMPTY(hi))

View File

@@ -4556,7 +4556,13 @@ vim_snprintf(str, str_m, fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
remove_trailing_zeroes = TRUE;
}
if (fmt_spec == 'f' && abs_f > 1.0e307)
if (fmt_spec == 'f' &&
#ifdef VAX
abs_f > 1.0e38
#else
abs_f > 1.0e307
#endif
)
{
/* Avoid a buffer overflow */
strcpy(tmp, "inf");

View File

@@ -4696,7 +4696,8 @@ vim_findfile(search_ctx_arg)
stackp->ffs_filearray_cur = i + 1;
ff_push(search_ctx, stackp);
simplify_filename(file_path);
if (!path_with_url(file_path))
simplify_filename(file_path);
if (mch_dirname(ff_expand_buffer, MAXPATHL)
== OK)
{

View File

@@ -1223,6 +1223,25 @@ utf16_to_enc(short_u *str, int *lenp)
}
#endif /* FEAT_MBYTE */
/*
* Wait for another process to Close the Clipboard.
* Returns TRUE for success.
*/
int
vim_open_clipboard()
{
int delay = 10;
while (!OpenClipboard(NULL))
{
if (delay > 500)
return FALSE; /* waited too long, give up */
Sleep(delay);
delay *= 2; /* wait for 10, 20, 40, 80, etc. msec */
}
return TRUE;
}
/*
* Get the current selection and put it in the clipboard register.
*
@@ -1254,7 +1273,7 @@ clip_mch_request_selection(VimClipboard *cbd)
* Don't pass GetActiveWindow() as an argument to OpenClipboard() because
* then we can't paste back into the same window for some reason - webb.
*/
if (!OpenClipboard(NULL))
if (!vim_open_clipboard())
return;
/* Check for vim's own clipboard format first. This only gets the type of
@@ -1562,7 +1581,7 @@ clip_mch_set_selection(VimClipboard *cbd)
* because then we can't paste back into the same window for some
* reason - webb.
*/
if (OpenClipboard(NULL))
if (vim_open_clipboard())
{
if (EmptyClipboard())
{

View File

@@ -515,7 +515,7 @@ do_tag(tag, type, count, forceit, verbose)
* If a count is supplied to the ":tag <name>" command, then
* jump to count'th matching tag.
*/
if (type == DT_TAG && count > 0)
if (type == DT_TAG && *tag != NUL && count > 0)
cur_match = count - 1;
if (type == DT_SELECT || type == DT_JUMP

View File

@@ -4920,7 +4920,15 @@ check_termcode(max_offset, buf, buflen)
key_name[0] = KEY2TERMCAP0(key);
key_name[1] = KEY2TERMCAP1(key);
if (key_name[0] == KS_KEY)
string[new_slen++] = key_name[1]; /* from ":set <M-b>=xx" */
{
/* from ":set <M-b>=xx" */
#ifdef FEAT_MBYTE
if (has_mbyte)
new_slen += (*mb_char2bytes)(key_name[1], string + new_slen);
else
#endif
string[new_slen++] = key_name[1];
}
else
{
string[new_slen++] = K_SPECIAL;

View File

@@ -676,6 +676,28 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
91,
/**/
90,
/**/
89,
/**/
88,
/**/
87,
/**/
86,
/**/
85,
/**/
84,
/**/
83,
/**/
82,
/**/
81,
/**/
80,
/**/