Skip to content

Commit

Permalink
fix: handle too long file names
Browse files Browse the repository at this point in the history
refer: #3001
  • Loading branch information
lervag committed Sep 23, 2024
1 parent 2747dec commit b9cc115
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions autoload/vimtex/cache.vim
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,14 @@ function! s:local_name(name) abort " {{{1
let l:filename = substitute(l:filename, '\/', '%', 'g')
let l:filename = substitute(l:filename, '\\', '%', 'g')
let l:filename = substitute(l:filename, ':', '%', 'g')

" We can't save cache files with too long names. This is not a rigorous fix,
" but I think it should handle most relevant cases well enough.
" See: https://github.com/lervag/vimtex/issues/3001
if strlen(l:filename) > 200
let l:filename = '%...' .. strpart(l:filename, strlen(l:filename) - 200)
endif

return a:name . l:filename
endfunction

Expand Down

0 comments on commit b9cc115

Please sign in to comment.