Mercurial > vim
comparison src/edit.c @ 18354:9f51d0cef8da v8.1.2171
patch 8.1.2171: mouse support not always available
Commit: https://github.com/vim/vim/commit/a1cb1d1dce14dd005797590721f1bcd0e7c3b35f
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Oct 17 23:00:07 2019 +0200
patch 8.1.2171: mouse support not always available
Problem: Mouse support not always available.
Solution: Enable mouse support also in tiny version. Do not define
FEAT_MOUSE_XTERM on MS-Windows (didn't really work).
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 17 Oct 2019 23:15:04 +0200 |
parents | fe5afdc03bd2 |
children | 7dd83b5325e9 |
comparison
equal
deleted
inserted
replaced
18353:c3a0f5d3c9d4 | 18354:9f51d0cef8da |
---|---|
233 /* Check if the cursor line needs redrawing before changing State. If | 233 /* Check if the cursor line needs redrawing before changing State. If |
234 * 'concealcursor' is "n" it needs to be redrawn without concealing. */ | 234 * 'concealcursor' is "n" it needs to be redrawn without concealing. */ |
235 conceal_check_cursor_line(); | 235 conceal_check_cursor_line(); |
236 #endif | 236 #endif |
237 | 237 |
238 #ifdef FEAT_MOUSE | |
239 /* | 238 /* |
240 * When doing a paste with the middle mouse button, Insstart is set to | 239 * When doing a paste with the middle mouse button, Insstart is set to |
241 * where the paste started. | 240 * where the paste started. |
242 */ | 241 */ |
243 if (where_paste_started.lnum != 0) | 242 if (where_paste_started.lnum != 0) |
244 Insstart = where_paste_started; | 243 Insstart = where_paste_started; |
245 else | 244 else |
246 #endif | |
247 { | 245 { |
248 Insstart = curwin->w_cursor; | 246 Insstart = curwin->w_cursor; |
249 if (startln) | 247 if (startln) |
250 Insstart.col = 0; | 248 Insstart.col = 0; |
251 } | 249 } |
334 * Don't do this for "CTRL-O ." (repeat an insert): In that case we get | 332 * Don't do this for "CTRL-O ." (repeat an insert): In that case we get |
335 * here with something in the stuff buffer. | 333 * here with something in the stuff buffer. |
336 */ | 334 */ |
337 if (restart_edit != 0 && stuff_empty()) | 335 if (restart_edit != 0 && stuff_empty()) |
338 { | 336 { |
339 #ifdef FEAT_MOUSE | |
340 /* | 337 /* |
341 * After a paste we consider text typed to be part of the insert for | 338 * After a paste we consider text typed to be part of the insert for |
342 * the pasted text. You can backspace over the pasted text too. | 339 * the pasted text. You can backspace over the pasted text too. |
343 */ | 340 */ |
344 if (where_paste_started.lnum) | 341 if (where_paste_started.lnum) |
345 arrow_used = FALSE; | 342 arrow_used = FALSE; |
346 else | 343 else |
347 #endif | |
348 arrow_used = TRUE; | 344 arrow_used = TRUE; |
349 restart_edit = 0; | 345 restart_edit = 0; |
350 | 346 |
351 /* | 347 /* |
352 * If the cursor was after the end-of-line before the CTRL-O and it is | 348 * If the cursor was after the end-of-line before the CTRL-O and it is |
379 need_start_insertmode = FALSE; | 375 need_start_insertmode = FALSE; |
380 | 376 |
381 /* Need to save the line for undo before inserting the first char. */ | 377 /* Need to save the line for undo before inserting the first char. */ |
382 ins_need_undo = TRUE; | 378 ins_need_undo = TRUE; |
383 | 379 |
384 #ifdef FEAT_MOUSE | |
385 where_paste_started.lnum = 0; | 380 where_paste_started.lnum = 0; |
386 #endif | |
387 #ifdef FEAT_CINDENT | 381 #ifdef FEAT_CINDENT |
388 can_cindent = TRUE; | 382 can_cindent = TRUE; |
389 #endif | 383 #endif |
390 #ifdef FEAT_FOLDING | 384 #ifdef FEAT_FOLDING |
391 /* The cursor line is not in a closed fold, unless 'insertmode' is set or | 385 /* The cursor line is not in a closed fold, unless 'insertmode' is set or |
978 did_backspace = ins_bs(c, BACKSPACE_LINE, &inserted_space); | 972 did_backspace = ins_bs(c, BACKSPACE_LINE, &inserted_space); |
979 auto_format(FALSE, TRUE); | 973 auto_format(FALSE, TRUE); |
980 inserted_space = FALSE; | 974 inserted_space = FALSE; |
981 break; | 975 break; |
982 | 976 |
983 #ifdef FEAT_MOUSE | |
984 case K_LEFTMOUSE: /* mouse keys */ | 977 case K_LEFTMOUSE: /* mouse keys */ |
985 case K_LEFTMOUSE_NM: | 978 case K_LEFTMOUSE_NM: |
986 case K_LEFTDRAG: | 979 case K_LEFTDRAG: |
987 case K_LEFTRELEASE: | 980 case K_LEFTRELEASE: |
988 case K_LEFTRELEASE_NM: | 981 case K_LEFTRELEASE_NM: |
1015 break; | 1008 break; |
1016 | 1009 |
1017 case K_MOUSERIGHT: /* Scroll wheel right */ | 1010 case K_MOUSERIGHT: /* Scroll wheel right */ |
1018 ins_mousescroll(MSCR_RIGHT); | 1011 ins_mousescroll(MSCR_RIGHT); |
1019 break; | 1012 break; |
1020 #endif | 1013 |
1021 case K_PS: | 1014 case K_PS: |
1022 bracketed_paste(PASTE_INSERT, FALSE, NULL); | 1015 bracketed_paste(PASTE_INSERT, FALSE, NULL); |
1023 if (cmdchar == K_PS) | 1016 if (cmdchar == K_PS) |
1024 /* invoked from normal mode, bail out */ | 1017 /* invoked from normal mode, bail out */ |
1025 goto doESCkey; | 1018 goto doESCkey; |