mirror of
https://github.com/neovim/neovim.git
synced 2025-09-19 09:48:19 +00:00
clipboard: handle middle-click paste correctly.
Also handle clipboard errors more like vim: paste from unnamed register if clipboard provider fails.
This commit is contained in:

committed by
Justin M. Keyes

parent
0e39b2c936
commit
c30f2ac25d
@@ -2016,6 +2016,9 @@ do_mouse (
|
||||
if (regname == '.')
|
||||
insert_reg(regname, true);
|
||||
else {
|
||||
if (regname == 0 && eval_has_provider("clipboard")) {
|
||||
regname = '*';
|
||||
}
|
||||
if ((State & REPLACE_FLAG) && !yank_register_mline(regname))
|
||||
insert_reg(regname, true);
|
||||
else {
|
||||
@@ -2279,6 +2282,9 @@ do_mouse (
|
||||
* Middle mouse click: Put text before cursor.
|
||||
*/
|
||||
if (which_button == MOUSE_MIDDLE) {
|
||||
if (regname == 0 && eval_has_provider("clipboard")) {
|
||||
regname = '*';
|
||||
}
|
||||
if (yank_register_mline(regname)) {
|
||||
if (mouse_past_bottom)
|
||||
dir = FORWARD;
|
||||
|
Reference in New Issue
Block a user