Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undo deleting a large chunk of text takes very long time #1513

Open
suzuyu1729 opened this issue Jan 8, 2023 · 0 comments
Open

Undo deleting a large chunk of text takes very long time #1513

suzuyu1729 opened this issue Jan 8, 2023 · 0 comments

Comments

@suzuyu1729
Copy link

suzuyu1729 commented Jan 8, 2023

I'm trying to use vim+ultisnips (+vimtex) as the daily LaTeX editing environment.
It's probably not so rare to have over 3000 lines in a LaTeX source file.
When I deleted a large chunk of (~3000 lines of) LaTeX source and undo it,
vim took very long time and almost looked like freezing.

Therefore, I made the following experiment (without vimtex):
Steps to reproduce

minimal.vim (I'm using vim-plug):

set nocompatible
call plug#begin()
Plug 'SirVer/ultisnips'
call plug#end()
let g:UltiSnipsSnippetDirectories=[$HOME.'/.vim/UltiSnips']

~/.vim/UltiSnips/all.snippets:

snippet (
($1)
endsnippet

Procedure of the experiment:

  1. Make a test file with 3000 repetition of

AAAAA<CR>

and save it as test.
2. Launch vim by vim -u minimal.vim test.
3. Delete all lines by <Shift>-VGx.
4. Insert (, tab-complete it and back to the normal mode by i(<Tab><Esc>.
5. Undo the above 4, 3 by uuu.

Expected behavior:
The buffer for test immediately back to the original situation, i.e. 3000 repetition of AAAAA<CR>
(This is true if we manually insert () without tab completion in Step 4.)

Actual behavior:
It takes roughly 2 mins to do the last undo of uuu in Step 5. Is this the expected amount of slowdown?


  • Operating System: MacOS Ventura 13.1
  • Vim Version (both of vim and macvim produce the issue):
    VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Sep 15 2022 19:27:32)
    macOS version - x86_64
    Included patches: 1-472
  • UltiSnips Version: e99fdf1
  • Python inside Vim: Python 3.10.9 (main, Dec 15 2022, 18:25:35) [Clang 14.0.0 (clang-1400.0.29.202)]
  • Docker repo/vimrc:
    Sorry, I am not familiar with Docker and so skipped it, but if the issue can't be reproduced easily, I will try it.
@suzuyu1729 suzuyu1729 changed the title Undo deleting large chunk of tex takes very long time Undo deleting large chunk of text takes very long time Jan 8, 2023
@suzuyu1729 suzuyu1729 changed the title Undo deleting large chunk of text takes very long time Undo deleting a large chunk of text takes very long time Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant