Skip to content

Commit

Permalink
Allow showing pre-release in What's New page
Browse files Browse the repository at this point in the history
  • Loading branch information
ychin committed Oct 19, 2023
1 parent e910841 commit 1adcde6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
22 changes: 9 additions & 13 deletions src/MacVim/MMAppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,8 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification
NSArray<NSString*> *currentVersionItems = [currentVersion componentsSeparatedByString:@"."];
// Compare two arrays lexographically. We just assume that version
// numbers are also X.Y.Z… with no "beta" etc texts.
bool currentVersionLarger = NO;
for (int i = 0; i < currentVersionItems.count && i < lastUsedVersionItems.count; i++) {
BOOL currentVersionLarger = NO;
for (int i = 0; i < currentVersionItems.count || i < lastUsedVersionItems.count; i++) {
if (i >= currentVersionItems.count) {
currentVersionLarger = NO;
break;
Expand All @@ -527,18 +527,14 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification
if (currentVersionLarger) {
[ud setValue:currentVersion forKey:MMLastUsedBundleVersionKey];

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

BOOL showWhatsNewSetting = [ud boolForKey:MMShowWhatsNewOnStartupKey];

shouldShowWhatsNewPage = showWhatsNewSetting;
[MMWhatsNewController setRequestVersionRange:lastUsedVersion
to:currentVersion];
}
shouldShowWhatsNewPage = showWhatsNewSetting;
[MMWhatsNewController setRequestVersionRange:lastUsedVersion
to:currentVersion];
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/MacVim/MMWhatsNewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ - (id)init
_latestVersion];
}
else {
// We just updated to a new version. Show a message to user and also
// requests specifically these new versions for the welcome message
// Just show the current version MacVim has
NSString *currentVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];

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

0 comments on commit 1adcde6

Please sign in to comment.