Skip to content

Instantly share code, notes, and snippets.

@chrisbra
Created February 11, 2015 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisbra/1832a5eece434ee1616c to your computer and use it in GitHub Desktop.
Save chrisbra/1832a5eece434ee1616c to your computer and use it in GitHub Desktop.
diff --git a/plugin/commentary.vim b/plugin/commentary.vim
index a91cd71..e364a5f 100644
--- a/plugin/commentary.vim
+++ b/plugin/commentary.vim
@@ -24,6 +24,10 @@ function! s:go(type,...) abort
let uncomment = 2
for lnum in range(lnum1,lnum2)
let line = matchstr(getline(lnum),'\S.*\s\@<!')
+ if stridx(line,l) == -1 && stridx(line,l[0:-2])==0 && line[strlen(line)-strlen(r[1:]):-1]==r[1:]
+ let l = l[0:-2]
+ let r = r[1:]
+ endif
if line != '' && (stridx(line,l) || line[strlen(line)-strlen(r) : -1] != r)
let uncomment = 0
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment