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.
This commit is contained in:
Bjorn Winckler
2008-08-24 19:32:04 +02:00
parent 22799739f5
commit cec4f8b9ee
+7
View File
@@ -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=<CR>"];
[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<CR>"];
} else {