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 -- [email protected] -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui