updated for version 7.4.642
Problem: When using "gf" escaped spaces are not handled.
Solution: Recognize escaped spaces.
diff --git a/src/window.c b/src/window.c
index 6ca288e..eb218d5 100644
--- a/src/window.c
+++ b/src/window.c
@@ -6219,6 +6219,8 @@
long count;
linenr_T *file_lnum;
{
+ int options = FNAME_MESS|FNAME_EXP|FNAME_REL|FNAME_UNESC;
+
if (VIsual_active)
{
int len;
@@ -6226,11 +6228,10 @@
if (get_visual_text(NULL, &ptr, &len) == FAIL)
return NULL;
- return find_file_name_in_path(ptr, len,
- FNAME_MESS|FNAME_EXP|FNAME_REL, count, curbuf->b_ffname);
+ return find_file_name_in_path(ptr, len, options,
+ count, curbuf->b_ffname);
}
- return file_name_at_cursor(FNAME_MESS|FNAME_HYP|FNAME_EXP|FNAME_REL, count,
- file_lnum);
+ return file_name_at_cursor(options | FNAME_HYP, count, file_lnum);
}
@@ -6310,14 +6311,19 @@
* Also allow "://" when ':' is not in 'isfname'.
*/
len = 0;
- while (vim_isfilec(ptr[len])
+ while (vim_isfilec(ptr[len]) || (ptr[len] == '\\' && ptr[len + 1] == ' ')
|| ((options & FNAME_HYP) && path_is_url(ptr + len)))
+ {
+ if (ptr[len] == '\\')
+ /* Skip over the "\" in "\ ". */
+ ++len;
#ifdef FEAT_MBYTE
if (has_mbyte)
len += (*mb_ptr2len)(ptr + len);
else
#endif
++len;
+ }
/*
* If there is trailing punctuation, remove it.