Skip to content

Commit ffbec49

Browse files
authored
Merge pull request #49 from bennyyip/master
allow user to set char for newline
2 parents 4ae1772 + 48f97cd commit ffbec49

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

plugin/terminal_help.vim

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ if !exists('g:terminal_rootmarkers')
3737
let g:terminal_rootmarkers = ['.git', '.svn', '.project', '.root', '.hg']
3838
endif
3939

40+
if !exists('g:terminal_newline')
41+
let g:terminal_newline = "\r"
42+
endif
4043

4144
"----------------------------------------------------------------------
4245
" Initialize
@@ -378,7 +381,7 @@ endfunc
378381
"----------------------------------------------------------------------
379382
" command H to send
380383
"----------------------------------------------------------------------
381-
command! -nargs=* H call TerminalSend(<q-args> . "\r")
384+
command! -nargs=* H call TerminalSend(<q-args> . g:terminal_newline)
382385

383386

384387
"----------------------------------------------------------------------
@@ -540,8 +543,8 @@ function! s:runner_proc(opts)
540543
let cwd = getcwd()
541544
let cd = (has('win32') || has('win64') || has('win16'))? 'cd /D' : 'cd'
542545
let cd = get(g:, 'terminal_cd', cd)
543-
call TerminalSend(cd . ' ' . shellescape(cwd) . "\r")
544-
call TerminalSend(a:opts.cmd . "\r")
546+
call TerminalSend(cd . ' ' . shellescape(cwd) . g:terminal_newline)
547+
call TerminalSend(a:opts.cmd . g:terminal_newline)
545548
endfunc
546549

547550
let g:asyncrun_runner = get(g:, 'asyncrun_runner', {})

0 commit comments

Comments
 (0)