summaryrefslogtreecommitdiffstats
path: root/indent/html.vim
diff options
context:
space:
mode:
Diffstat (limited to 'indent/html.vim')
-rw-r--r--indent/html.vim18
1 files changed, 18 insertions, 0 deletions
diff --git a/indent/html.vim b/indent/html.vim
index a4cd0c49..6c30555d 100644
--- a/indent/html.vim
+++ b/indent/html.vim
@@ -331,6 +331,24 @@ fun! HtmlIndentGet(lnum)
let ind = ind - 1
endif
+ if getline(a:lnum) =~ '<p\>'
+ let block_start = search('^'.repeat(' ', ind * &sw).'\S' , 'bnW')
+ let prev_tag = search('<p\>', 'bW', block_start)
+ let prev_closetag = search('</p\>', 'W', a:lnum)
+ if prev_tag && !prev_closetag
+ let ind = ind - 1
+ endif
+ endif
+
+ if getline(a:lnum) =~ '</\w\+>'
+ let block_start = search('^'.repeat(' ', ind * &sw).'\S' , 'bnW')
+ let prev_tag = search('<p\>', 'bW', block_start)
+ let prev_closetag = search('</p\>', 'W', a:lnum)
+ if prev_tag && !prev_closetag
+ let ind = ind - 1
+ endif
+ endif
+
if restore_ic == 0
setlocal noic
endif