Compare commits

...

5 Commits

Author SHA1 Message Date
Bram Moolenaar
bb160a188a patch 8.0.1324: some xterm sends different mouse move codes
Problem:    Some xterm sends different mouse move codes.
Solution:   Also accept 0x80 as a move event.
2017-11-20 21:52:24 +01:00
Bram Moolenaar
73675fbc48 patch 8.0.1323: mouse events in a terminal window may cause endless loop
Problem:    Mouse events in a terminal window may cause endless loop.
Solution:   Adjust position computation.  Don't stuff a mouse event when
            coming from normal_cmd().
2017-11-20 21:49:19 +01:00
Bram Moolenaar
5bbef31949 patch 8.0.1322: textformat test isn't run
Problem:    Textformat test isn't run. (Yegappan Lakshmanan)
Solution:   Add target to the list of tests.
2017-11-19 20:38:05 +01:00
Bram Moolenaar
40e280d949 patch 8.0.1321: can't build huge version with Athena
Problem:    Can't build huge version with Athena. (Mark Kelly)
Solution:   Move including beval.h to before structs.h. Include beval.pro like
            other proto files.
2017-11-19 20:34:59 +01:00
Bram Moolenaar
7221fce8b3 patch 8.0.1320: popup test fails on GUI-only build
Problem:    Popup test fails on GUI-only build.
Solution:   Don't test balloon_split() when it's not available.
2017-11-19 20:32:49 +01:00
9 changed files with 37 additions and 11 deletions

View File

@@ -78,7 +78,6 @@ typedef struct BalloonEvalStruct
#define EVAL_OFFSET_X 15 /* displacement of beval topleft corner from pointer */
#define EVAL_OFFSET_Y 10
#include "beval.pro"
#ifdef FEAT_BEVAL_GUI
# include "gui_beval.pro"
#endif

View File

@@ -4633,7 +4633,9 @@ nv_mousescroll(cmdarg_T *cap)
{
# ifdef FEAT_TERMINAL
if (term_use_loop())
send_keys_to_term(curbuf->b_term, cap->cmdchar, TRUE);
/* This window is a terminal window, send the mouse event there.
* Set "typed" to FALSE to avoid an endless loop. */
send_keys_to_term(curbuf->b_term, cap->cmdchar, FALSE);
else
# endif
if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))

View File

@@ -201,7 +201,9 @@ void qsort(void *base, size_t elm_count, size_t elm_size, int (*cmp)(const void
/* Ugly solution for "BalloonEval" not being defined while it's used in some
* .pro files. */
# ifndef FEAT_BEVAL
# ifdef FEAT_BEVAL
# include "beval.pro"
# else
# define BalloonEval int
# endif

View File

@@ -4980,6 +4980,8 @@ check_termcode(
* add 0x08 for ALT
* add 0x10 for CTRL
* add 0x20 for mouse drag (0x40 is drag with left button)
* add 0x40 for mouse move (0x80 is move, 0x81 too)
* 0x43 (drag + release) is also move
* c == column + ' ' + 1 == column + 33
* r == row + ' ' + 1 == row + 33
*
@@ -5121,9 +5123,15 @@ check_termcode(
# endif
)
{
/* Keep the mouse_code before it's changed, so that we
* remember that it was a mouse wheel click. */
wheel_code = mouse_code;
# if defined(UNIX) && defined(FEAT_MOUSE_TTY)
if (use_xterm_mouse() > 1 && mouse_code >= 0x80)
/* mouse-move event, using MOUSE_DRAG works */
mouse_code = MOUSE_DRAG;
else
# endif
/* Keep the mouse_code before it's changed, so that we
* remember that it was a mouse wheel click. */
wheel_code = mouse_code;
}
# ifdef FEAT_MOUSE_XTERM
else if (held_button == MOUSE_RELEASE

View File

@@ -1302,9 +1302,9 @@ send_keys_to_term(term_T *term, int c, int typed)
case K_MOUSELEFT:
case K_MOUSERIGHT:
if (mouse_row < W_WINROW(curwin)
|| mouse_row >= (W_WINROW(curwin) + curwin->w_height)
|| mouse_row > (W_WINROW(curwin) + curwin->w_height)
|| mouse_col < curwin->w_wincol
|| mouse_col >= W_ENDCOL(curwin)
|| mouse_col > W_ENDCOL(curwin)
|| dragging_outside)
{
/* click or scroll outside the current window */

View File

@@ -163,6 +163,7 @@ NEW_TESTS = test_arabic.res \
test_tcl.res \
test_terminal.res \
test_terminal_fail.res \
test_textformat.res \
test_textobjects.res \
test_undo.res \
test_usercommands.res \

View File

@@ -704,6 +704,9 @@ func Test_popup_and_preview_autocommand()
endfunc
func Test_balloon_split()
if !exists('*balloon_split')
return
endif
call assert_equal([
\ 'one two three four one two three four one two thre',
\ 'e four',

View File

@@ -771,6 +771,16 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1324,
/**/
1323,
/**/
1322,
/**/
1321,
/**/
1320,
/**/
1319,
/**/

View File

@@ -1809,14 +1809,15 @@ typedef int sock_T;
/* Include option.h before structs.h, because the number of window-local and
* buffer-local options is used there. */
#include "option.h" /* options and default values */
#include "option.h" /* options and default values */
#include "beval.h" /* BalloonEval */
/* Note that gui.h is included by structs.h */
#include "structs.h" /* file that defines many structures */
#include "structs.h" /* defines many structures */
#include "alloc.h"
#include "beval.h"
/* Values for "do_profiling". */
#define PROF_NONE 0 /* profiling not started */