From 9885f226eb5b90619dd168e056d54db708bc4082 Mon Sep 17 00:00:00 2001 From: Sanjay Madan Date: Sun, 3 Jan 2021 19:19:10 -0800 Subject: [PATCH] Fix array out of bounds error * NSUInteger -1 is actually a huge positive number so testing i >= 0 to end a loop never ends it. --- src/MacVim/MMTabline/MMTabline.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MacVim/MMTabline/MMTabline.m b/src/MacVim/MMTabline/MMTabline.m index edaf674ba0..38e342e890 100644 --- a/src/MacVim/MMTabline/MMTabline.m +++ b/src/MacVim/MMTabline/MMTabline.m @@ -530,7 +530,7 @@ - (void)scrollTabToVisibleAtIndex:(NSUInteger)index - (void)scrollLeftOneTab { NSRect clipBounds = _scrollView.contentView.bounds; - for (NSUInteger i = _tabs.count - 1; i >= 0; i--) { + for (NSInteger i = _tabs.count - 1; i >= 0; i--) { NSRect tabFrame = _tabs[i].frame; if (!NSContainsRect(clipBounds, tabFrame)) { if (NSMinX(tabFrame) < NSMinX(clipBounds)) {