mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user