aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-09-14 18:24:02 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-09-14 18:54:07 -0400
commiteb981a01e3d389017378da0586d2895865ec9a7d (patch)
tree00a5cf40cdf2553b067c3958bdd2a881880360f3 /src/nvim/window.c
parentcc484928d5b3402e0d93318df5b7b9b3385f2ee5 (diff)
downloadrneovim-eb981a01e3d389017378da0586d2895865ec9a7d.tar.gz
rneovim-eb981a01e3d389017378da0586d2895865ec9a7d.tar.bz2
rneovim-eb981a01e3d389017378da0586d2895865ec9a7d.zip
vim-patch:8.2.1684: "gF" does not use line number after file in Visual mode
Problem: "gF" does not use line number after file in Visual mode. Solution: Look for ":123" after the Visual area. (closes vim/vim#6952) https://github.com/vim/vim/commit/efd5d8a967ba80f9e2826c35be98344d8f00af77 Cherry-pick test_gf_visual changes from patch 8.2.1040.
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index cec0dfd67f..6608deb231 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -6019,6 +6019,12 @@ char_u *grab_file_name(long count, linenr_T *file_lnum)
char_u *ptr;
if (get_visual_text(NULL, &ptr, &len) == FAIL)
return NULL;
+ // Only recognize ":123" here
+ if (file_lnum != NULL && ptr[len] == ':' && isdigit(ptr[len + 1])) {
+ char_u *p = ptr + len + 1;
+
+ *file_lnum = getdigits_long(&p, false, 0);
+ }
return find_file_name_in_path(ptr, len, options, count, curbuf->b_ffname);
}
return file_name_at_cursor(options | FNAME_HYP, count, file_lnum);