summaryrefslogtreecommitdiffstats
path: root/autoload/vimtex/profile.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2020-05-20 20:19:03 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2020-05-20 20:19:03 +0200
commita9cc6fd2188ddc37257c834b6f5a5fa86d0eebd5 (patch)
tree952fc9cf50a5f4c42ffb2b1c0077155bcda3e7c1 /autoload/vimtex/profile.vim
parent3c47f192b5758222a1e8055c7e08650e05d0d171 (diff)
downloadvim-polyglot-a9cc6fd2188ddc37257c834b6f5a5fa86d0eebd5.tar.gz
vim-polyglot-a9cc6fd2188ddc37257c834b6f5a5fa86d0eebd5.zip
Remove latex, fixes #484
Diffstat (limited to 'autoload/vimtex/profile.vim')
-rw-r--r--autoload/vimtex/profile.vim125
1 files changed, 0 insertions, 125 deletions
diff --git a/autoload/vimtex/profile.vim b/autoload/vimtex/profile.vim
deleted file mode 100644
index bb1db390..00000000
--- a/autoload/vimtex/profile.vim
+++ /dev/null
@@ -1,125 +0,0 @@
-if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'latex') == -1
-
-" vimtex - LaTeX plugin for Vim
-"
-" Maintainer: Karl Yngve LervÄg
-" Email: karl.yngve@gmail.com
-"
-
-function! vimtex#profile#start() abort " {{{1
- profile start prof.log
- profile func *
-endfunction
-
-" }}}1
-function! vimtex#profile#stop() abort " {{{1
- profile stop
- call s:fix_sids()
-endfunction
-
-" }}}1
-"
-function! vimtex#profile#open() abort " {{{1
- source ~/.vim/vimrc
- silent edit prof.log
-endfunction
-
-" }}}1
-function! vimtex#profile#print() abort " {{{1
- for l:line in readfile('prof.log')
- echo l:line
- endfor
- echo ''
- quit!
-endfunction
-
-" }}}1
-
-function! vimtex#profile#file(filename) abort " {{{1
- call vimtex#profile#start()
-
- execute 'silent edit' a:filename
-
- call vimtex#profile#stop()
-endfunction
-
-" }}}1
-function! vimtex#profile#command(cmd) abort " {{{1
- call vimtex#profile#start()
-
- execute a:cmd
-
- call vimtex#profile#stop()
-endfunction
-
-" }}}1
-
-function! vimtex#profile#filter(sections) abort " {{{1
- let l:lines = readfile('prof.log')
- " call filter(l:lines, 'v:val !~# ''FTtex''')
- " call filter(l:lines, 'v:val !~# ''LoadFTPlugin''')
-
- let l:new = []
- for l:sec in a:sections
- call extend(l:new, s:get_section(l:sec, l:lines))
- endfor
-
- call writefile(l:new, 'prof.log')
-endfunction
-
-" }}}1
-
-function! s:fix_sids() abort " {{{1
- let l:lines = readfile('prof.log')
- let l:new = []
- for l:line in l:lines
- let l:sid = matchstr(l:line, '\v\<SNR\>\zs\d+\ze_')
- if !empty(l:sid)
- let l:filename = map(
- \ vimtex#util#command('scriptnames'),
- \ 'split(v:val, "\\v:=\\s+")[1]')[l:sid-1]
- if l:filename =~# 'vimtex'
- let l:filename = substitute(l:filename, '^.*autoload\/', '', '')
- let l:filename = substitute(l:filename, '\.vim$', '#s:', '')
- let l:filename = substitute(l:filename, '\/', '#', 'g')
- else
- let l:filename .= ':'
- endif
- call add(l:new, substitute(l:line, '\v\<SNR\>\d+_', l:filename, 'g'))
- else
- call add(l:new, substitute(l:line, '\s\+$', '', ''))
- endif
- endfor
- call writefile(l:new, 'prof.log')
-endfunction
-
-" }}}1
-function! s:get_section(name, lines) abort " {{{1
- let l:active = 0
- let l:section = []
- for l:line in a:lines
- if l:active
- if l:line =~# '^FUNCTION' && l:line !~# a:name
- let l:active = 0
- else
- call add(l:section, l:line)
- endif
- continue
- endif
-
- if l:line =~# a:name
- call add(l:section, l:line)
- let l:active = 1
- endif
- endfor
-
- if l:active
- call add(l:section, ' ')
- endif
-
- return l:section
-endfunction
-
-" }}}1
-
-endif