aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/file_search.c
diff options
context:
space:
mode:
authorJurica Bradaric <jbradaric@gmail.com>2016-01-22 17:49:39 +0100
committerJurica Bradaric <jbradaric@gmail.com>2016-01-22 19:28:17 +0100
commit8b86f1103a54882416d4ac626884d3d8a7e02c63 (patch)
tree778917f050838cdc042dfe4aeeb11e29f18d297e /src/nvim/file_search.c
parentfeb70192a85d04343ecc383ea9a42aa8cd15e98d (diff)
downloadrneovim-8b86f1103a54882416d4ac626884d3d8a7e02c63.tar.gz
rneovim-8b86f1103a54882416d4ac626884d3d8a7e02c63.tar.bz2
rneovim-8b86f1103a54882416d4ac626884d3d8a7e02c63.zip
vim-patch:7.4.642
Problem: When using "gf" escaped spaces are not handled. Solution: Recognize escaped spaces. https://github.com/vim/vim/commit/d45c07ac7499358c5cb096cadb675ce74ae3eaf6
Diffstat (limited to 'src/nvim/file_search.c')
-rw-r--r--src/nvim/file_search.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c
index 4f345158cf..b213a42c52 100644
--- a/src/nvim/file_search.c
+++ b/src/nvim/file_search.c
@@ -1340,6 +1340,7 @@ void free_findfile(void)
*
* options:
* FNAME_MESS give error message when not found
+ * FNAME_UNESC unescape backslashes
*
* Uses NameBuff[]!
*
@@ -1385,6 +1386,14 @@ find_file_in_path_option (
xfree(ff_file_to_find);
ff_file_to_find = vim_strsave(NameBuff);
+ if (options & FNAME_UNESC) {
+ // Change all "\ " to " ".
+ for (ptr = ff_file_to_find; *ptr != NUL; ++ptr) {
+ if (ptr[0] == '\\' && ptr[1] == ' ') {
+ memmove(ptr, ptr + 1, STRLEN(ptr));
+ }
+ }
+ }
}
rel_to_curdir = (ff_file_to_find[0] == '.'