Compare commits

...

14 Commits

Author SHA1 Message Date
Bram Moolenaar
eda73607a7 updated for version 7.4.494
Problem:    Cursor shape is wrong after a CompleteDone autocommand.
Solution:   Update the cursor and mouse shape after ":normal" restores the
            state. (Jacob Niehus)
2014-11-05 09:53:23 +01:00
Bram Moolenaar
086329d3f6 updated for version 7.4.493
Problem:    A TextChanged autocommand is triggered when saving a file.
            (William Gardner)
Solution:   Update last_changedtick after calling unchanged(). (Christian
            Brabandt)
2014-10-31 19:51:36 +01:00
Bram Moolenaar
2f31e39978 updated for version 7.4.492
Problem:    In Insert mode, after inserting a newline that inserts a comment
            leader, CTRL-O moves to the right. (ZyX) Issue 57.
Solution:   Correct the condition for moving the cursor back to the NUL.
            (Christian Brabandt)
2014-10-31 19:20:36 +01:00
Bram Moolenaar
b851a96d5c updated for version 7.4.491
Problem:    When winrestview() has a negative "topline" value there are
            display errors.
Solution:   Correct a negative value to 1. (Hirohito Higashi)
2014-10-31 15:45:52 +01:00
Bram Moolenaar
6a64365c95 updated for version 7.4.490
Problem:    Cannot specify the buffer to use for "do" and "dp", making them
            useless for three-way diff.
Solution:   Use the count as the buffer number. (James McCoy)
2014-10-31 13:54:25 +01:00
Bram Moolenaar
fe3c410098 updated for version 7.4.489
Problem:    Cursor movement still wrong when 'lbr' is set and there is a
            number column. (Hirohito Higashi)
Solution:   Add correction for number column. (Hiroyuki Takagi)
2014-10-31 12:42:01 +01:00
Bram Moolenaar
7a373dd0d4 updated for version 7.4.488
Problem:    test_mapping fails for some people.
Solution:   Set the 'encoding' option. (Ken Takata)
2014-10-22 22:09:01 +02:00
Bram Moolenaar
a94618e16c Add the missing test files. 2014-10-21 22:36:31 +02:00
Bram Moolenaar
482a2b5c9d updated for version 7.4.487
Problem:    ":sign jump" may use another window even though the file is
            already edited in the current window.
Solution:   First check if the file is in the current window. (James McCoy)
2014-10-21 20:57:15 +02:00
Bram Moolenaar
958636c406 updated for version 7.4.486
Problem:    Check for writing to a yank register is wrong.
Solution:   Negate the check. (Zyx).  Also clean up the #ifdefs.
2014-10-21 20:01:58 +02:00
Bram Moolenaar
4920a44271 updated for version 7.4.485
Problem:    Abbreviations don't work. (Toothpik)
Solution:   Move the length computation inside the for loop.  Compare against
            the unescaped key.
2014-10-21 19:35:31 +02:00
Bram Moolenaar
cb5ea1401a updated for version 7.4.484
Problem:    Compiler warning on MS-Windows. (Ken Takata)
Solution:   Add type cast.
2014-10-21 18:17:09 +02:00
Bram Moolenaar
bdef518b0a updated for version 7.4.483
Problem:    A 0x80 byte is not handled correctly in abbreviations.
Solution:   Unescape special characters. Add a test. (Christian Brabandt)
2014-10-21 16:22:17 +02:00
Bram Moolenaar
f1b4622366 updated for version 7.4.482
Problem:    When 'balloonexpr' results in a list, the text has a trailing
            newline. (Lcd)
Solution:   Remove one trailing newline.
2014-10-21 14:15:17 +02:00
25 changed files with 186 additions and 73 deletions

View File

@@ -1184,6 +1184,8 @@ win_lbr_chartabsize(wp, line, s, col, headp)
{
col -= W_WIDTH(wp);
numberextra = W_WIDTH(wp) - (numberextra - win_col_off2(wp));
if (numberextra > 0)
col %= numberextra;
if (*p_sbr != NUL)
{
colnr_T sbrlen = (colnr_T)MB_CHARLEN(p_sbr);

View File

@@ -2107,12 +2107,20 @@ diff_infold(wp, lnum)
* "dp" and "do" commands.
*/
void
nv_diffgetput(put)
nv_diffgetput(put, count)
int put;
long count;
{
exarg_T ea;
char_u buf[30];
ea.arg = (char_u *)"";
if (count == 0)
ea.arg = (char_u *)"";
else
{
vim_snprintf((char *)buf, 30, "%ld", count);
ea.arg = buf;
}
if (put)
ea.cmdidx = CMD_diffput;
else

View File

@@ -6916,8 +6916,12 @@ stop_insert(end_insert_pos, esc, nomove)
}
if (curwin->w_cursor.lnum != tpos.lnum)
curwin->w_cursor = tpos;
else if (cc != NUL)
++curwin->w_cursor.col; /* put cursor back on the NUL */
else
{
tpos.col++;
if (cc != NUL && gchar_pos(&tpos) == NUL)
++curwin->w_cursor.col; /* put cursor back on the NUL */
}
/* <C-S-Right> may have started Visual mode, adjust the position for
* deleted characters. */

View File

@@ -19576,7 +19576,7 @@ f_winrestview(argvars, rettv)
# endif
changed_window_setting();
if (curwin->w_topline == 0)
if (curwin->w_topline <= 0)
curwin->w_topline = 1;
if (curwin->w_topline > curbuf->b_ml.ml_line_count)
curwin->w_topline = curbuf->b_ml.ml_line_count;

View File

@@ -1153,8 +1153,6 @@ EX(CMD_tilde, "~", do_sub,
#endif
};
#define USER_CMDIDX(idx) ((int)(idx) < 0)
#ifndef DO_DECLARE_EXCMD
typedef enum CMD_index cmdidx_T;

View File

@@ -49,10 +49,15 @@ static void ex_delcommand __ARGS((exarg_T *eap));
static char_u *get_user_command_name __ARGS((int idx));
# endif
/* Wether a command index indicates a user command. */
# define IS_USER_CMDIDX(idx) ((int)(idx) < 0)
#else
# define ex_command ex_ni
# define ex_comclear ex_ni
# define ex_delcommand ex_ni
/* Wether a command index indicates a user command. */
# define IS_USER_CMDIDX(idx) (FALSE)
#endif
#ifdef FEAT_EVAL
@@ -2190,11 +2195,8 @@ do_one_cmd(cmdlinep, sourcing,
goto doend;
}
ni = (
#ifdef FEAT_USR_CMDS
!USER_CMDIDX(ea.cmdidx) &&
#endif
(cmdnames[ea.cmdidx].cmd_func == ex_ni
ni = (!IS_USER_CMDIDX(ea.cmdidx)
&& (cmdnames[ea.cmdidx].cmd_func == ex_ni
#ifdef HAVE_EX_SCRIPT_NI
|| cmdnames[ea.cmdidx].cmd_func == ex_script_ni
#endif
@@ -2229,9 +2231,7 @@ do_one_cmd(cmdlinep, sourcing,
/*
* 5. parse arguments
*/
#ifdef FEAT_USR_CMDS
if (!USER_CMDIDX(ea.cmdidx))
#endif
if (!IS_USER_CMDIDX(ea.cmdidx))
ea.argt = (long)cmdnames[(int)ea.cmdidx].cmd_argt;
if (!ea.skip)
@@ -2252,10 +2252,7 @@ do_one_cmd(cmdlinep, sourcing,
}
if (text_locked() && !(ea.argt & CMDWIN)
# ifdef FEAT_USR_CMDS
&& !USER_CMDIDX(ea.cmdidx)
# endif
)
&& !IS_USER_CMDIDX(ea.cmdidx))
{
/* Command not allowed when editing the command line. */
#ifdef FEAT_CMDWIN
@@ -2273,9 +2270,7 @@ do_one_cmd(cmdlinep, sourcing,
if (!(ea.argt & CMDWIN)
&& ea.cmdidx != CMD_edit
&& ea.cmdidx != CMD_checktime
# ifdef FEAT_USR_CMDS
&& !USER_CMDIDX(ea.cmdidx)
# endif
&& !IS_USER_CMDIDX(ea.cmdidx)
&& curbuf_locked())
goto doend;
#endif
@@ -2468,10 +2463,8 @@ do_one_cmd(cmdlinep, sourcing,
/* accept numbered register only when no count allowed (:put) */
if ( (ea.argt & REGSTR)
&& *ea.arg != NUL
#ifdef FEAT_USR_CMDS
/* Do not allow register = for user commands */
&& (!USER_CMDIDX(ea.cmdidx) || *ea.arg != '=')
#endif
/* Do not allow register = for user commands */
&& (!IS_USER_CMDIDX(ea.cmdidx) || *ea.arg != '=')
&& !((ea.argt & COUNT) && VIM_ISDIGIT(*ea.arg)))
{
#ifndef FEAT_CLIPBOARD
@@ -2482,14 +2475,8 @@ do_one_cmd(cmdlinep, sourcing,
goto doend;
}
#endif
if (
#ifdef FEAT_USR_CMDS
valid_yank_reg(*ea.arg, (ea.cmdidx != CMD_put
&& USER_CMDIDX(ea.cmdidx)))
#else
valid_yank_reg(*ea.arg, ea.cmdidx != CMD_put)
#endif
)
if (valid_yank_reg(*ea.arg, (ea.cmdidx != CMD_put
&& !IS_USER_CMDIDX(ea.cmdidx))))
{
ea.regname = *ea.arg++;
#ifdef FEAT_EVAL
@@ -2663,10 +2650,7 @@ do_one_cmd(cmdlinep, sourcing,
* number. Don't do this for a user command.
*/
if ((ea.argt & BUFNAME) && *ea.arg != NUL && ea.addr_count == 0
# ifdef FEAT_USR_CMDS
&& !USER_CMDIDX(ea.cmdidx)
# endif
)
&& !IS_USER_CMDIDX(ea.cmdidx))
{
/*
* :bdelete, :bwipeout and :bunload take several arguments, separated
@@ -2704,7 +2688,7 @@ do_one_cmd(cmdlinep, sourcing,
#endif
#ifdef FEAT_USR_CMDS
if (USER_CMDIDX(ea.cmdidx))
if (IS_USER_CMDIDX(ea.cmdidx))
{
/*
* Execute a user-defined command.
@@ -2763,11 +2747,8 @@ doend:
}
#ifdef FEAT_EVAL
do_errthrow(cstack,
(ea.cmdidx != CMD_SIZE
# ifdef FEAT_USR_CMDS
&& !USER_CMDIDX(ea.cmdidx)
# endif
) ? cmdnames[(int)ea.cmdidx].cmd_name : (char_u *)NULL);
(ea.cmdidx != CMD_SIZE && !IS_USER_CMDIDX(ea.cmdidx))
? cmdnames[(int)ea.cmdidx].cmd_name : (char_u *)NULL);
#endif
if (verbose_save >= 0)
@@ -3361,9 +3342,7 @@ set_one_cmd_context(xp, buff)
/*
* 5. parse arguments
*/
#ifdef FEAT_USR_CMDS
if (!USER_CMDIDX(ea.cmdidx))
#endif
if (!IS_USER_CMDIDX(ea.cmdidx))
ea.argt = (long)cmdnames[(int)ea.cmdidx].cmd_argt;
arg = skipwhite(p);
@@ -9547,8 +9526,15 @@ ex_normal(eap)
msg_didout |= save_msg_didout; /* don't reset msg_didout now */
/* Restore the state (needed when called from a function executed for
* 'indentexpr'). */
* 'indentexpr'). Update the mouse and cursor, they may have changed. */
State = save_State;
#ifdef FEAT_MOUSE
setmouse();
#endif
#ifdef CURSOR_SHAPE
ui_cursor_shape(); /* may show different cursor shape */
#endif
#ifdef FEAT_MBYTE
vim_free(arg);
#endif

View File

@@ -4877,6 +4877,13 @@ restore_backup:
)
{
unchanged(buf, TRUE);
#ifdef FEAT_AUTOCMD
/* buf->b_changedtick is always incremented in unchanged() but that
* should not trigger a TextChanged event. */
if (last_changedtick + 1 == buf->b_changedtick
&& last_changedtick_buf == buf)
last_changedtick = buf->b_changedtick;
#endif
u_unchanged(buf);
u_update_save_nr(buf);
}

View File

@@ -4526,10 +4526,28 @@ check_abbr(c, ptr, col, mincol)
#endif
(mp = mp->m_next))
{
int qlen = mp->m_keylen;
char_u *q = mp->m_keys;
int match;
if (vim_strbyte(mp->m_keys, K_SPECIAL) != NULL)
{
/* might have CSI escaped mp->m_keys */
q = vim_strsave(mp->m_keys);
if (q != NULL)
{
vim_unescape_csi(q);
qlen = (int)STRLEN(q);
}
}
/* find entries with right mode and keys */
if ( (mp->m_mode & State)
&& mp->m_keylen == len
&& !STRNCMP(mp->m_keys, ptr, (size_t)len))
match = (mp->m_mode & State)
&& qlen == len
&& !STRNCMP(q, ptr, (size_t)len);
if (q != mp->m_keys)
vim_free(q);
if (match)
break;
}
if (mp != NULL)

View File

@@ -30,6 +30,7 @@ general_beval_cb(beval, state)
long winnr = 0;
char_u *bexpr;
buf_T *save_curbuf;
size_t len;
# ifdef FEAT_WINDOWS
win_T *cw;
# endif
@@ -83,6 +84,16 @@ general_beval_cb(beval, state)
vim_free(result);
result = eval_to_string(bexpr, NULL, TRUE);
/* Remove one trailing newline, it is added when the result was a
* list and it's hardly every useful. If the user really wants a
* trailing newline he can add two and one remains. */
if (result != NULL)
{
len = STRLEN(result);
if (len > 0 && result[len - 1] == NL)
result[len - 1] = NUL;
}
if (use_sandbox)
--sandbox;
--textlock;

View File

@@ -9284,7 +9284,7 @@ nv_put(cap)
if (cap->oap->op_type == OP_DELETE && cap->cmdchar == 'p')
{
clearop(cap->oap);
nv_diffgetput(TRUE);
nv_diffgetput(TRUE, cap->opcount);
}
else
#endif
@@ -9407,7 +9407,7 @@ nv_open(cap)
if (cap->oap->op_type == OP_DELETE && cap->cmdchar == 'o')
{
clearop(cap->oap);
nv_diffgetput(FALSE);
nv_diffgetput(FALSE, cap->opcount);
}
else
#endif

View File

@@ -18,7 +18,7 @@ int diffopt_changed __ARGS((void));
int diffopt_horizontal __ARGS((void));
int diff_find_change __ARGS((win_T *wp, linenr_T lnum, int *startp, int *endp));
int diff_infold __ARGS((win_T *wp, linenr_T lnum));
void nv_diffgetput __ARGS((int put));
void nv_diffgetput __ARGS((int put, long count));
void ex_diffgetput __ARGS((exarg_T *eap));
int diff_mode_buf __ARGS((buf_T *buf));
int diff_move_to __ARGS((int dir, long count));

View File

@@ -43,8 +43,10 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test_insertcount.out \
test_listlbr.out \
test_listlbr_utf8.out \
test_mapping.out \
test_options.out \
test_qf_title.out \
test_signs.out \
test_utf8.out
.SUFFIXES: .in .out
@@ -178,4 +180,5 @@ test_listlbr.out: test_listlbr.in
test_listlbr_utf8.out: test_listlbr_utf8.in
test_options.out: test_options.in
test_qf_title.out: test_qf_title.in
test_signs.out: test_signs.in
test_utf8.out: test_utf8.in

View File

@@ -42,8 +42,10 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test_insertcount.out \
test_listlbr.out \
test_listlbr_utf8.out \
test_mapping.out \
test_options.out \
test_qf_title.out \
test_signs.out \
test_utf8.out
SCRIPTS32 = test50.out test70.out

View File

@@ -62,8 +62,10 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test_insertcount.out \
test_listlbr.out \
test_listlbr_utf8.out \
test_mapping.out \
test_options.out \
test_qf_title.out \
test_signs.out \
test_utf8.out
SCRIPTS32 = test50.out test70.out

View File

@@ -44,8 +44,10 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test_insertcount.out \
test_listlbr.out \
test_listlbr_utf8.out \
test_mapping.out \
test_options.out \
test_qf_title.out \
test_signs.out \
test_utf8.out
.SUFFIXES: .in .out

View File

@@ -103,8 +103,10 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \
test_insertcount.out \
test_listlbr.out \
test_listlbr_utf8.out \
test_mapping.out \
test_options.out \
test_qf_title.out \
test_signs.out \
test_utf8.out
# Known problems:

View File

@@ -40,8 +40,10 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
test_insertcount.out \
test_listlbr.out \
test_listlbr_utf8.out \
test_mapping.out \
test_options.out \
test_qf_title.out \
test_signs.out \
test_utf8.out
SCRIPTS_GUI = test16.out

View File

@@ -17,6 +17,9 @@ othis should be auto-indented
G?this is a
othis should be in column 1:wq " append text without autoindent to Xxx
G:r Xxx " include Xxx in the current file
:set fo+=r " issue #57 do not move cursor on <c-o> when autoindent is set
Go# abcdef2hi
d0o# abcdef2hid0
:?startstart?,$w! test.out
:qa!
ENDTEST

View File

@@ -15,3 +15,6 @@ vim: set noai :
this is a test
this should be in column 1
end of test file Xxx
# abc
def
def

View File

@@ -0,0 +1,16 @@
Test for mappings and abbreviations
STARTTEST
:so small.vim
:so mbyte.vim
:set encoding=utf-8
: " abbreviations with р (0x80) should work
:inoreab чкпр vim
GAчкпр

:/^test/,$w! test.out
:qa!
ENDTEST
test starts here:

View File

@@ -0,0 +1,2 @@
test starts here:
vim

22
src/testdir/test_signs.in Normal file
View File

@@ -0,0 +1,22 @@
Tests for signs
STARTTEST
:so small.vim
:if !has("signs")
: e! test.ok
: wq! test.out
:endif
:"
:sign define JumpSign text=x
:exe 'sign place 42 line=2 name=JumpSign buffer=' . bufnr('')
:" Split the window to the bottom to verify :sign-jump will stay in the current
:" window if the buffer is displayed there
:bot split
:exe 'sign jump 42 buffer=' . bufnr('')
:call append(line('$'), winnr())
:$-1,$w! test.out
ENDTEST
STARTTEST
:qa!
ENDTEST

View File

@@ -0,0 +1,2 @@
2

View File

@@ -741,6 +741,32 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
494,
/**/
493,
/**/
492,
/**/
491,
/**/
490,
/**/
489,
/**/
488,
/**/
487,
/**/
486,
/**/
485,
/**/
484,
/**/
483,
/**/
482,
/**/
481,
/**/

View File

@@ -4407,20 +4407,19 @@ win_enter_ext(wp, undo_sync, curwin_invalid, trigger_enter_autocmds, trigger_lea
buf_jump_open_win(buf)
buf_T *buf;
{
# ifdef FEAT_WINDOWS
win_T *wp;
win_T *wp = NULL;
for (wp = firstwin; wp != NULL; wp = wp->w_next)
if (wp->w_buffer == buf)
break;
if (curwin->w_buffer == buf)
wp = curwin;
# ifdef FEAT_WINDOWS
else
for (wp = firstwin; wp != NULL; wp = wp->w_next)
if (wp->w_buffer == buf)
break;
if (wp != NULL)
win_enter(wp, FALSE);
return wp;
# else
if (curwin->w_buffer == buf)
return curwin;
return NULL;
# endif
return wp;
}
/*
@@ -4432,12 +4431,10 @@ buf_jump_open_win(buf)
buf_jump_open_tab(buf)
buf_T *buf;
{
win_T *wp = buf_jump_open_win(buf);
# ifdef FEAT_WINDOWS
win_T *wp;
tabpage_T *tp;
/* First try the current tab page. */
wp = buf_jump_open_win(buf);
if (wp != NULL)
return wp;
@@ -4455,13 +4452,8 @@ buf_jump_open_tab(buf)
break;
}
}
return wp;
# else
if (curwin->w_buffer == buf)
return curwin;
return NULL;
# endif
return wp;
}
#endif