Compare commits

...

13 Commits

12 changed files with 133 additions and 45 deletions

6
src/auto/configure vendored
View File

@ -4256,7 +4256,7 @@ fi
echo $ECHO_N "checking if -pthread should be used... $ECHO_C" >&6
threadsafe_flag=
thread_lib=
if test "x$MACOSX" != "xyes"; then
if test "`(uname) 2>/dev/null`" != Darwin; then
test "$GCC" = yes && threadsafe_flag="-pthread"
if test "`(uname) 2>/dev/null`" = FreeBSD; then
threadsafe_flag="-D_THREAD_SAFE"
@ -11555,8 +11555,8 @@ rm -f conftest.err conftest.$ac_objext \
else
echo "$as_me:$LINENO: result: empty: automatic terminal library selection" >&5
echo "${ECHO_T}empty: automatic terminal library selection" >&6
case "`uname -s 2>/dev/null`" in
OSF1) tlibs="ncurses curses termlib termcap";;
case "`uname -s 2>/dev/null`" in
OSF1|SCO_SV) tlibs="ncurses curses termlib termcap";;
*) tlibs="ncurses termlib termcap curses";;
esac
for libname in $tlibs; do

View File

@ -681,7 +681,8 @@ eof
AC_MSG_CHECKING([if -pthread should be used])
threadsafe_flag=
thread_lib=
if test "x$MACOSX" != "xyes"; then
dnl if test "x$MACOSX" != "xyes"; then
if test "`(uname) 2>/dev/null`" != Darwin; then
test "$GCC" = yes && threadsafe_flag="-pthread"
if test "`(uname) 2>/dev/null`" = FreeBSD; then
threadsafe_flag="-D_THREAD_SAFE"
@ -2151,8 +2152,9 @@ else
dnl Newer versions of ncurses are preferred over anything.
dnl Older versions of ncurses have bugs, get a new one!
dnl Digital Unix (OSF1) should use curses (Ronald Schild).
dnl On SCO Openserver should prefer termlib (Roger Cornelius).
case "`uname -s 2>/dev/null`" in
OSF1) tlibs="ncurses curses termlib termcap";;
OSF1|SCO_SV) tlibs="ncurses curses termlib termcap";;
*) tlibs="ncurses termlib termcap curses";;
esac
for libname in $tlibs; do

View File

@ -923,6 +923,7 @@ doESCkey:
if (cmdchar != 'r' && cmdchar != 'v')
apply_autocmds(EVENT_INSERTLEAVE, NULL, NULL,
FALSE, curbuf);
did_cursorhold = FALSE;
#endif
return (c == Ctrl_O);
}
@ -2157,7 +2158,7 @@ ins_compl_add(str, len, icase, fname, cptext, cdir, flags, adup)
do
{
if ( !(match->cp_flags & ORIGINAL_TEXT)
&& ins_compl_equal(match, str, len)
&& STRNCMP(match->cp_str, str, len) == 0
&& match->cp_str[len] == NUL)
return NOTDONE;
match = match->cp_next;
@ -3206,7 +3207,8 @@ ins_compl_addfrommatch()
for (cp = compl_shown_match->cp_next; cp != NULL
&& cp != compl_first_match; cp = cp->cp_next)
{
if (ins_compl_equal(cp, compl_leader,
if (compl_leader == NULL
|| ins_compl_equal(cp, compl_leader,
(int)STRLEN(compl_leader)))
{
p = cp->cp_str;
@ -4041,7 +4043,7 @@ ins_compl_get_exp(ini)
if (got_int)
break;
/* Fill the popup menu as soon as possible. */
if (pum_wanted() && type != -1)
if (type != -1)
ins_compl_check_keys(0);
if ((ctrl_x_mode != 0 && ctrl_x_mode != CTRL_X_WHOLE_LINE)

View File

@ -10432,20 +10432,14 @@ getwinvar(argvars, rettv, off)
if (win != NULL && varname != NULL)
{
/* Set curwin to be our win, temporarily. Also set curbuf, so
* that we can get buffer-local options. */
oldcurwin = curwin;
curwin = win;
curbuf = win->w_buffer;
if (*varname == '&') /* window-local-option */
{
/* Set curwin to be our win, temporarily. Also set curbuf, so
* that we can get buffer-local options. */
oldcurwin = curwin;
curwin = win;
curbuf = win->w_buffer;
get_option_tv(&varname, rettv, 1);
/* restore previous notion of curwin */
curwin = oldcurwin;
curbuf = curwin->w_buffer;
}
else
{
if (*varname == NUL)
@ -10458,6 +10452,10 @@ getwinvar(argvars, rettv, off)
if (v != NULL)
copy_tv(&v->di_tv, rettv);
}
/* restore previous notion of curwin */
curwin = oldcurwin;
curbuf = curwin->w_buffer;
}
--emsg_off;

View File

@ -1960,10 +1960,13 @@ vgetorpeek(advance)
c = Ctrl_C;
flush_buffers(TRUE); /* flush all typeahead */
/* Also record this character, it might be needed to
* get out of Insert mode. */
*typebuf.tb_buf = c;
gotchars(typebuf.tb_buf, 1);
if (advance)
{
/* Also record this character, it might be needed to
* get out of Insert mode. */
*typebuf.tb_buf = c;
gotchars(typebuf.tb_buf, 1);
}
cmd_silent = FALSE;
break;

View File

@ -2873,6 +2873,9 @@ button_set:
*/
if ((State == NORMAL || State == NORMAL_BUSY || (State & INSERT))
&& Y_2_ROW(y) >= topframe->fr_height
# ifdef FEAT_WINDOWS
+ firstwin->w_winrow
# endif
&& button != MOUSE_DRAG
# ifdef FEAT_MOUSESHAPE
&& !drag_status_line

View File

@ -4124,8 +4124,6 @@ vim_snprintf(str, str_m, fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
case 'c':
case 's':
length_modifier = '\0';
zero_padding = 0; /* turn zero padding off for string
conversions */
str_arg_l = 1;
switch (fmt_spec)
{

View File

@ -1477,14 +1477,17 @@ do_pending_operator(cap, old_col, gui_yank)
}
else if (VIsual_active)
{
/* Save the current VIsual area for '< and '> marks, and "gv" */
curbuf->b_visual.vi_start = VIsual;
curbuf->b_visual.vi_end = curwin->w_cursor;
curbuf->b_visual.vi_mode = VIsual_mode;
curbuf->b_visual.vi_curswant = curwin->w_curswant;
if (!gui_yank)
{
/* Save the current VIsual area for '< and '> marks, and "gv" */
curbuf->b_visual.vi_start = VIsual;
curbuf->b_visual.vi_end = curwin->w_cursor;
curbuf->b_visual.vi_mode = VIsual_mode;
curbuf->b_visual.vi_curswant = curwin->w_curswant;
# ifdef FEAT_EVAL
curbuf->b_visual_mode_eval = VIsual_mode;
curbuf->b_visual_mode_eval = VIsual_mode;
# endif
}
/* In Select mode, a linewise selection is operated upon like a
* characterwise selection. */

View File

@ -770,6 +770,7 @@ get_expr_line()
{
char_u *expr_copy;
char_u *rv;
static int nested = 0;
if (expr_line == NULL)
return NULL;
@ -780,7 +781,14 @@ get_expr_line()
if (expr_copy == NULL)
return NULL;
/* When we are invoked recursively limit the evaluation to 10 levels.
* Then return the string as-is. */
if (nested >= 10)
return expr_copy;
++nested;
rv = eval_to_string(expr_copy, NULL, TRUE);
--nested;
vim_free(expr_copy);
return rv;
}

View File

@ -5079,15 +5079,38 @@ screen_line(row, coloff, endcol, clear_width
* character too. If we didn't skip any blanks above, then we
* only redraw if the character wasn't already redrawn anyway.
*/
if (gui.in_use && (col > startCol || !redraw_this)
# ifdef FEAT_MBYTE
&& enc_dbcs == 0
# endif
)
if (gui.in_use && (col > startCol || !redraw_this))
{
hl = ScreenAttrs[off_to];
if (hl > HL_ALL || (hl & HL_BOLD))
screen_char(off_to - 1, row, col + coloff - 1);
{
int prev_cells = 1;
# ifdef FEAT_MBYTE
if (enc_utf8)
/* for utf-8, ScreenLines[char_offset + 1] == 0 means
* that its width is 2. */
prev_cells = ScreenLines[off_to - 1] == 0 ? 2 : 1;
else if (enc_dbcs != 0)
{
/* find previous character by counting from first
* column and get its width. */
unsigned off = LineOffset[row];
while (off < off_to)
{
prev_cells = (*mb_off2cells)(off);
off += prev_cells;
}
}
if (enc_dbcs != 0 && prev_cells > 1)
screen_char_2(off_to - prev_cells, row,
col + coloff - prev_cells);
else
# endif
screen_char(off_to - prev_cells, row,
col + coloff - prev_cells);
}
}
#endif
screen_fill(row, row + 1, col + coloff, clear_width + coloff,

View File

@ -977,6 +977,7 @@ syn_update_ends(startofline)
{
stateitem_T *cur_si;
int i;
int seen_keepend;
if (startofline)
{
@ -1002,7 +1003,10 @@ syn_update_ends(startofline)
/*
* Need to update the end of a start/skip/end that continues from the
* previous line. And regions that have "keepend", because they may
* influence contained items.
* influence contained items. If we've just removed "extend"
* (startofline == 0) then we should update ends of normal regions
* contained inside "keepend" because "extend" could have extended
* these "keepend" regions as well as contained normal regions.
* Then check for items ending in column 0.
*/
i = current_state.ga_len - 1;
@ -1010,10 +1014,13 @@ syn_update_ends(startofline)
for ( ; i > keepend_level; --i)
if (CUR_STATE(i).si_flags & HL_EXTEND)
break;
seen_keepend = FALSE;
for ( ; i < current_state.ga_len; ++i)
{
cur_si = &CUR_STATE(i);
if ((cur_si->si_flags & HL_KEEPEND)
|| (seen_keepend && !startofline)
|| (i == current_state.ga_len - 1 && startofline))
{
cur_si->si_h_startpos.col = 0; /* start highl. in col 0 */
@ -1021,6 +1028,9 @@ syn_update_ends(startofline)
if (!(cur_si->si_flags & HL_MATCHCONT))
update_si_end(cur_si, (int)current_col, !startofline);
if (!startofline && (cur_si->si_flags & HL_KEEPEND))
seen_keepend = TRUE;
}
}
check_keepend();
@ -2564,6 +2574,7 @@ check_keepend()
{
int i;
lpos_T maxpos;
lpos_T maxpos_h;
stateitem_T *sip;
/*
@ -2583,23 +2594,30 @@ check_keepend()
break;
maxpos.lnum = 0;
maxpos_h.lnum = 0;
for ( ; i < current_state.ga_len; ++i)
{
sip = &CUR_STATE(i);
if (maxpos.lnum != 0)
{
limit_pos_zero(&sip->si_m_endpos, &maxpos);
limit_pos_zero(&sip->si_h_endpos, &maxpos);
limit_pos_zero(&sip->si_h_endpos, &maxpos_h);
limit_pos_zero(&sip->si_eoe_pos, &maxpos);
sip->si_ends = TRUE;
}
if (sip->si_ends
&& (sip->si_flags & HL_KEEPEND)
&& (maxpos.lnum == 0
if (sip->si_ends && (sip->si_flags & HL_KEEPEND))
{
if (maxpos.lnum == 0
|| maxpos.lnum > sip->si_m_endpos.lnum
|| (maxpos.lnum == sip->si_m_endpos.lnum
&& maxpos.col > sip->si_m_endpos.col)))
maxpos = sip->si_m_endpos;
&& maxpos.col > sip->si_m_endpos.col))
maxpos = sip->si_m_endpos;
if (maxpos_h.lnum == 0
|| maxpos_h.lnum > sip->si_h_endpos.lnum
|| (maxpos_h.lnum == sip->si_h_endpos.lnum
&& maxpos_h.col > sip->si_h_endpos.col))
maxpos_h = sip->si_h_endpos;
}
}
}

View File

@ -666,6 +666,32 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
125,
/**/
124,
/**/
123,
/**/
122,
/**/
121,
/**/
120,
/**/
119,
/**/
118,
/**/
117,
/**/
116,
/**/
115,
/**/
114,
/**/
113,
/**/
112,
/**/
@ -955,7 +981,11 @@ list_version()
/* Only MS VC 4.1 and earlier can do Win32s */
MSG_PUTS(_("\nMS-Windows 16/32 bit GUI version"));
# else
# ifdef _WIN64
MSG_PUTS(_("\nMS-Windows 64 bit GUI version"));
# else
MSG_PUTS(_("\nMS-Windows 32 bit GUI version"));
# endif
# endif
if (gui_is_win32s())
MSG_PUTS(_(" in Win32s mode"));