You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MMTabline: Use cached images for buttons, fix memory leaks and misc issues
MMHoverButton was a bit inefficient in its image management. It always
made a new template image which then had to be converted into two other
images (image and alternateImage) for every button. Cache at least the
template images with weak references so we don't have to keep generating
new ones. For now, allow setImage: to create new images but they could
be changed to also just use cached images as well.
Also, fix memory leaks in the tabs codebase due to improper closure
usage in blocks. They were subtly capturing the self pointer which led
to the tab line and hover buttons never getting destroyed. Fix to make
sure we never accidentally capture self and try to capture as little as
possible.
Another leak happens in the usage of the local event monitor that we use
to intercept scroll wheel events. The API contract mandates that we
remove the monitor which the code never does. Make sure we do that, and
fix up the logic of the event interceptor to be more resilient and works
better with third-party software (which could inject horizontal scroll
events without holding down the Shift key).
Copy file name to clipboardExpand all lines: src/MacVim/MMTabline/MMTabline.m
+77-28Lines changed: 77 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,9 @@
13
13
const CGFloat TabOverlap = 6;
14
14
const CGFloat ScrollOneTabAllowance = 0.25; // If we are showing 75+% of the tab, consider it to be fully shown when deciding whether to scroll to next tab.
0 commit comments