Skip to content

Commit

Permalink
revert to -X stuff
Browse files Browse the repository at this point in the history
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
jpalardy committed Apr 19, 2012
1 parent fd2e84c commit 96d4463
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions plugin/slime.vim
@@ -1,3 +1,4 @@

if exists('g:loaded_slime') || &cp || v:version < 700
finish
endif
Expand All @@ -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)
Expand Down Expand Up @@ -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"])
Expand Down Expand Up @@ -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.