diff options
author | Jurica Bradaric <jbradaric@gmail.com> | 2016-01-22 17:49:39 +0100 |
---|---|---|
committer | Jurica Bradaric <jbradaric@gmail.com> | 2016-01-22 19:28:17 +0100 |
commit | 8b86f1103a54882416d4ac626884d3d8a7e02c63 (patch) | |
tree | 778917f050838cdc042dfe4aeeb11e29f18d297e /src/nvim/window.c | |
parent | feb70192a85d04343ecc383ea9a42aa8cd15e98d (diff) | |
download | rneovim-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/window.c')
-rw-r--r-- | src/nvim/window.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c index 16ff7dfb14..7a21b22d28 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -4837,17 +4837,16 @@ static void frame_add_height(frame_T *frp, int n) */ char_u *grab_file_name(long count, linenr_T *file_lnum) { + int options = FNAME_MESS|FNAME_EXP|FNAME_REL|FNAME_UNESC; if (VIsual_active) { size_t len; char_u *ptr; if (get_visual_text(NULL, &ptr, &len) == FAIL) return NULL; - return find_file_name_in_path(ptr, len, - FNAME_MESS|FNAME_EXP|FNAME_REL, + 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); } /* @@ -4918,12 +4917,17 @@ file_name_in_line ( * Also allow "://" when ':' is not in 'isfname'. */ len = 0; - while (vim_isfilec(ptr[len]) - || ((options & FNAME_HYP) && path_is_url((char *)ptr + len))) + while (vim_isfilec(ptr[len]) || (ptr[len] == '\\' && ptr[len + 1] == ' ') + || ((options & FNAME_HYP) && path_is_url((char *)ptr + len))) { + if (ptr[len] == '\\') { + // Skip over the "\" in "\ ". + ++len; + } if (has_mbyte) len += (size_t)(*mb_ptr2len)(ptr + len); else ++len; + } /* * If there is trailing punctuation, remove it. |