From b8b2381bd15b115b9d03ec2e5ec9b900b83b9bdf Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Sun, 24 Aug 2008 19:32:04 +0200 Subject: [PATCH] Ensure order of files to open is not affected by 'suffixes' Opening the same set of files in a new window and in an already open window could result in the order of the files being different due to a non-empty 'suffixes' option. This patch clears 'suffix' before opening multiple files and restores it afterwards. --- src/MacVim/MMBackend.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/MacVim/MMBackend.m b/src/MacVim/MMBackend.m index 011bf202..72d3dd10 100644 --- a/src/MacVim/MMBackend.m +++ b/src/MacVim/MMBackend.m @@ -2376,6 +2376,10 @@ static NSString *MMSymlinkWarningString = [cmd appendString:file]; } + // Temporarily clear 'suffixes' so that the files are opened in + // the same order as they appear in the "filenames" array. + [self addInput:@":let t:mvim_oldsu=&su|set su="]; + [self addInput:cmd]; // Split the view into multiple windows if requested. @@ -2384,6 +2388,9 @@ static NSString *MMSymlinkWarningString = else if (WIN_VER == layout) [self addInput:@"|vert sall"]; + // Restore the old value of 'suffixes'. + [self addInput:@"|let &su=t:mvim_oldsu|unlet t:mvim_oldsu"]; + // Adding "|redr|f" ensures a "Hit ENTER" prompt is not shown. [self addInput:@"|redr|f"]; } else { -- 2.11.4.GIT