summaryrefslogtreecommitdiffstats
path: root/autoload/RstFold.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2019-03-04 09:15:44 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2019-03-04 09:15:44 +0100
commited677c34d55a0e025b7008f29419498a3989cde2 (patch)
tree62efef78ed05b2b4e61efb21e40a6b337359eb8e /autoload/RstFold.vim
parentc161994e9607399a7b365ab274592bfc4f100306 (diff)
downloadvim-polyglot-ed677c34d55a0e025b7008f29419498a3989cde2.tar.gz
vim-polyglot-ed677c34d55a0e025b7008f29419498a3989cde2.zip
Update
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