macvim-dev / macvim-dev/macvim

Mac ligature rendering results in slow scrolling when cursorline is not set

Đang mở
#746 2 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Vim Script
Star
7.9k
Fork
691
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Update to the latest version of MacVim and make sure to do this:

set macligature
set nocursorline
set norelativenumber

Scroll up and down using a trackpad, and make sure to use a high enough resolution screen so the lag is noticeable. To have a reproducible benchmark, you can also maximize MacVim, open a large file, and run this Ex command from the top of the file:

let g:profstart=reltime() | for i in range(1,30) | exec "normal \<C-E>" | redraw | endfor | echo reltimestr(reltime(g:profstart)) . " seconds"

This happens because in Vim, a couple commits went in to make sure cursorline (90a997987d and 1b7fefcbce) and relativenumber (bd9a53c06c) don't cause scrolling performance issues, but MacVim's ligature rendering function redraw_for_ligature is copied from the old redraw_for_cursorline which redraws the whole screen when scrolling instead of only updating the selected lines. I don't know if redraw_for_ligature can be so easily updated though, because it would require scanning the lines to see which line needs to be redrawn.

I think there's also currently a bug as a result, in that if cursorline is set, ligatures won't render correctly when you scroll because redraw_for_ligature explicitly decides not to do anything if it detects cursorline is on probably because it was relying on the old "clear everything" behavior.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu từ hàm redraw_for_ligature của MacVim và so sánh với các thay đổi của Vim trong các commit 90a997987d, 1b7fefcbce và bd9a53c06c. Tái hiện hiện tượng trễ với macligature, nocursorline và norelativenumber bằng benchmark được cung cấp trên một tệp lớn. Được xem là hoàn tất khi thao tác cuộn không còn vẽ lại toàn bộ màn hình và các ligature vẫn chính xác khi cursorline được bật.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
macos, vim
Lĩnh vực
desktop, performance
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
38/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.