1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1002
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------
Patch 8.1.1002
Problem: "gf" does not always work when URL has a port number. (Jakob
Schöttl)
Solution: When a URL is recognized also accept ":". (closes #4082)
Files: src/findfile.c, src/testdir/test_gf.vim
*** ../vim-8.1.1001/src/findfile.c 2019-02-13 22:45:21.508636195 +0100
--- src/findfile.c 2019-03-09 12:28:08.627614610 +0100
***************
*** 2017,2026 ****
len = 0;
while (vim_isfilec(ptr[len]) || (ptr[len] == '\\' && ptr[len + 1] == ' ')
|| ((options & FNAME_HYP) && path_is_url(ptr + len))
! || (is_url && vim_strchr((char_u *)"?&=", ptr[len]) != NULL))
{
! // After type:// we also include ?, & and = as valid characters, so that
! // http://google.com?q=this&that=ok works.
if ((ptr[len] >= 'A' && ptr[len] <= 'Z') || (ptr[len] >= 'a' && ptr[len] <= 'z'))
{
if (in_type && path_is_url(ptr + len + 1))
--- 2017,2026 ----
len = 0;
while (vim_isfilec(ptr[len]) || (ptr[len] == '\\' && ptr[len + 1] == ' ')
|| ((options & FNAME_HYP) && path_is_url(ptr + len))
! || (is_url && vim_strchr((char_u *)":?&=", ptr[len]) != NULL))
{
! // After type:// we also include :, ?, & and = as valid characters, so that
! // http://google.com:8080?q=this&that=ok works.
if ((ptr[len] >= 'A' && ptr[len] <= 'Z') || (ptr[len] >= 'a' && ptr[len] <= 'z'))
{
if (in_type && path_is_url(ptr + len + 1))
*** ../vim-8.1.1001/src/testdir/test_gf.vim 2017-12-25 14:22:11.000000000 +0100
--- src/testdir/test_gf.vim 2019-03-09 12:29:00.295238774 +0100
***************
*** 9,14 ****
--- 9,15 ----
\ "third test for URL:\\\\machine.name\\vimtest2c and other text",
\ "fourth test for URL:\\\\machine.name\\tmp\\vimtest2d, and other text",
\ "fifth test for URL://machine.name/tmp?q=vim&opt=yes and other text",
+ \ "sixth test for URL://machine.name:1234?q=vim and other text",
\ ])
call cursor(1,1)
call search("^first")
***************
*** 20,26 ****
if has("ebcdic")
set isf=@,240-249,/,.,-,_,+,,,$,:,~,\
else
! set isf=@,48-57,/,.,-,_,+,,,$,:,~,\
endif
call search("^third")
call search("name")
--- 21,27 ----
if has("ebcdic")
set isf=@,240-249,/,.,-,_,+,,,$,:,~,\
else
! set isf=@,48-57,/,.,-,_,+,,,$,~,\
endif
call search("^third")
call search("name")
***************
*** 33,38 ****
--- 34,43 ----
call search("URL")
call assert_equal("URL://machine.name/tmp?q=vim&opt=yes", expand("<cfile>"))
+ call search("^sixth")
+ call search("URL")
+ call assert_equal("URL://machine.name:1234?q=vim", expand("<cfile>"))
+
set isf&vim
enew!
endfunc
*** ../vim-8.1.1001/src/version.c 2019-03-09 11:45:45.650134366 +0100
--- src/version.c 2019-03-09 12:31:49.770005496 +0100
***************
*** 781,782 ****
--- 781,784 ----
{ /* Add new patch number below this line */
+ /**/
+ 1002,
/**/
--
Light travels faster than sound. This is why some people
appear bright until you hear them speak
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|