Skip to content

Commit af215e4

Browse files
authored
Merge pull request #1447 from ychin/whats-new-show-prerelease
Allow showing pre-release in What's New page
2 parents 8aa089e + 1adcde6 commit af215e4

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

src/MacVim/MMAppController.m

+9-13
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,8 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification
504504
NSArray<NSString*> *currentVersionItems = [currentVersion componentsSeparatedByString:@"."];
505505
// Compare two arrays lexographically. We just assume that version
506506
// numbers are also X.Y.Z… with no "beta" etc texts.
507-
bool currentVersionLarger = NO;
508-
for (int i = 0; i < currentVersionItems.count && i < lastUsedVersionItems.count; i++) {
507+
BOOL currentVersionLarger = NO;
508+
for (int i = 0; i < currentVersionItems.count || i < lastUsedVersionItems.count; i++) {
509509
if (i >= currentVersionItems.count) {
510510
currentVersionLarger = NO;
511511
break;
@@ -527,18 +527,14 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification
527527
if (currentVersionLarger) {
528528
[ud setValue:currentVersion forKey:MMLastUsedBundleVersionKey];
529529

530-
// We have successfully updated to a new version. Show a "What's
531-
// New" page to the user with latest release notes if the main
532-
// release number has increased (we don't count the pre-release
533-
// minor revision number for now).
534-
if (lastUsedVersionItems[0].integerValue < currentVersionItems[0].integerValue) {
530+
// We have successfully updated to a new version. Show a
531+
// "What's New" page to the user with latest release notes
532+
// unless they configured not to.
533+
BOOL showWhatsNewSetting = [ud boolForKey:MMShowWhatsNewOnStartupKey];
535534

536-
BOOL showWhatsNewSetting = [ud boolForKey:MMShowWhatsNewOnStartupKey];
537-
538-
shouldShowWhatsNewPage = showWhatsNewSetting;
539-
[MMWhatsNewController setRequestVersionRange:lastUsedVersion
540-
to:currentVersion];
541-
}
535+
shouldShowWhatsNewPage = showWhatsNewSetting;
536+
[MMWhatsNewController setRequestVersionRange:lastUsedVersion
537+
to:currentVersion];
542538
}
543539
}
544540
}

src/MacVim/MMWhatsNewController.m

+1-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ - (id)init
8383
_latestVersion];
8484
}
8585
else {
86-
// We just updated to a new version. Show a message to user and also
87-
// requests specifically these new versions for the welcome message
86+
// Just show the current version MacVim has
8887
NSString *currentVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];
8988

9089
whatsNewURLStr = [NSString stringWithFormat:@"%@?version=%@",

0 commit comments

Comments
 (0)