summaryrefslogtreecommitdiffstats
path: root/autoload/RstFold.vim
diff options
context:
space:
mode:
Diffstat (limited to 'autoload/RstFold.vim')
-rw-r--r--autoload/RstFold.vim14
1 files changed, 13 insertions, 1 deletions
diff --git a/autoload/RstFold.vim b/autoload/RstFold.vim
index 558fe464..2d802842 100644
--- a/autoload/RstFold.vim
+++ b/autoload/RstFold.vim
@@ -2,9 +2,13 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rst') == -1
" Author: Antony Lee <anntzer.lee@gmail.com>
" Description: Helper functions for reStructuredText syntax folding
-" Last Modified: 2018-01-07
+" Last Modified: 2018-12-29
function s:CacheRstFold()
+ if !g:rst_fold_enabled
+ return
+ endif
+
let closure = {'header_types': {}, 'max_level': 0, 'levels': {}}
function closure.Process(match) dict
let curline = getcurpos()[1]
@@ -30,6 +34,10 @@ function s:CacheRstFold()
endfunction
function RstFold#GetRstFold()
+ if !g:rst_fold_enabled
+ return
+ endif
+
if !has_key(b:, 'RstFoldCache')
call s:CacheRstFold()
endif
@@ -41,6 +49,10 @@ function RstFold#GetRstFold()
endfunction
function RstFold#GetRstFoldText()
+ if !g:rst_fold_enabled
+ return
+ endif
+
if !has_key(b:, 'RstFoldCache')
call s:CacheRstFold()
endif