mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
Merge remote-tracking branch 'vim/master'
This commit is contained in:
Vendored
+75
@@ -12741,6 +12741,81 @@ _ACEOF
|
||||
fi
|
||||
done
|
||||
|
||||
for ac_header in sys/select.h sys/socket.h
|
||||
do :
|
||||
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
|
||||
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for select" >&5
|
||||
$as_echo_n "checking types of arguments for select... " >&6; }
|
||||
if ${ac_cv_func_select_args+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
for ac_arg234 in 'fd_set *' 'int *' 'void *'; do
|
||||
for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do
|
||||
for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
$ac_includes_default
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
# include <sys/select.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
extern int select ($ac_arg1,
|
||||
$ac_arg234, $ac_arg234, $ac_arg234,
|
||||
$ac_arg5);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
done
|
||||
done
|
||||
done
|
||||
# Provide a safe default value.
|
||||
: "${ac_cv_func_select_args=int,int *,struct timeval *}"
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_select_args" >&5
|
||||
$as_echo "$ac_cv_func_select_args" >&6; }
|
||||
ac_save_IFS=$IFS; IFS=','
|
||||
set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'`
|
||||
IFS=$ac_save_IFS
|
||||
shift
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define SELECT_TYPE_ARG1 $1
|
||||
_ACEOF
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define SELECT_TYPE_ARG234 ($2)
|
||||
_ACEOF
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define SELECT_TYPE_ARG5 ($3)
|
||||
_ACEOF
|
||||
|
||||
rm -f conftest*
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
|
||||
$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
|
||||
if ${ac_cv_sys_largefile_source+:} false; then :
|
||||
|
||||
@@ -113,6 +113,9 @@
|
||||
/* Define if you can safely include both <sys/time.h> and <sys/select.h>. */
|
||||
#undef SYS_SELECT_WITH_SYS_TIME
|
||||
|
||||
/* Define to a typecast for select() arguments 2, 3 and 4. */
|
||||
#undef SELECT_TYPE_ARG234
|
||||
|
||||
/* Define if you have /dev/ptc */
|
||||
#undef HAVE_DEV_PTC
|
||||
|
||||
|
||||
@@ -3806,6 +3806,7 @@ AC_CHECK_FUNCS(fchdir fchown fchmod fsync getcwd getpseudotty \
|
||||
sigprocmask sigvec strcasecmp strerror strftime stricmp strncasecmp \
|
||||
strnicmp strpbrk strtol tgetent towlower towupper iswupper \
|
||||
usleep utime utimes mblen ftruncate unsetenv)
|
||||
AC_FUNC_SELECT_ARGTYPES
|
||||
AC_FUNC_FSEEKO
|
||||
|
||||
dnl define _LARGE_FILES, _FILE_OFFSET_BITS and _LARGEFILE_SOURCE when
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ static int diff_busy = FALSE; /* ex_diffgetput() is busy */
|
||||
#define DIFF_VERTICAL 16 // vertical splits
|
||||
#define DIFF_HIDDEN_OFF 32 // diffoff when hidden
|
||||
#define DIFF_INTERNAL 64 // use internal xdiff algorithm
|
||||
static int diff_flags = DIFF_FILLER;
|
||||
static int diff_flags = DIFF_INTERNAL | DIFF_FILLER;
|
||||
|
||||
static long diff_algorithm = 0;
|
||||
|
||||
|
||||
+3
-3
@@ -1976,7 +1976,7 @@ edit_unputchar(void)
|
||||
if (pc_status == PC_STATUS_RIGHT)
|
||||
++curwin->w_wcol;
|
||||
if (pc_status == PC_STATUS_RIGHT || pc_status == PC_STATUS_LEFT)
|
||||
redrawWinline(curwin->w_cursor.lnum, FALSE);
|
||||
redrawWinline(curwin, curwin->w_cursor.lnum, FALSE);
|
||||
else
|
||||
#endif
|
||||
screen_puts(pc_bytes, pc_row - msg_scrolled, pc_col, pc_attr);
|
||||
@@ -2027,7 +2027,7 @@ undisplay_dollar(void)
|
||||
if (dollar_vcol >= 0)
|
||||
{
|
||||
dollar_vcol = -1;
|
||||
redrawWinline(curwin->w_cursor.lnum, FALSE);
|
||||
redrawWinline(curwin, curwin->w_cursor.lnum, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7094,7 +7094,7 @@ check_spell_redraw(void)
|
||||
linenr_T lnum = spell_redraw_lnum;
|
||||
|
||||
spell_redraw_lnum = 0;
|
||||
redrawWinline(lnum, FALSE);
|
||||
redrawWinline(curwin, lnum, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+26
-1
@@ -126,6 +126,10 @@ comp_botline(win_T *wp)
|
||||
set_empty_rows(wp, done);
|
||||
}
|
||||
|
||||
#ifdef FEAT_SYN_HL
|
||||
static linenr_T last_cursorline = 0;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is
|
||||
* set.
|
||||
@@ -143,7 +147,28 @@ redraw_for_cursorline(win_T *wp)
|
||||
&& !pum_visible()
|
||||
# endif
|
||||
)
|
||||
redraw_win_later(wp, SOME_VALID);
|
||||
{
|
||||
if (wp->w_p_rnu)
|
||||
// win_line() will redraw the number column only.
|
||||
redraw_win_later(wp, VALID);
|
||||
#ifdef FEAT_SYN_HL
|
||||
if (wp->w_p_cul)
|
||||
{
|
||||
if (wp->w_redr_type <= VALID && last_cursorline != 0)
|
||||
{
|
||||
// "last_cursorline" may be set for another window, worst case
|
||||
// we redraw too much. This is optimized for moving the cursor
|
||||
// around in the same window.
|
||||
redrawWinline(wp, last_cursorline, FALSE);
|
||||
redrawWinline(wp, wp->w_cursor.lnum, FALSE);
|
||||
redraw_win_later(wp, VALID);
|
||||
}
|
||||
else
|
||||
redraw_win_later(wp, SOME_VALID);
|
||||
last_cursorline = wp->w_cursor.lnum;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef FEAT_GUI_MACVIM
|
||||
|
||||
+4
-23
@@ -18,17 +18,6 @@
|
||||
* changed beyond recognition.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Some systems have a prototype for select() that has (int *) instead of
|
||||
* (fd_set *), which is wrong. This define removes that prototype. We define
|
||||
* our own prototype below.
|
||||
* Don't use it for the Mac, it causes a warning for precompiled headers.
|
||||
* TODO: use a configure check for precompiled headers?
|
||||
*/
|
||||
#if !defined(__APPLE__) && !defined(__TANDEM)
|
||||
# define select select_declared_wrong
|
||||
#endif
|
||||
|
||||
#include "vim.h"
|
||||
|
||||
#ifdef FEAT_MZSCHEME
|
||||
@@ -54,14 +43,9 @@ static int selinux_enabled = -1;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Use this prototype for select, some include files have a wrong prototype
|
||||
*/
|
||||
#ifndef __TANDEM
|
||||
#ifdef __BEOS__
|
||||
# undef select
|
||||
# ifdef __BEOS__
|
||||
# define select beos_select
|
||||
# endif
|
||||
# define select beos_select
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
@@ -77,10 +61,6 @@ static int selinux_enabled = -1;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SELECT)
|
||||
extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_MOUSE_GPM
|
||||
# include <gpm.h>
|
||||
/* <linux/keyboard.h> contains defines conflicting with "keymap.h",
|
||||
@@ -6338,7 +6318,8 @@ select_eintr:
|
||||
if (interrupted != NULL)
|
||||
*interrupted = FALSE;
|
||||
|
||||
ret = select(maxfd + 1, &rfds, &wfds, &efds, tvp);
|
||||
ret = select(maxfd + 1, SELECT_TYPE_ARG234 &rfds,
|
||||
SELECT_TYPE_ARG234 &wfds, SELECT_TYPE_ARG234 &efds, tvp);
|
||||
result = ret > 0 && FD_ISSET(fd, &rfds);
|
||||
if (result)
|
||||
--ret;
|
||||
|
||||
@@ -8,7 +8,7 @@ void redraw_buf_later(buf_T *buf, int type);
|
||||
void redraw_buf_and_status_later(buf_T *buf, int type);
|
||||
int redraw_asap(int type);
|
||||
void redraw_after_callback(int call_update_screen);
|
||||
void redrawWinline(linenr_T lnum, int invalid);
|
||||
void redrawWinline(win_T *wp, linenr_T lnum, int invalid);
|
||||
void reset_updating_screen(int may_resize_shell);
|
||||
void update_curbuf(int type);
|
||||
int update_screen(int type_arg);
|
||||
|
||||
+199
-182
@@ -132,7 +132,7 @@ static void fold_line(win_T *wp, long fold_count, foldinfo_T *foldinfo, linenr_T
|
||||
static void fill_foldcolumn(char_u *p, win_T *wp, int closed, linenr_T lnum);
|
||||
static void copy_text_attr(int off, char_u *buf, int len, int attr);
|
||||
#endif
|
||||
static int win_line(win_T *, linenr_T, int, int, int nochange);
|
||||
static int win_line(win_T *, linenr_T, int, int, int nochange, int number_only);
|
||||
static int char_needs_redraw(int off_from, int off_to, int cols);
|
||||
static void draw_vsep_win(win_T *wp, int row);
|
||||
#ifdef FEAT_STL_OPT
|
||||
@@ -500,6 +500,7 @@ redraw_after_callback(int call_update_screen)
|
||||
*/
|
||||
void
|
||||
redrawWinline(
|
||||
win_T *wp,
|
||||
linenr_T lnum,
|
||||
int invalid UNUSED) /* window line height is invalid now */
|
||||
{
|
||||
@@ -507,19 +508,19 @@ redrawWinline(
|
||||
int i;
|
||||
#endif
|
||||
|
||||
if (curwin->w_redraw_top == 0 || curwin->w_redraw_top > lnum)
|
||||
curwin->w_redraw_top = lnum;
|
||||
if (curwin->w_redraw_bot == 0 || curwin->w_redraw_bot < lnum)
|
||||
curwin->w_redraw_bot = lnum;
|
||||
redraw_later(VALID);
|
||||
if (wp->w_redraw_top == 0 || wp->w_redraw_top > lnum)
|
||||
wp->w_redraw_top = lnum;
|
||||
if (wp->w_redraw_bot == 0 || wp->w_redraw_bot < lnum)
|
||||
wp->w_redraw_bot = lnum;
|
||||
redraw_win_later(wp, VALID);
|
||||
|
||||
#ifdef FEAT_FOLDING
|
||||
if (invalid)
|
||||
{
|
||||
/* A w_lines[] entry for this lnum has become invalid. */
|
||||
i = find_wl_entry(curwin, lnum);
|
||||
i = find_wl_entry(wp, lnum);
|
||||
if (i >= 0)
|
||||
curwin->w_lines[i].wl_valid = FALSE;
|
||||
wp->w_lines[i].wl_valid = FALSE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -974,7 +975,8 @@ update_single_line(win_T *wp, linenr_T lnum)
|
||||
start_search_hl();
|
||||
prepare_search_hl(wp, lnum);
|
||||
# endif
|
||||
win_line(wp, lnum, row, row + wp->w_lines[j].wl_size, FALSE);
|
||||
win_line(wp, lnum, row, row + wp->w_lines[j].wl_size,
|
||||
FALSE, FALSE);
|
||||
# if defined(FEAT_SEARCH_EXTRA)
|
||||
end_search_hl();
|
||||
# endif
|
||||
@@ -1884,7 +1886,7 @@ win_update(win_T *wp)
|
||||
/*
|
||||
* Update a line when it is in an area that needs updating, when it
|
||||
* has changes or w_lines[idx] is invalid.
|
||||
* bot_start may be halfway a wrapped line after using
|
||||
* "bot_start" may be halfway a wrapped line after using
|
||||
* win_del_lines(), check if the current line includes it.
|
||||
* When syntax folding is being used, the saved syntax states will
|
||||
* already have been updated, we can't see where the syntax state is
|
||||
@@ -2143,7 +2145,8 @@ win_update(win_T *wp)
|
||||
/*
|
||||
* Display one line.
|
||||
*/
|
||||
row = win_line(wp, lnum, srow, wp->w_height, mod_top == 0);
|
||||
row = win_line(wp, lnum, srow, wp->w_height,
|
||||
mod_top == 0, FALSE);
|
||||
|
||||
#ifdef FEAT_FOLDING
|
||||
wp->w_lines[idx].wl_folded = FALSE;
|
||||
@@ -2180,7 +2183,14 @@ win_update(win_T *wp)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* This line does not need updating, advance to the next one */
|
||||
if (wp->w_p_rnu)
|
||||
{
|
||||
// 'relativenumber' set: The text doesn't need to be drawn, but
|
||||
// the number column nearly always does.
|
||||
(void)win_line(wp, lnum, srow, wp->w_height, TRUE, TRUE);
|
||||
}
|
||||
|
||||
// This line does not need to be drawn, advance to the next one.
|
||||
row += wp->w_lines[idx++].wl_size;
|
||||
if (row > wp->w_height) /* past end of screen */
|
||||
break;
|
||||
@@ -3061,7 +3071,8 @@ win_line(
|
||||
linenr_T lnum,
|
||||
int startrow,
|
||||
int endrow,
|
||||
int nochange UNUSED) /* not updating for changed text */
|
||||
int nochange UNUSED, // not updating for changed text
|
||||
int number_only) // only update the number column
|
||||
{
|
||||
int col = 0; /* visual column on screen */
|
||||
unsigned off; /* offset in ScreenLines/ScreenAttrs */
|
||||
@@ -3256,212 +3267,215 @@ win_line(
|
||||
row = startrow;
|
||||
screen_row = row + W_WINROW(wp);
|
||||
|
||||
/*
|
||||
* To speed up the loop below, set extra_check when there is linebreak,
|
||||
* trailing white space and/or syntax processing to be done.
|
||||
*/
|
||||
if (!number_only)
|
||||
{
|
||||
/*
|
||||
* To speed up the loop below, set extra_check when there is linebreak,
|
||||
* trailing white space and/or syntax processing to be done.
|
||||
*/
|
||||
#ifdef FEAT_LINEBREAK
|
||||
extra_check = wp->w_p_lbr;
|
||||
extra_check = wp->w_p_lbr;
|
||||
#else
|
||||
extra_check = 0;
|
||||
extra_check = 0;
|
||||
#endif
|
||||
#ifdef FEAT_SYN_HL
|
||||
if (syntax_present(wp) && !wp->w_s->b_syn_error
|
||||
if (syntax_present(wp) && !wp->w_s->b_syn_error
|
||||
# ifdef SYN_TIME_LIMIT
|
||||
&& !wp->w_s->b_syn_slow
|
||||
&& !wp->w_s->b_syn_slow
|
||||
# endif
|
||||
)
|
||||
{
|
||||
/* Prepare for syntax highlighting in this line. When there is an
|
||||
* error, stop syntax highlighting. */
|
||||
save_did_emsg = did_emsg;
|
||||
did_emsg = FALSE;
|
||||
syntax_start(wp, lnum);
|
||||
if (did_emsg)
|
||||
wp->w_s->b_syn_error = TRUE;
|
||||
else
|
||||
)
|
||||
{
|
||||
did_emsg = save_did_emsg;
|
||||
#ifdef SYN_TIME_LIMIT
|
||||
if (!wp->w_s->b_syn_slow)
|
||||
#endif
|
||||
/* Prepare for syntax highlighting in this line. When there is an
|
||||
* error, stop syntax highlighting. */
|
||||
save_did_emsg = did_emsg;
|
||||
did_emsg = FALSE;
|
||||
syntax_start(wp, lnum);
|
||||
if (did_emsg)
|
||||
wp->w_s->b_syn_error = TRUE;
|
||||
else
|
||||
{
|
||||
has_syntax = TRUE;
|
||||
extra_check = TRUE;
|
||||
did_emsg = save_did_emsg;
|
||||
#ifdef SYN_TIME_LIMIT
|
||||
if (!wp->w_s->b_syn_slow)
|
||||
#endif
|
||||
{
|
||||
has_syntax = TRUE;
|
||||
extra_check = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for columns to display for 'colorcolumn'. */
|
||||
color_cols = wp->w_p_cc_cols;
|
||||
if (color_cols != NULL)
|
||||
draw_color_col = advance_color_col(VCOL_HLC, &color_cols);
|
||||
/* Check for columns to display for 'colorcolumn'. */
|
||||
color_cols = wp->w_p_cc_cols;
|
||||
if (color_cols != NULL)
|
||||
draw_color_col = advance_color_col(VCOL_HLC, &color_cols);
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (term_show_buffer(wp->w_buffer))
|
||||
{
|
||||
extra_check = TRUE;
|
||||
get_term_attr = TRUE;
|
||||
term_attr = term_get_attr(wp->w_buffer, lnum, -1);
|
||||
}
|
||||
if (term_show_buffer(wp->w_buffer))
|
||||
{
|
||||
extra_check = TRUE;
|
||||
get_term_attr = TRUE;
|
||||
term_attr = term_get_attr(wp->w_buffer, lnum, -1);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_SPELL
|
||||
if (wp->w_p_spell
|
||||
&& *wp->w_s->b_p_spl != NUL
|
||||
&& wp->w_s->b_langp.ga_len > 0
|
||||
&& *(char **)(wp->w_s->b_langp.ga_data) != NULL)
|
||||
{
|
||||
/* Prepare for spell checking. */
|
||||
has_spell = TRUE;
|
||||
extra_check = TRUE;
|
||||
|
||||
/* Get the start of the next line, so that words that wrap to the next
|
||||
* line are found too: "et<line-break>al.".
|
||||
* Trick: skip a few chars for C/shell/Vim comments */
|
||||
nextline[SPWORDLEN] = NUL;
|
||||
if (lnum < wp->w_buffer->b_ml.ml_line_count)
|
||||
if (wp->w_p_spell
|
||||
&& *wp->w_s->b_p_spl != NUL
|
||||
&& wp->w_s->b_langp.ga_len > 0
|
||||
&& *(char **)(wp->w_s->b_langp.ga_data) != NULL)
|
||||
{
|
||||
line = ml_get_buf(wp->w_buffer, lnum + 1, FALSE);
|
||||
spell_cat_line(nextline + SPWORDLEN, line, SPWORDLEN);
|
||||
/* Prepare for spell checking. */
|
||||
has_spell = TRUE;
|
||||
extra_check = TRUE;
|
||||
|
||||
/* Get the start of the next line, so that words that wrap to the next
|
||||
* line are found too: "et<line-break>al.".
|
||||
* Trick: skip a few chars for C/shell/Vim comments */
|
||||
nextline[SPWORDLEN] = NUL;
|
||||
if (lnum < wp->w_buffer->b_ml.ml_line_count)
|
||||
{
|
||||
line = ml_get_buf(wp->w_buffer, lnum + 1, FALSE);
|
||||
spell_cat_line(nextline + SPWORDLEN, line, SPWORDLEN);
|
||||
}
|
||||
|
||||
/* When a word wrapped from the previous line the start of the current
|
||||
* line is valid. */
|
||||
if (lnum == checked_lnum)
|
||||
cur_checked_col = checked_col;
|
||||
checked_lnum = 0;
|
||||
|
||||
/* When there was a sentence end in the previous line may require a
|
||||
* word starting with capital in this line. In line 1 always check
|
||||
* the first word. */
|
||||
if (lnum != capcol_lnum)
|
||||
cap_col = -1;
|
||||
if (lnum == 1)
|
||||
cap_col = 0;
|
||||
capcol_lnum = 0;
|
||||
}
|
||||
|
||||
/* When a word wrapped from the previous line the start of the current
|
||||
* line is valid. */
|
||||
if (lnum == checked_lnum)
|
||||
cur_checked_col = checked_col;
|
||||
checked_lnum = 0;
|
||||
|
||||
/* When there was a sentence end in the previous line may require a
|
||||
* word starting with capital in this line. In line 1 always check
|
||||
* the first word. */
|
||||
if (lnum != capcol_lnum)
|
||||
cap_col = -1;
|
||||
if (lnum == 1)
|
||||
cap_col = 0;
|
||||
capcol_lnum = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* handle visual active in this window
|
||||
*/
|
||||
fromcol = -10;
|
||||
tocol = MAXCOL;
|
||||
if (VIsual_active && wp->w_buffer == curwin->w_buffer)
|
||||
{
|
||||
/* Visual is after curwin->w_cursor */
|
||||
if (LTOREQ_POS(curwin->w_cursor, VIsual))
|
||||
/*
|
||||
* handle visual active in this window
|
||||
*/
|
||||
fromcol = -10;
|
||||
tocol = MAXCOL;
|
||||
if (VIsual_active && wp->w_buffer == curwin->w_buffer)
|
||||
{
|
||||
top = &curwin->w_cursor;
|
||||
bot = &VIsual;
|
||||
}
|
||||
else /* Visual is before curwin->w_cursor */
|
||||
{
|
||||
top = &VIsual;
|
||||
bot = &curwin->w_cursor;
|
||||
}
|
||||
lnum_in_visual_area = (lnum >= top->lnum && lnum <= bot->lnum);
|
||||
if (VIsual_mode == Ctrl_V) /* block mode */
|
||||
{
|
||||
if (lnum_in_visual_area)
|
||||
/* Visual is after curwin->w_cursor */
|
||||
if (LTOREQ_POS(curwin->w_cursor, VIsual))
|
||||
{
|
||||
fromcol = wp->w_old_cursor_fcol;
|
||||
tocol = wp->w_old_cursor_lcol;
|
||||
top = &curwin->w_cursor;
|
||||
bot = &VIsual;
|
||||
}
|
||||
}
|
||||
else /* non-block mode */
|
||||
{
|
||||
if (lnum > top->lnum && lnum <= bot->lnum)
|
||||
fromcol = 0;
|
||||
else if (lnum == top->lnum)
|
||||
else /* Visual is before curwin->w_cursor */
|
||||
{
|
||||
if (VIsual_mode == 'V') /* linewise */
|
||||
top = &VIsual;
|
||||
bot = &curwin->w_cursor;
|
||||
}
|
||||
lnum_in_visual_area = (lnum >= top->lnum && lnum <= bot->lnum);
|
||||
if (VIsual_mode == Ctrl_V) /* block mode */
|
||||
{
|
||||
if (lnum_in_visual_area)
|
||||
{
|
||||
fromcol = wp->w_old_cursor_fcol;
|
||||
tocol = wp->w_old_cursor_lcol;
|
||||
}
|
||||
}
|
||||
else /* non-block mode */
|
||||
{
|
||||
if (lnum > top->lnum && lnum <= bot->lnum)
|
||||
fromcol = 0;
|
||||
else
|
||||
else if (lnum == top->lnum)
|
||||
{
|
||||
getvvcol(wp, top, (colnr_T *)&fromcol, NULL, NULL);
|
||||
if (gchar_pos(top) == NUL)
|
||||
tocol = fromcol + 1;
|
||||
}
|
||||
}
|
||||
if (VIsual_mode != 'V' && lnum == bot->lnum)
|
||||
{
|
||||
if (*p_sel == 'e' && bot->col == 0
|
||||
#ifdef FEAT_VIRTUALEDIT
|
||||
&& bot->coladd == 0
|
||||
#endif
|
||||
)
|
||||
{
|
||||
fromcol = -10;
|
||||
tocol = MAXCOL;
|
||||
}
|
||||
else if (bot->col == MAXCOL)
|
||||
tocol = MAXCOL;
|
||||
else
|
||||
{
|
||||
pos = *bot;
|
||||
if (*p_sel == 'e')
|
||||
getvvcol(wp, &pos, (colnr_T *)&tocol, NULL, NULL);
|
||||
if (VIsual_mode == 'V') /* linewise */
|
||||
fromcol = 0;
|
||||
else
|
||||
{
|
||||
getvvcol(wp, &pos, NULL, NULL, (colnr_T *)&tocol);
|
||||
++tocol;
|
||||
getvvcol(wp, top, (colnr_T *)&fromcol, NULL, NULL);
|
||||
if (gchar_pos(top) == NUL)
|
||||
tocol = fromcol + 1;
|
||||
}
|
||||
}
|
||||
if (VIsual_mode != 'V' && lnum == bot->lnum)
|
||||
{
|
||||
if (*p_sel == 'e' && bot->col == 0
|
||||
#ifdef FEAT_VIRTUALEDIT
|
||||
&& bot->coladd == 0
|
||||
#endif
|
||||
)
|
||||
{
|
||||
fromcol = -10;
|
||||
tocol = MAXCOL;
|
||||
}
|
||||
else if (bot->col == MAXCOL)
|
||||
tocol = MAXCOL;
|
||||
else
|
||||
{
|
||||
pos = *bot;
|
||||
if (*p_sel == 'e')
|
||||
getvvcol(wp, &pos, (colnr_T *)&tocol, NULL, NULL);
|
||||
else
|
||||
{
|
||||
getvvcol(wp, &pos, NULL, NULL, (colnr_T *)&tocol);
|
||||
++tocol;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Check if the character under the cursor should not be inverted */
|
||||
if (!highlight_match && lnum == curwin->w_cursor.lnum && wp == curwin
|
||||
/* Check if the character under the cursor should not be inverted */
|
||||
if (!highlight_match && lnum == curwin->w_cursor.lnum && wp == curwin
|
||||
#ifdef FEAT_GUI
|
||||
&& !gui.in_use
|
||||
&& !gui.in_use
|
||||
#endif
|
||||
)
|
||||
noinvcur = TRUE;
|
||||
)
|
||||
noinvcur = TRUE;
|
||||
|
||||
/* if inverting in this line set area_highlighting */
|
||||
if (fromcol >= 0)
|
||||
{
|
||||
area_highlighting = TRUE;
|
||||
attr = HL_ATTR(HLF_V);
|
||||
/* if inverting in this line set area_highlighting */
|
||||
if (fromcol >= 0)
|
||||
{
|
||||
area_highlighting = TRUE;
|
||||
attr = HL_ATTR(HLF_V);
|
||||
#if defined(FEAT_CLIPBOARD) && defined(FEAT_X11)
|
||||
if ((clip_star.available && !clip_star.owned
|
||||
&& clip_isautosel_star())
|
||||
|| (clip_plus.available && !clip_plus.owned
|
||||
&& clip_isautosel_plus()))
|
||||
attr = HL_ATTR(HLF_VNC);
|
||||
if ((clip_star.available && !clip_star.owned
|
||||
&& clip_isautosel_star())
|
||||
|| (clip_plus.available && !clip_plus.owned
|
||||
&& clip_isautosel_plus()))
|
||||
attr = HL_ATTR(HLF_VNC);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* handle 'incsearch' and ":s///c" highlighting
|
||||
*/
|
||||
else if (highlight_match
|
||||
&& wp == curwin
|
||||
&& lnum >= curwin->w_cursor.lnum
|
||||
&& lnum <= curwin->w_cursor.lnum + search_match_lines)
|
||||
{
|
||||
if (lnum == curwin->w_cursor.lnum)
|
||||
getvcol(curwin, &(curwin->w_cursor),
|
||||
(colnr_T *)&fromcol, NULL, NULL);
|
||||
else
|
||||
fromcol = 0;
|
||||
if (lnum == curwin->w_cursor.lnum + search_match_lines)
|
||||
/*
|
||||
* handle 'incsearch' and ":s///c" highlighting
|
||||
*/
|
||||
else if (highlight_match
|
||||
&& wp == curwin
|
||||
&& lnum >= curwin->w_cursor.lnum
|
||||
&& lnum <= curwin->w_cursor.lnum + search_match_lines)
|
||||
{
|
||||
pos.lnum = lnum;
|
||||
pos.col = search_match_endcol;
|
||||
getvcol(curwin, &pos, (colnr_T *)&tocol, NULL, NULL);
|
||||
if (lnum == curwin->w_cursor.lnum)
|
||||
getvcol(curwin, &(curwin->w_cursor),
|
||||
(colnr_T *)&fromcol, NULL, NULL);
|
||||
else
|
||||
fromcol = 0;
|
||||
if (lnum == curwin->w_cursor.lnum + search_match_lines)
|
||||
{
|
||||
pos.lnum = lnum;
|
||||
pos.col = search_match_endcol;
|
||||
getvcol(curwin, &pos, (colnr_T *)&tocol, NULL, NULL);
|
||||
}
|
||||
else
|
||||
tocol = MAXCOL;
|
||||
/* do at least one character; happens when past end of line */
|
||||
if (fromcol == tocol)
|
||||
tocol = fromcol + 1;
|
||||
area_highlighting = TRUE;
|
||||
attr = HL_ATTR(HLF_I);
|
||||
}
|
||||
else
|
||||
tocol = MAXCOL;
|
||||
/* do at least one character; happens when past end of line */
|
||||
if (fromcol == tocol)
|
||||
tocol = fromcol + 1;
|
||||
area_highlighting = TRUE;
|
||||
attr = HL_ATTR(HLF_I);
|
||||
}
|
||||
|
||||
#ifdef FEAT_DIFF
|
||||
@@ -3507,7 +3521,7 @@ win_line(
|
||||
ptr = line;
|
||||
|
||||
#ifdef FEAT_SPELL
|
||||
if (has_spell)
|
||||
if (has_spell && !number_only)
|
||||
{
|
||||
/* For checking first word with a capital skip white space. */
|
||||
if (cap_col == 0)
|
||||
@@ -3567,7 +3581,7 @@ win_line(
|
||||
v = wp->w_skipcol;
|
||||
else
|
||||
v = wp->w_leftcol;
|
||||
if (v > 0)
|
||||
if (v > 0 && !number_only)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
char_u *prev_ptr = ptr;
|
||||
@@ -3710,7 +3724,7 @@ win_line(
|
||||
*/
|
||||
cur = wp->w_match_head;
|
||||
shl_flag = FALSE;
|
||||
while (cur != NULL || shl_flag == FALSE)
|
||||
while ((cur != NULL || shl_flag == FALSE) && !number_only)
|
||||
{
|
||||
if (shl_flag == FALSE)
|
||||
{
|
||||
@@ -4071,13 +4085,16 @@ win_line(
|
||||
}
|
||||
}
|
||||
|
||||
/* When still displaying '$' of change command, stop at cursor */
|
||||
if (dollar_vcol >= 0 && wp == curwin
|
||||
// When still displaying '$' of change command, stop at cursor.
|
||||
// When only displaying the (relative) line number and that's done,
|
||||
// stop here.
|
||||
if ((dollar_vcol >= 0 && wp == curwin
|
||||
&& lnum == wp->w_cursor.lnum && vcol >= (long)wp->w_virtcol
|
||||
#ifdef FEAT_DIFF
|
||||
&& filler_todo <= 0
|
||||
#endif
|
||||
)
|
||||
|| (number_only && draw_state > WL_NR))
|
||||
{
|
||||
screen_line(screen_row, wp->w_wincol, col, -(int)wp->w_width,
|
||||
HAS_RIGHTLEFT(wp->w_p_rl));
|
||||
|
||||
@@ -809,6 +809,16 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
374,
|
||||
/**/
|
||||
373,
|
||||
/**/
|
||||
372,
|
||||
/**/
|
||||
371,
|
||||
/**/
|
||||
370,
|
||||
/**/
|
||||
369,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user