Merge remote-tracking branch 'vim/master'

This commit is contained in:
Kazuki Sakamoto
2017-08-16 20:45:42 -07:00
10 changed files with 78 additions and 9 deletions
+14
View File
@@ -9038,6 +9038,20 @@ A jump table for the options with a short description can be found at |Q_op|.
large number, it will cause errors when opening more than a few
windows. A value of 0 to 12 is reasonable.
*'winptydll'*
'winptydll' string (default "winpty32.dll" or "winpty64.dll")
global
{not in Vi}
{only available when compiled with the |terminal|
feature on MS-Windows}
Specifies the name of the winpty shared library, used for the
|:terminal| command. The default depends on whether was build as a
32-bit or 64-bit executable. If not found, "win32pty.dll" is tried as
a fallback.
Environment variables are expanded |:set_env|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
*'winwidth'* *'wiw'* *E592*
'winwidth' 'wiw' number (default 20)
global
+5 -2
View File
@@ -9432,7 +9432,7 @@ ins_mousescroll(int dir)
{
pos_T tpos;
# if defined(FEAT_WINDOWS)
win_T *old_curwin = curwin;
win_T *old_curwin = curwin, *wp;
# endif
# ifdef FEAT_INS_EXPAND
int did_scroll = FALSE;
@@ -9452,7 +9452,10 @@ ins_mousescroll(int dir)
col = mouse_col;
/* find the window at the pointer coordinates */
curwin = mouse_find_win(&row, &col);
wp = mouse_find_win(&row, &col);
if (wp == NULL)
return;
curwin = wp;
curbuf = curwin->w_buffer;
}
if (curwin == old_curwin)
+2
View File
@@ -4389,6 +4389,8 @@ f_getchar(typval_T *argvars, typval_T *rettv)
/* Find the window at the mouse coordinates and compute the
* text position. */
win = mouse_find_win(&row, &col);
if (win == NULL)
return;
(void)mouse_comp_pos(win, &row, &col, &lnum);
# ifdef FEAT_WINDOWS
for (wp = firstwin; wp != win; wp = wp->w_next)
+3 -1
View File
@@ -4982,7 +4982,7 @@ gui_mouse_correct(void)
}
/*
* Find window where the mouse pointer "y" coordinate is in.
* Find window where the mouse pointer "x" / "y" coordinate is in.
*/
static win_T *
xy2win(int x UNUSED, int y UNUSED)
@@ -5006,6 +5006,8 @@ xy2win(int x UNUSED, int y UNUSED)
return NULL;
# endif
wp = mouse_find_win(&row, &col);
if (wp == NULL)
return NULL;
# ifdef FEAT_MOUSESHAPE
if (State == HITRETURN || State == ASKMORE)
{
+11 -2
View File
@@ -1308,6 +1308,12 @@ normal_end:
}
#endif
#ifdef FEAT_TERMINAL
/* don't go to Insert mode from Terminal-Job mode */
if (term_use_loop())
restart_edit = 0;
#endif
/*
* May restart edit(), if we got here with CTRL-O in Insert mode (but not
* if still inside a mapping that started in Visual mode).
@@ -4629,7 +4635,7 @@ nv_mousescroll(cmdarg_T *cap)
int scroll_wheel_force = 0;
# endif
# ifdef FEAT_WINDOWS
win_T *old_curwin = curwin;
win_T *old_curwin = curwin, *wp;
if (mouse_row >= 0 && mouse_col >= 0)
{
@@ -4639,7 +4645,10 @@ nv_mousescroll(cmdarg_T *cap)
col = mouse_col;
/* find the window at the pointer coordinates */
curwin = mouse_find_win(&row, &col);
wp = mouse_find_win(&row, &col);
if (wp == NULL)
return;
curwin = wp;
curbuf = curwin->w_buffer;
}
# endif
+14
View File
@@ -3195,6 +3195,20 @@ static struct vimoption options[] =
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)1L, (char_u *)0L} SCRIPTID_INIT},
{"winptydll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
#if defined(WIN3264) && defined(TERMINAL)
(char_u *)&p_winptydll, PV_NONE, {
# ifdef _WIN64
(char_u *)"winpty64.dll",
# else
(char_u *)"winpty32.dll",
# endif
(char_u *)0L}
#else
(char_u *)NULL, PV_NONE,
{(char_u *)0L, (char_u *)0L}
#endif
SCRIPTID_INIT},
{"winwidth", "wiw", P_NUM|P_VI_DEF,
#ifdef FEAT_WINDOWS
(char_u *)&p_wiw, PV_NONE,
+3
View File
@@ -989,6 +989,9 @@ EXTERN long p_wmh; /* 'winminheight' */
EXTERN long p_wmw; /* 'winminwidth' */
EXTERN long p_wiw; /* 'winwidth' */
#endif
#if defined(WIN3264) && defined(TERMINAL)
EXTERN char_u *p_winptydll; /* 'winptydll' */
#endif
EXTERN int p_ws; /* 'wrapscan' */
EXTERN int p_write; /* 'write' */
EXTERN int p_wa; /* 'writeany' */
+8 -3
View File
@@ -38,6 +38,7 @@
* in tl_scrollback are no longer used.
*
* TODO:
* - make [range]terminal pipe [range] lines to the terminal
* - implement term_setsize()
* - add test for giving error for invalid 'termsize' value.
* - support minimal size when 'termsize' is "rows*cols".
@@ -2773,11 +2774,15 @@ dyn_winpty_init(void)
/* No need to initialize twice. */
if (hWinPtyDLL)
return 1;
/* Load winpty.dll */
hWinPtyDLL = vimLoadLib(WINPTY_DLL);
/* Load winpty.dll, prefer using the 'winptydll' option, fall back to just
* winpty.dll. */
if (*p_winptydll != NUL)
hWinPtyDLL = vimLoadLib((char *)p_winptydll);
if (!hWinPtyDLL)
hWinPtyDLL = vimLoadLib(WINPTY_DLL);
if (!hWinPtyDLL)
{
EMSG2(_(e_loadlib), WINPTY_DLL);
EMSG2(_(e_loadlib), *p_winptydll != NUL ? p_winptydll : WINPTY_DLL);
return 0;
}
for (i = 0; winpty_entry[i].name != NULL
+12 -1
View File
@@ -2729,6 +2729,8 @@ retnomove:
#ifdef FEAT_WINDOWS
/* find the window where the row is in */
wp = mouse_find_win(&row, &col);
if (wp == NULL)
return IN_UNKNOWN;
#else
wp = firstwin;
#endif
@@ -3137,11 +3139,13 @@ mouse_comp_pos(
/*
* Find the window at screen position "*rowp" and "*colp". The positions are
* updated to become relative to the top-left of the window.
* Returns NULL when something is wrong.
*/
win_T *
mouse_find_win(int *rowp, int *colp UNUSED)
{
frame_T *fp;
win_T *wp;
fp = topframe;
*rowp -= firstwin->w_winrow;
@@ -3168,7 +3172,12 @@ mouse_find_win(int *rowp, int *colp UNUSED)
}
}
}
return fp->fr_win;
/* When using a timer that closes a window the window might not actually
* exist. */
FOR_ALL_WINDOWS(wp)
if (wp == fp->fr_win)
return wp;
return NULL;
}
#endif
@@ -3192,6 +3201,8 @@ get_fpos_of_mouse(pos_T *mpos)
#ifdef FEAT_WINDOWS
/* find the window where the row is in */
wp = mouse_find_win(&row, &col);
if (wp == NULL)
return IN_UNKNOWN;
#else
wp = firstwin;
#endif
+6
View File
@@ -784,6 +784,12 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
949,
/**/
948,
/**/
947,
/**/
946,
/**/