rkitover / vimpager

Use Vim as PAGER
http://www.vim.org/scripts/script.php?script_id=1723
Other
769 stars 72 forks source link

AnsiEsc bottleneck on large files #240

Open mortang2410 opened 5 years ago

mortang2410 commented 5 years ago

Try running journalctl with let g:vimpager.ansiesc = 0 and without it (assuming you're using systemd). Or view any really big text file. vim with AnsiEsc would choke and wait until AnsiEsc finishes. While vim alone is fast enough to read through, like, 1521561 lines of text in a few seconds.

This might seem like a stretch goal, and this scenario isn't always common, but maybe AnsiEsc should be turned off after a set number of lines to prevent this scenario.

rkitover commented 5 years ago

What you suggest is a simple enough fix, I'll try to do it shortly.

rkitover commented 5 years ago

Fixed in master, see above commit.

rkitover commented 5 years ago

I chose 1250 lines for the cutoff because it's roughly 3 seconds on modern hardware.