summaryrefslogtreecommitdiff
path: root/src/ex_getln.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r--src/ex_getln.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c
index e4a1c99b4..11069f25e 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -4444,8 +4444,9 @@ ExpandGeneric(xp, regmatch, num_file, file, func)
}
}
- /* Sort the results. */
- sort_strings(*file, *num_file);
+ /* Sort the results. Keep menu's in the specified order. */
+ if (xp->xp_context != EXPAND_MENUNAMES && xp->xp_context != EXPAND_MENUS)
+ sort_strings(*file, *num_file);
return OK;
}