mirror of
https://github.com/preservim/nerdcommenter.git
synced 2025-11-08 09:53:47 -05:00
Merge branch 'master' into autoload
This commit is contained in:
@@ -84,6 +84,7 @@ let s:delimiterMap = {
|
||||
\ 'bc': { 'left': '#' },
|
||||
\ 'bib': { 'left': '//' },
|
||||
\ 'bindzone': { 'left': ';' },
|
||||
\ 'bind-named': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
|
||||
\ 'blade': { 'left': '{{--', 'right': '--}}' },
|
||||
\ 'bst': { 'left': '%' },
|
||||
\ 'btm': { 'left': '::' },
|
||||
@@ -114,6 +115,7 @@ let s:delimiterMap = {
|
||||
\ 'cucumber': { 'left': '#' },
|
||||
\ 'cuda': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
|
||||
\ 'cvs': { 'left': 'CVS:' },
|
||||
\ 'cypher': { 'left': '//' },
|
||||
\ 'cython': { 'left': '# ', 'leftAlt': '#' },
|
||||
\ 'd': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
|
||||
\ 'dakota': { 'left': '#' },
|
||||
@@ -148,6 +150,7 @@ let s:delimiterMap = {
|
||||
\ 'erlang': { 'left': '%', 'leftAlt': '%%' },
|
||||
\ 'eruby': { 'left': '<%#', 'right': '%>', 'leftAlt': '<!--', 'rightAlt': '-->' },
|
||||
\ 'esmtprc': { 'left': '#' },
|
||||
\ 'exim': { 'left': '#' },
|
||||
\ 'expect': { 'left': '#' },
|
||||
\ 'exports': { 'left': '#' },
|
||||
\ 'factor': { 'left': '! ', 'leftAlt': '!# ' },
|
||||
@@ -196,6 +199,7 @@ let s:delimiterMap = {
|
||||
\ 'hbs': { 'left': '{{!-- ', 'right': ' --}}' },
|
||||
\ 'hercules': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
|
||||
\ 'hive': { 'left': '-- ' },
|
||||
\ 'hocon': { 'left': '//', 'leftAlt': '#' },
|
||||
\ 'hog': { 'left': '#' },
|
||||
\ 'hostsaccess': { 'left': '#' },
|
||||
\ 'htmlcheetah': { 'left': '##' },
|
||||
@@ -224,6 +228,8 @@ let s:delimiterMap = {
|
||||
\ 'jgraph': { 'left': '(*', 'right': '*)' },
|
||||
\ 'jinja': { 'left': '{#', 'right': '#}', 'leftAlt': '<!--', 'rightAlt': '-->' },
|
||||
\ 'jproperties': { 'left': '#' },
|
||||
\ 'jsonc': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
|
||||
\ 'jsonnet': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
|
||||
\ 'jsp': { 'left': '<%--', 'right': '--%>' },
|
||||
\ 'julia': { 'left': '# ', 'leftAlt': '#=', 'rightAlt': '=#' },
|
||||
\ 'kivy': { 'left': '#' },
|
||||
@@ -285,6 +291,7 @@ let s:delimiterMap = {
|
||||
\ 'newlisp': { 'left': ';' },
|
||||
\ 'nginx': { 'left': '#' },
|
||||
\ 'nimrod': { 'left': '#' },
|
||||
\ 'nix': { 'left': '#' },
|
||||
\ 'nroff': { 'left': '\"' },
|
||||
\ 'nsis': { 'left': '#' },
|
||||
\ 'ntp': { 'left': '#' },
|
||||
@@ -343,12 +350,13 @@ let s:delimiterMap = {
|
||||
\ 'rc': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
|
||||
\ 'rebol': { 'left': ';' },
|
||||
\ 'registry': { 'left': ';' },
|
||||
\ 'rego': { 'left': '#' },
|
||||
\ 'remind': { 'left': '#' },
|
||||
\ 'renpy': { 'left': '# ' },
|
||||
\ 'resolv': { 'left': '#' },
|
||||
\ 'rgb': { 'left': '!' },
|
||||
\ 'rib': { 'left': '#' },
|
||||
\ 'rmd': { 'left': '<!--', 'right': '-->', 'leftalt': '#' },
|
||||
\ 'rmd': { 'left': '<!--', 'right': '-->', 'leftAlt': '#' },
|
||||
\ 'robot': { 'left': '#' },
|
||||
\ 'robots': { 'left': '#' },
|
||||
\ 'rspec': { 'left': '#' },
|
||||
@@ -439,6 +447,7 @@ let s:delimiterMap = {
|
||||
\ 'typescript': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
|
||||
\ 'typescriptreact': { 'left': '//', 'leftAlt': '{/*', 'rightAlt': '*/}' },
|
||||
\ 'uc': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
|
||||
\ 'uc4': { 'left': '!' },
|
||||
\ 'uil': { 'left': '!' },
|
||||
\ 'upstart': { 'left': '#' },
|
||||
\ 'vala': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
|
||||
@@ -696,7 +705,7 @@ function s:CommentBlock(top, bottom, lSide, rSide, forceNested )
|
||||
"alternative delimiters (if THEY are) as the comment will be better and more
|
||||
"accurate with multipart delimiters
|
||||
let switchedDelims = 0
|
||||
if !s:Multipart() && g:NERDAllowAnyVisualDelims && s:AltMultipart()
|
||||
if !s:Multipart() && !g:NERDAllowAnyVisualDelims && s:AltMultipart()
|
||||
let switchedDelims = 1
|
||||
call s:SwitchToAlternativeDelimiters(0)
|
||||
endif
|
||||
@@ -734,7 +743,9 @@ function s:CommentBlock(top, bottom, lSide, rSide, forceNested )
|
||||
|
||||
if s:Multipart()
|
||||
"stick the right delimiter down
|
||||
let theLine = strpart(theLine, 0, rSide+strlen(leftSpaced)) . rightSpaced . strpart(theLine, rSide+strlen(leftSpaced))
|
||||
"byte idx of the char next to the last char = (byte idx of last char + 1) + (last char byte len) - 1
|
||||
let rIndex = (rSide+strlen(leftSpaced)) + strlen(strcharpart(strpart(theLine, rSide+strlen(leftSpaced)-1), 0, 1)) - 1
|
||||
let theLine = strpart(theLine, 0, rIndex) . rightSpaced . strpart(theLine, rIndex)
|
||||
|
||||
let firstLeftDelim = s:FindDelimiterIndex(s:Left(), theLine)
|
||||
let lastRightDelim = s:LastIndexOfDelim(s:Right(), theLine)
|
||||
@@ -2142,7 +2153,7 @@ endfunction
|
||||
" Function: s:Esc(str)
|
||||
" Escapes all the tricky chars in the given string
|
||||
function s:Esc(str)
|
||||
let charsToEsc = '*/\."&$+'
|
||||
let charsToEsc = '*/\."&$+[]'
|
||||
return escape(a:str, charsToEsc)
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user