comparison src/window.c @ 6633:75444015837a v7.4.642

updated for version 7.4.642 Problem: When using "gf" escaped spaces are not handled. Solution: Recognize escaped spaces.
author Bram Moolenaar <bram@vim.org>
date Fri, 27 Feb 2015 17:19:10 +0100
parents cba15023c403
children fbcf54fc3a77
comparison
equal deleted inserted replaced
6632:dd52e8b22614 6633:75444015837a
6217 char_u * 6217 char_u *
6218 grab_file_name(count, file_lnum) 6218 grab_file_name(count, file_lnum)
6219 long count; 6219 long count;
6220 linenr_T *file_lnum; 6220 linenr_T *file_lnum;
6221 { 6221 {
6222 int options = FNAME_MESS|FNAME_EXP|FNAME_REL|FNAME_UNESC;
6223
6222 if (VIsual_active) 6224 if (VIsual_active)
6223 { 6225 {
6224 int len; 6226 int len;
6225 char_u *ptr; 6227 char_u *ptr;
6226 6228
6227 if (get_visual_text(NULL, &ptr, &len) == FAIL) 6229 if (get_visual_text(NULL, &ptr, &len) == FAIL)
6228 return NULL; 6230 return NULL;
6229 return find_file_name_in_path(ptr, len, 6231 return find_file_name_in_path(ptr, len, options,
6230 FNAME_MESS|FNAME_EXP|FNAME_REL, count, curbuf->b_ffname); 6232 count, curbuf->b_ffname);
6231 } 6233 }
6232 return file_name_at_cursor(FNAME_MESS|FNAME_HYP|FNAME_EXP|FNAME_REL, count, 6234 return file_name_at_cursor(options | FNAME_HYP, count, file_lnum);
6233 file_lnum);
6234 6235
6235 } 6236 }
6236 6237
6237 /* 6238 /*
6238 * Return the file name under or after the cursor. 6239 * Return the file name under or after the cursor.
6308 /* 6309 /*
6309 * Search forward for the last char of the file name. 6310 * Search forward for the last char of the file name.
6310 * Also allow "://" when ':' is not in 'isfname'. 6311 * Also allow "://" when ':' is not in 'isfname'.
6311 */ 6312 */
6312 len = 0; 6313 len = 0;
6313 while (vim_isfilec(ptr[len]) 6314 while (vim_isfilec(ptr[len]) || (ptr[len] == '\\' && ptr[len + 1] == ' ')
6314 || ((options & FNAME_HYP) && path_is_url(ptr + len))) 6315 || ((options & FNAME_HYP) && path_is_url(ptr + len)))
6316 {
6317 if (ptr[len] == '\\')
6318 /* Skip over the "\" in "\ ". */
6319 ++len;
6315 #ifdef FEAT_MBYTE 6320 #ifdef FEAT_MBYTE
6316 if (has_mbyte) 6321 if (has_mbyte)
6317 len += (*mb_ptr2len)(ptr + len); 6322 len += (*mb_ptr2len)(ptr + len);
6318 else 6323 else
6319 #endif 6324 #endif
6320 ++len; 6325 ++len;
6326 }
6321 6327
6322 /* 6328 /*
6323 * If there is trailing punctuation, remove it. 6329 * If there is trailing punctuation, remove it.
6324 * But don't remove "..", could be a directory name. 6330 * But don't remove "..", could be a directory name.
6325 */ 6331 */