Patch 8.2.1658
Problem:    Expand('<stack>') has trailing "..".
Solution:   Remove the "..". (closes #6927)
Files:      src/scriptfile.c, src/testdir/test_expand_func.vim


*** ../vim-8.2.1657/src/scriptfile.c    2020-09-10 19:25:01.612194701 +0200
--- src/scriptfile.c    2020-09-11 17:57:05.172657242 +0200
***************
*** 144,150 ****
        entry = ((estack_T *)exestack.ga_data) + idx;
        if (entry->es_name != NULL)
        {
!           long lnum = 0;
  
            len = STRLEN(entry->es_name) + 15;
            type_name = "";
--- 144,151 ----
        entry = ((estack_T *)exestack.ga_data) + idx;
        if (entry->es_name != NULL)
        {
!           long    lnum = 0;
!           char    *dots;
  
            len = STRLEN(entry->es_name) + 15;
            type_name = "";
***************
*** 165,180 ****
                lnum = which == ESTACK_STACK ? SOURCING_LNUM : 0;
            else
                lnum = entry->es_lnum;
            if (lnum == 0)
                // For the bottom entry of <sfile>: do not add the line number,
                // it is used in <slnum>.  Also leave it out when the number is
                // not set.
                vim_snprintf((char *)ga.ga_data + ga.ga_len, len, "%s%s%s",
!                               type_name, entry->es_name,
!                               idx == exestack.ga_len - 1 ? "" : "..");
            else
!               vim_snprintf((char *)ga.ga_data + ga.ga_len, len, "%s%s[%ld]..",
!                                   type_name, entry->es_name, lnum);
            ga.ga_len += (int)STRLEN((char *)ga.ga_data + ga.ga_len);
        }
      }
--- 166,181 ----
                lnum = which == ESTACK_STACK ? SOURCING_LNUM : 0;
            else
                lnum = entry->es_lnum;
+           dots = idx == exestack.ga_len - 1 ? "" : "..";
            if (lnum == 0)
                // For the bottom entry of <sfile>: do not add the line number,
                // it is used in <slnum>.  Also leave it out when the number is
                // not set.
                vim_snprintf((char *)ga.ga_data + ga.ga_len, len, "%s%s%s",
!                               type_name, entry->es_name, dots);
            else
!               vim_snprintf((char *)ga.ga_data + ga.ga_len, len, "%s%s[%ld]%s",
!                                   type_name, entry->es_name, lnum, dots);
            ga.ga_len += (int)STRLEN((char *)ga.ga_data + ga.ga_len);
        }
      }
*** ../vim-8.2.1657/src/testdir/test_expand_func.vim    2020-09-10 
19:25:01.612194701 +0200
--- src/testdir/test_expand_func.vim    2020-09-11 17:52:29.249522201 +0200
***************
*** 58,64 ****
    END
    call writefile(lines, 'Xstack')
    source Xstack
!   call assert_match('\<Xstack\[2\]', g:stack_value)
    call delete('Xstack')
  endfunc
  
--- 58,64 ----
    END
    call writefile(lines, 'Xstack')
    source Xstack
!   call assert_match('\<Xstack\[2\]$', g:stack_value)
    call delete('Xstack')
  endfunc
  
*** ../vim-8.2.1657/src/version.c       2020-09-10 22:27:57.805094402 +0200
--- src/version.c       2020-09-11 17:53:34.309319051 +0200
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     1658,
  /**/

-- 
ROBIN:  (warily) And if you get a question wrong?
ARTHUR: You are cast into the Gorge of Eternal Peril.
ROBIN:  Oh ... wacho!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202009111559.08BFxvrP909760%40masaka.moolenaar.net.

Raspunde prin e-mail lui