forked from aniani/vim
updated for version 7.4.642
Problem: When using "gf" escaped spaces are not handled. Solution: Recognize escaped spaces.
This commit is contained in:
16
src/window.c
16
src/window.c
@@ -6219,6 +6219,8 @@ grab_file_name(count, file_lnum)
|
||||
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 @@ grab_file_name(count, file_lnum)
|
||||
|
||||
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 @@ file_name_in_line(line, col, options, count, rel_fname, file_lnum)
|
||||
* 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.
|
||||
|
Reference in New Issue
Block a user