mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-13 05:53:50 -05:00
Run a build and commit the results
This commit is contained in:
@@ -4,7 +4,7 @@ endif
|
||||
|
||||
"TODO print messages when on visual mode. I only see VISUAL, not the messages.
|
||||
|
||||
" Function interface phylosophy:
|
||||
" Function interface philosophy:
|
||||
"
|
||||
" - functions take arbitrary line numbers as parameters.
|
||||
" Current cursor line is only a suitable default parameter.
|
||||
@@ -60,7 +60,7 @@ let s:levelRegexpDict = {
|
||||
\ 6: '\v^######[^#]@='
|
||||
\ }
|
||||
|
||||
" Maches any header level of any type.
|
||||
" Matches any header level of any type.
|
||||
"
|
||||
" This could be deduced from `s:levelRegexpDict`, but it is more
|
||||
" efficient to have a single regexp for this.
|
||||
@@ -498,7 +498,9 @@ endfunction
|
||||
function! s:SetexToAtx(line1, line2)
|
||||
let l:originalNumLines = line('$')
|
||||
execute 'silent! ' . a:line1 . ',' . a:line2 . 'substitute/\v(.*\S.*)\n\=+$/# \1/'
|
||||
execute 'silent! ' . a:line1 . ',' . a:line2 . 'substitute/\v(.*\S.*)\n-+$/## \1/'
|
||||
|
||||
let l:changed = l:originalNumLines - line('$')
|
||||
execute 'silent! ' . a:line1 . ',' . (a:line2 - l:changed) . 'substitute/\v(.*\S.*)\n-+$/## \1'
|
||||
return l:originalNumLines - line('$')
|
||||
endfunction
|
||||
|
||||
@@ -550,7 +552,7 @@ function! s:TableFormat()
|
||||
let l:flags = (&gdefault ? '' : 'g')
|
||||
execute 's/\(:\@<!-:\@!\|[^|:-]\)//e' . l:flags
|
||||
execute 's/--/-/e' . l:flags
|
||||
Tabularize /|
|
||||
Tabularize /\(\\\)\@<!|
|
||||
" Move colons for alignment to left or right side of the cell.
|
||||
execute 's/:\( \+\)|/\1:|/e' . l:flags
|
||||
execute 's/|\( \+\):/|:\1/e' . l:flags
|
||||
@@ -658,7 +660,12 @@ endfunction
|
||||
function! s:OpenUrlUnderCursor()
|
||||
let l:url = s:Markdown_GetUrlForPosition(line('.'), col('.'))
|
||||
if l:url !=# ''
|
||||
call s:VersionAwareNetrwBrowseX(l:url)
|
||||
if l:url =~? 'http[s]\?:\/\/[[:alnum:]%\/_#.-]*'
|
||||
"Do nothing
|
||||
else
|
||||
let l:url = expand(expand('%:h').'/'.l:url)
|
||||
endif
|
||||
call s:VersionAwareNetrwBrowseX(l:url)
|
||||
else
|
||||
echomsg 'The cursor is not on a link.'
|
||||
endif
|
||||
@@ -858,19 +865,23 @@ function! s:SyntaxInclude(filetype)
|
||||
return grouplistname
|
||||
endfunction
|
||||
|
||||
function! s:IsHighlightSourcesEnabledForBuffer()
|
||||
" Enable for markdown buffers, and for liquid buffers with markdown format
|
||||
return &filetype =~# 'markdown' || get(b:, 'liquid_subtype', '') =~# 'markdown'
|
||||
endfunction
|
||||
|
||||
function! s:MarkdownRefreshSyntax(force)
|
||||
" Use != to compare &syntax's value to use the same logic run on
|
||||
" $VIMRUNTIME/syntax/synload.vim.
|
||||
"
|
||||
" vint: next-line -ProhibitEqualTildeOperator
|
||||
if &filetype =~# 'markdown' && line('$') > 1 && &syntax != 'OFF'
|
||||
if s:IsHighlightSourcesEnabledForBuffer() && line('$') > 1 && &syntax != 'OFF'
|
||||
call s:MarkdownHighlightSources(a:force)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:MarkdownClearSyntaxVariables()
|
||||
if &filetype =~# 'markdown'
|
||||
if s:IsHighlightSourcesEnabledForBuffer()
|
||||
unlet! b:mkd_included_filetypes
|
||||
endif
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user