Patch 8.2.4060

6 views
Skip to first unread message

Bram Moolenaar

unread,
Jan 11, 2022, 7:38:03 AM1/11/22
to vim...@googlegroups.com

Patch 8.2.4060
Problem: win_execute() is slow on systems where getcwd() or chdir() is
slow. (Rick Howe)
Solution: Avoid using getcwd() and chdir() if no local directory is used and
'acd' is not set. (closes #9504)
Files: src/evalwindow.c


*** ../vim-8.2.4059/src/evalwindow.c 2022-01-10 13:36:31.264892417 +0000
--- src/evalwindow.c 2022-01-11 12:34:19.279334201 +0000
***************
*** 707,719 ****
{
pos_T curpos = wp->w_cursor;
char_u cwd[MAXPATHL];
! int cwd_status;
#ifdef FEAT_AUTOCHDIR
char_u autocwd[MAXPATHL];
int apply_acd = FALSE;
#endif

! cwd_status = mch_dirname(cwd, MAXPATHL);

#ifdef FEAT_AUTOCHDIR
// If 'acd' is set, check we are using that directory. If yes, then
--- 707,732 ----
{
pos_T curpos = wp->w_cursor;
char_u cwd[MAXPATHL];
! int cwd_status = FAIL;
#ifdef FEAT_AUTOCHDIR
char_u autocwd[MAXPATHL];
int apply_acd = FALSE;
#endif

! // Getting and setting directory can be slow on some systems, only do
! // this when the current or target window/tab have a local directory or
! // 'acd' is set.
! if (curwin != wp
! && (curwin->w_localdir != NULL
! || wp->w_localdir != NULL
! || (curtab != tp
! && (curtab->tp_localdir != NULL
! || tp->tp_localdir != NULL))
! #ifdef FEAT_AUTOCHDIR
! || p_acd
! #endif
! ))
! cwd_status = mch_dirname(cwd, MAXPATHL);

#ifdef FEAT_AUTOCHDIR
// If 'acd' is set, check we are using that directory. If yes, then
*** ../vim-8.2.4059/src/version.c 2022-01-11 11:58:14.924745969 +0000
--- src/version.c 2022-01-11 12:36:58.295177036 +0000
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 4060,
/**/

--
press CTRL-ALT-DEL for more information

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages