mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 15:21:47 +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
@@ -765,7 +765,10 @@ yankreg_T *get_yank_register(int regname, int mode)
|
||||
if (mode == YREG_PASTE && get_clipboard(regname, ®, false)) {
|
||||
// reg is set to clipboard contents.
|
||||
return reg;
|
||||
} else if (mode != YREG_YANK && (regname == 0 || regname == '"') && y_previous != NULL) {
|
||||
} else if (mode != YREG_YANK
|
||||
&& (regname == 0 || regname == '"' || regname == '*' || regname == '+')
|
||||
&& y_previous != NULL) {
|
||||
// in case clipboard not available, paste from previous used register
|
||||
return y_previous;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user