Permalink
Browse files

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
  • Loading branch information...
1 parent fd2e84c commit 96d4463692507910bab339b3ed9d27289c097f0e @jpalardy jpalardy committed Apr 19, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 plugin/slime.vim
View
@@ -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 <c-c>v <Plug>SlimeConfig
endif
endif
+

0 comments on commit 96d4463

Please sign in to comment.