Patch 8.2.4135
Problem:    Vim9: ":scriptnames" shows unloaded imported autoload script.
Solution:   Mark the unloaded script with "A". (closes #9552)
Files:      runtime/doc/repeat.txt, src/scriptfile.c,
            src/testdir/test_vim9_import.vim


*** ../vim-8.2.4134/runtime/doc/repeat.txt      2022-01-09 21:32:57.709739119 
+0000
--- runtime/doc/repeat.txt      2022-01-18 14:12:38.132580186 +0000
***************
*** 369,374 ****
--- 380,388 ----
  :scr[iptnames]                List all sourced script names, in the order 
they were
                        first sourced.  The number is used for the script ID
                        |<SID>|.
+                       For a script that was used with `import autoload` but
+                       was not actually sourced yet an "A" is shown after the
+                       script ID.
                        {not available when compiled without the |+eval|
                        feature}
  
*** ../vim-8.2.4134/src/scriptfile.c    2022-01-18 13:34:01.607865571 +0000
--- src/scriptfile.c    2022-01-18 14:09:12.832472704 +0000
***************
*** 1648,1663 ****
      }
  
      for (i = 1; i <= script_items.ga_len && !got_int; ++i)
!       if (SCRIPT_ITEM(i)->sn_name != NULL)
        {
!           home_replace(NULL, SCRIPT_ITEM(i)->sn_name,
!                                                   NameBuff, MAXPATHL, TRUE);
!           vim_snprintf((char *)IObuff, IOSIZE, "%3d: %s", i, NameBuff);
            msg_putchar('\n');
            msg_outtrans(IObuff);
            out_flush();            // output one line at a time
            ui_breakcheck();
        }
  }
  
  # if defined(BACKSLASH_IN_FILENAME) || defined(PROTO)
--- 1648,1669 ----
      }
  
      for (i = 1; i <= script_items.ga_len && !got_int; ++i)
!     {
!       scriptitem_T *si = SCRIPT_ITEM(i);
! 
!       if (si->sn_name != NULL)
        {
!           home_replace(NULL, si->sn_name, NameBuff, MAXPATHL, TRUE);
!           vim_snprintf((char *)IObuff, IOSIZE, "%3d%s: %s",
!                   i,
!                   si->sn_state == SN_STATE_NOT_LOADED ? " A" : "",
!                   NameBuff);
            msg_putchar('\n');
            msg_outtrans(IObuff);
            out_flush();            // output one line at a time
            ui_breakcheck();
        }
+     }
  }
  
  # if defined(BACKSLASH_IN_FILENAME) || defined(PROTO)
*** ../vim-8.2.4134/src/testdir/test_vim9_import.vim    2022-01-18 
13:14:44.069194847 +0000
--- src/testdir/test_vim9_import.vim    2022-01-18 14:14:53.268625676 +0000
***************
*** 1397,1406 ****
--- 1397,1408 ----
    CheckScriptSuccess(lines)
    assert_false(exists("g:toggle_loaded"))
    assert_false(exists("g:toggle_called"))
+   assert_match('\d A: \f*[/\\]toggle.vim', execute('scriptnames'))
  
    feedkeys("tt", 'xt')
    assert_equal('yes', g:toggle_loaded)
    assert_equal('yes', g:toggle_called)
+   assert_match('\d: \f*[/\\]toggle.vim', execute('scriptnames'))
  
    feedkeys("xx", 'xt')
    assert_equal('yes', g:doit_called)
*** ../vim-8.2.4134/src/version.c       2022-01-18 13:43:54.303254562 +0000
--- src/version.c       2022-01-18 14:10:32.876521110 +0000
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     4135,
  /**/

-- 
"Hegel was right when he said that we learn from history that man can
never learn anything from history."       (George Bernard Shaw)

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            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/20220118141732.69EB31C044E%40moolenaar.net.

Raspunde prin e-mail lui