summaryrefslogtreecommitdiffstats
path: root/src/insexpand.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-07-28 16:36:39 +0200
committerBram Moolenaar <Bram@vim.org>2019-07-28 16:36:39 +0200
commitac3150d385e6e3f3fe76642aac3cda954d30583f (patch)
tree1ef511ccde68ed948d811eb04a69303d1ccea50c /src/insexpand.c
parentbca9c301936c9ba4ee67528f81393debf83844b9 (diff)
patch 8.1.1769: 'shellslash' is also used for completionv8.1.1769
Problem: 'shellslash' is also used for completion. Solution: Add the 'completeslash' option. (Yasuhiro Matsumoto, closes #3612)
Diffstat (limited to 'src/insexpand.c')
-rw-r--r--src/insexpand.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/insexpand.c b/src/insexpand.c
index fe475a5da6..42458005ed 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -2669,6 +2669,26 @@ ins_compl_get_exp(pos_T *ini)
// May change home directory back to "~".
tilde_replace(compl_pattern, num_matches, matches);
+#ifdef BACKSLASH_IN_FILENAME
+ if (curbuf->b_p_csl[0] != NUL)
+ {
+ int i;
+
+ for (i = 0; i < num_matches; ++i)
+ {
+ char_u *ptr = matches[i];
+
+ while (*ptr != NUL)
+ {
+ if (curbuf->b_p_csl[0] == 's' && *ptr == '\\')
+ *ptr = '/';
+ else if (curbuf->b_p_csl[0] == 'b' && *ptr == '/')
+ *ptr = '\\';
+ ptr += (*mb_ptr2len)(ptr);
+ }
+ }
+ }
+#endif
ins_compl_add_matches(num_matches, matches, p_fic || p_wic);
}
break;