diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-02-27 17:19:10 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-02-27 17:19:10 +0100 |
commit | d45c07ac7499358c5cb096cadb675ce74ae3eaf6 (patch) | |
tree | 13875945fd62b050fb38fed1b109fedb350c2301 /src/window.c | |
parent | dfd7691bb85b345bd86cf30945a66acf7c782920 (diff) | |
download | vim-git-d45c07ac7499358c5cb096cadb675ce74ae3eaf6.tar.gz |
updated for version 7.4.642v7.4.642
Problem: When using "gf" escaped spaces are not handled.
Solution: Recognize escaped spaces.
Diffstat (limited to 'src/window.c')
-rw-r--r-- | src/window.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/window.c b/src/window.c index 6ca288ead..eb218d560 100644 --- a/src/window.c +++ b/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. |