From eaa63c7d7ce50acb7578f7ae8f4dd9b8f1ecd4be Mon Sep 17 00:00:00 2001 From: somini Date: Sun, 17 Dec 2017 00:37:19 +0000 Subject: [PATCH] Make surroundings function public Integrate #51 --- autoload/commentary.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/commentary.vim b/autoload/commentary.vim index c9324a1..b0d7609 100644 --- a/autoload/commentary.vim +++ b/autoload/commentary.vim @@ -1,4 +1,4 @@ -function! s:surroundings() abort +function! commentary#surroundings() abort return split(get(b:, 'commentary_format', substitute(substitute( \ &commentstring, '\S\zs%s',' %s','') ,'%s\ze\S', '%s ', '')), '%s', 1) endfunction @@ -21,7 +21,7 @@ function! commentary#go(type,...) abort let [lnum1, lnum2] = [line("'["), line("']")] endif - let [l, r] = s:surroundings() + let [l, r] = commentary#surroundings() let uncomment = 2 for lnum in range(lnum1,lnum2) let line = matchstr(getline(lnum),'\S.*\s\@