Skip to content

Commit e9799b9

Browse files
committed
add variable to toggle buffer
1 parent 0ac3393 commit e9799b9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

ftplugin/supercollider.vim

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ if exists("g:scSplitSize")
7878
let s:scSplitSize = g:scSplitSize
7979
endif
8080

81+
82+
let s:scTerminalBuffer = "off"
83+
if exists("g:scTerminalBuffer")
84+
let s:scTerminalBuffer = g:scTerminalBuffer
85+
endif
86+
8187
" ========================================================================================
8288

8389
function! FindOuterMostBlock()
@@ -219,6 +225,10 @@ endfunction
219225

220226
let s:sclangStarted = 0
221227

228+
function s:TerminalEnabled()
229+
return exists(":term") && (s:scTerminalBuffer == "on")
230+
endfunction
231+
222232
function s:KillSClangBuffer()
223233
if bufexists(bufname('start_pipe'))
224234
exec 'bd! start_pipe'
@@ -246,7 +256,7 @@ function SClangStart(...)
246256
call system("screen -S " . l:screenName . " -X resize " . l:splitSize . '%')
247257
call system("screen -S " . l:screenName . " -X bindkey -k k5")
248258
endif
249-
elseif exists(":term")
259+
elseif s:TerminalEnabled()
250260
let l:term = ":term "
251261
if !has("nvim")
252262
let l:term .= "++curwin ++close "

0 commit comments

Comments
 (0)