macvim-dev / macvim-dev/macvim

Slow buffer updates with Undotree plugin

Open
#1,420 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vim Script
Stars
7.9k
Forks
691
PR merge metrics
No merged PRs in 30d

Description

Undotree is a plugin that adds a visual representation of Vim's undo tree. When this tree view is open, certain operations (undo, redo, joining lines) are slow in the GUI, but not in the terminal.

To reproduce:

  1. Add the Undotree plugin to ~/.vim/pack/mbbill/opt/undotree so that it will be found by packadd:
mkdir -p ~/.vim/pack/mbbill/opt
git clone https://github.com/mbbill/undotree ~/.vim/pack/mbbill/opt
  1. Start MacVim with mvim -u vimrc where vimrc is
set nocompatible
set undofile
packadd undotree
  1. Open the undo tree visualiser added by Undotree: :UndotreeToggle
  2. Insert 100 lines: 100ii<CR><Esc>
  3. Go the first line: gg
  4. Join all the lines: Hold J

There should be noticeable lag. Now repeat steps 1-6 except with mvim -v -u vimrc in step 2. Joining the lines should be quite snappy.

I've attached two videos below showing the behaviour in each case, and I've included my system details.

GUI:

https://github.com/macvim-dev/macvim/assets/123784102/4e1828c4-4e40-4f29-9171-6c77a1b15f9e

Terminal.app:

https://github.com/macvim-dev/macvim/assets/123784102/26cc3bda-fd04-4165-9bd1-712da0132d45

System details:
OS: macOS Ventura 13.4 arm64
Shell: zsh 5.9
Terminal: Terminal.app
$TERM: xterm-256color
Vim: Downloaded from GitHub Releases

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the lag using MacVim with mvim -u vimrc, packadd undotree, and :UndotreeToggle, then compare it with mvim -v -u vimrc as described. Trace the GUI path involved during undo, redo, or joining lines; the issue is done when these operations are no longer noticeably slower with the Undotree view open.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, vim
Domain
desktop, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.