summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--compiler/coffee.vim4
-rw-r--r--ftplugin/latex-box/motion.vim39
-rw-r--r--indent/html.vim18
3 files changed, 41 insertions, 20 deletions
diff --git a/compiler/coffee.vim b/compiler/coffee.vim
index f521ca9e..a70fa64c 100644
--- a/compiler/coffee.vim
+++ b/compiler/coffee.vim
@@ -27,8 +27,8 @@ function! s:GetMakePrg()
\ ' -c' .
\ ' ' . b:coffee_litcoffee .
\ ' ' . g:coffee_make_options .
- \ ' ' . fnameescape(expand('%')) .
- \ ' $*'
+ \ ' $*' .
+ \ ' ' . fnameescape(expand('%'))
endfunction
" Set `makeprg` and return 1 if coffee is still the compiler, else return 0.
diff --git a/ftplugin/latex-box/motion.vim b/ftplugin/latex-box/motion.vim
index fea4e5f2..72481753 100644
--- a/ftplugin/latex-box/motion.vim
+++ b/ftplugin/latex-box/motion.vim
@@ -312,7 +312,7 @@ function! s:ReadTOC(auxfile, texfile, ...)
if included != ''
" append the input TOX to `toc` and `fileindices`
let newaux = prefix . '/' . included
- let newtex = fnamemodify(fnamemodify(newaux, ':t:r') . '.tex', ':p')
+ let newtex = fnamemodify(newaux, ':r') . '.tex'
call s:ReadTOC(newaux, newtex, toc, fileindices)
continue
endif
@@ -441,23 +441,26 @@ function! s:FindClosestSection(toc, fileindices)
endif
let imax = len(a:fileindices[file])
- let imin = 0
- while imin < imax - 1
- let i = (imax + imin) / 2
- let tocindex = a:fileindices[file][i]
- let entry = a:toc[tocindex]
- let titlestr = entry['text']
- let titlestr = escape(titlestr, '\')
- let titlestr = substitute(titlestr, ' ', '\\_\\s\\+', 'g')
- let [lnum, cnum] = searchpos('\\' . entry['level'] . '\_\s*{' . titlestr . '}', 'nW')
- if lnum
- let imax = i
- else
- let imin = i
- endif
- endwhile
-
- return a:fileindices[file][imin]
+ if imax > 0
+ let imin = 0
+ while imin < imax - 1
+ let i = (imax + imin) / 2
+ let tocindex = a:fileindices[file][i]
+ let entry = a:toc[tocindex]
+ let titlestr = entry['text']
+ let titlestr = escape(titlestr, '\')
+ let titlestr = substitute(titlestr, ' ', '\\_\\s\\+', 'g')
+ let [lnum, cnum] = searchpos('\\' . entry['level'] . '\_\s*{' . titlestr . '}', 'nW')
+ if lnum
+ let imax = i
+ else
+ let imin = i
+ endif
+ endwhile
+ return a:fileindices[file][imin]
+ else
+ return 0
+ endif
endfunction
let s:ConvBackPats = map([
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