summaryrefslogtreecommitdiffstats
path: root/indent/rst.vim
diff options
context:
space:
mode:
Diffstat (limited to 'indent/rst.vim')
-rw-r--r--indent/rst.vim14
1 files changed, 14 insertions, 0 deletions
diff --git a/indent/rst.vim b/indent/rst.vim
index df7287ea..8e228dfe 100644
--- a/indent/rst.vim
+++ b/indent/rst.vim
@@ -20,6 +20,13 @@ endif
let s:itemization_pattern = '^\s*[-*+]\s'
let s:enumeration_pattern = '^\s*\%(\d\+\|#\)\.\s\+'
+let s:note_pattern = '^\.\. '
+
+function! s:get_paragraph_start()
+ let paragraph_mark_start = getpos("'{")[1]
+ return getline(paragraph_mark_start) =~
+ \ '\S' ? paragraph_mark_start : paragraph_mark_start + 1
+endfunction
function GetRSTIndent()
let lnum = prevnonblank(v:lnum - 1)
@@ -30,6 +37,13 @@ function GetRSTIndent()
let ind = indent(lnum)
let line = getline(lnum)
+ let psnum = s:get_paragraph_start()
+ if psnum != 0
+ if getline(psnum) =~ s:note_pattern
+ let ind = 3
+ endif
+ endif
+
if line =~ s:itemization_pattern
let ind += 2
elseif line =~ s:enumeration_pattern