Skip to content

Commit

Permalink
Make \xx to use R_rcomment_string
Browse files Browse the repository at this point in the history
Close #49
  • Loading branch information
jalvesaq committed Aug 7, 2016
1 parent 8c33d16 commit d6476eb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions R/common_global.vim
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,9 @@ function RCommentLine(lnum, ind, cmt)
let line = getline(a:lnum)
call cursor(a:lnum, 0)

if line =~ '^\s*' . a:cmt
let line = substitute(line, '^\s*' . a:cmt . '*', '', '')
if line =~ '^\s*' . a:cmt || line =~ '^\s*#'
let line = substitute(line, '^\s*' . a:cmt, '', '')
let line = substitute(line, '^\s*#*', '', '')
call setline(a:lnum, line)
normal! ==
else
Expand All @@ -434,7 +435,7 @@ function RCommentLine(lnum, ind, cmt)
endwhile
let line = strpart(line, a:ind)
endif
let line = a:cmt . ' ' . line
let line = a:cmt . line
call setline(a:lnum, line)
if g:R_indent_commented
normal! ==
Expand All @@ -449,12 +450,12 @@ function RComment(mode)
" What comment string to use?
if g:r_indent_ess_comments
if g:R_indent_commented
let cmt = '##'
let cmt = '## '
else
let cmt = '###'
let cmt = '### '
endif
else
let cmt = '#'
let cmt = g:R_rcomment_string
endif
if (&filetype == "rnoweb" || &filetype == "rhelp") && IsLineInRCode(0, fline) == 0
let cmt = "%"
Expand Down

0 comments on commit d6476eb

Please sign in to comment.