From 96d4463692507910bab339b3ed9d27289c097f0e Mon Sep 17 00:00:00 2001 From: Jonathan Palardy Date: Wed, 18 Apr 2012 23:30:02 -0400 Subject: [PATCH] revert to -X stuff Would be much better if readreg/paste worked instead. We wouldn't have to bend over backwards into escaping things to make the shell happy. Make my day, find a fix :-) closes #12 --- plugin/slime.vim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugin/slime.vim b/plugin/slime.vim index 3efd854..7573c47 100644 --- a/plugin/slime.vim +++ b/plugin/slime.vim @@ -1,3 +1,4 @@ + if exists('g:loaded_slime') || &cp || v:version < 700 finish endif @@ -16,8 +17,8 @@ end """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" function! s:ScreenSend(config, text) - call system("screen -S " . shellescape(a:config["sessionname"]) . " -p " . shellescape(a:config["windowname"]) . " -X readreg a -", a:text) - call system("screen -S " . shellescape(a:config["sessionname"]) . " -p " . shellescape(a:config["windowname"]) . " -X paste a") + let escaped_text = substitute(shellescape(a:text), "\\\\\\n", "\n", "g") + call system("screen -S " . shellescape(a:config["sessionname"]) . " -p " . shellescape(a:config["windowname"]) . " -X stuff " . escaped_text) endfunction function! s:ScreenSessionNames(A,L,P) @@ -49,7 +50,7 @@ endfunction function! s:TmuxConfig() abort if !exists("b:slime_config") - let b:slime_config = { "socket_name": "default", "target_pane": ":"} + let b:slime_config = {"socket_name": "default", "target_pane": ":"} end let b:slime_config["socket_name"] = input("tmux socket name: ", b:slime_config["socket_name"]) @@ -188,3 +189,4 @@ if !exists("g:slime_no_mappings") || !g:slime_no_mappings nmap v SlimeConfig endif endif +