Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow showing pre-release in What's New page #1447

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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