Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/harish2704/nerdcommenter:
  Add support for the meson build system. (preservim#289)
  Add multi-line comments for Elm (preservim#283)
  Fix removing space when uncommenting spaced AltDelims multipart comment (preservim#286)
  Add gitignore support (preservim#284)
  • Loading branch information
harish2704 committed Mar 11, 2017
2 parents 48cbf0b + 41e6868 commit 21774ba
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions plugin/NERD_commenter.vim
Expand Up @@ -159,7 +159,7 @@ let s:delimiterMap = {
\ 'eiffel': { 'left': '--' },
\ 'elf': { 'left': "'" },
\ 'elixir': { 'left': '#' },
\ 'elm': { 'left': '--' },
\ 'elm': { 'left': '--', 'leftAlt': '{--', 'rightAlt': '--}' },
\ 'elmfilt': { 'left': '#' },
\ 'ember-script': { 'left': '#' },
\ 'emblem': { 'left': '/' },
Expand Down Expand Up @@ -193,6 +193,7 @@ let s:delimiterMap = {
\ 'gentoo-package-use': { 'left': '#' },
\ 'gitcommit': { 'left': '#' },
\ 'gitconfig': { 'left': ';' },
\ 'gitignore': { 'left': '#' },
\ 'gitrebase': { 'left': '#' },
\ 'gnuplot': { 'left': '#' },
\ 'go': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
Expand Down Expand Up @@ -270,6 +271,7 @@ let s:delimiterMap = {
\ 'master': { 'left': '$' },
\ 'matlab': { 'left': '%', 'leftAlt': '%{', 'rightAlt': '%}' },
\ 'mel': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'meson': { 'left': '#' },
\ 'mib': { 'left': '--' },
\ 'mips': { 'left': '#'},
\ 'mirah': {'left': '#'},
Expand Down Expand Up @@ -624,7 +626,7 @@ function s:AppendCommentToLine()

"stick the delimiters down at the end of the line. We have to format the
"comment with spaces as appropriate
execute ":normal! " . insOrApp . (isLineEmpty ? '' : ' ') . left . right
execute ":normal! " . insOrApp . (isLineEmpty ? '' : ' ') . left . right

" if there is a right delimiter then we gotta move the cursor left
" by the length of the right delimiter so we insert between the delimiters
Expand Down Expand Up @@ -1397,7 +1399,7 @@ function s:RemoveDelimiters(left, right, line)

"if the user has specified that there is a space before the right delimiter
"then check for the space and remove it if it is there
if delimsSpaced && strpart(line, rightIndx-s:lenSpaceStr, s:lenSpaceStr) == s:spaceStr && s:Multipart()
if delimsSpaced && strpart(line, rightIndx-s:lenSpaceStr, s:lenSpaceStr) == s:spaceStr && (s:Multipart() || s:AltMultipart())
let line = strpart(line, 0, rightIndx-s:lenSpaceStr) . strpart(line, rightIndx)
endif
endif
Expand All @@ -1419,7 +1421,7 @@ function s:SetupStateBeforeLineComment(topLine, bottomLine)
let state = {'foldmethod' : &foldmethod,
\'ignorecase' : &ignorecase}

" Vim's foldmethods are evaluated every time we use 'setline', which can
" Vim's foldmethods are evaluated every time we use 'setline', which can
" make commenting wide ranges of lines VERY slow. We'll change it to
" manual, do the commenting stuff and recover it later. To avoid slowing
" down commenting few lines, we avoid doing this for ranges smaller than
Expand Down Expand Up @@ -1624,7 +1626,7 @@ function s:UncommentLinesSexy(topline, bottomline)
let theLine = s:SwapOuterPlaceHoldersForMultiPartDelims(theLine)
call setline(bottomline, theLine)
endif

" remove trailing whitespaces for first and last line
if g:NERDTrimTrailingWhitespace == 1
let theLine = getline(a:bottomline)
Expand Down

0 comments on commit 21774ba

Please sign in to comment.