diff --git a/player/lua/console.lua b/player/lua/console.lua index f40762ebce..bca4fb65d6 100644 --- a/player/lua/console.lua +++ b/player/lua/console.lua @@ -1419,6 +1419,9 @@ end -- clipboard or the primary selection buffer is used (on X11 and Wayland only.) local function paste(clip) local text = get_clipboard(clip) + if selectable_items then + text = text:gsub("\r?\n", " ") + end local before_cur = line:sub(1, cursor - 1) local after_cur = line:sub(cursor) line = before_cur .. text .. after_cur @@ -1536,7 +1539,7 @@ local function get_bindings() { "ctrl+[", function() set_active(false) end }, { "enter", submit }, { "kp_enter", submit }, - { "shift+enter", function() handle_char_input("\n") end }, + { "shift+enter", function() if not selectable_items then handle_char_input("\n") end end }, { "ctrl+j", submit }, { "ctrl+m", submit }, { "bs", handle_backspace },