0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 8.2.3648: "verbose pwd" is incorrect after dropping files on Vim

Problem:    "verbose pwd" is incorrect after dropping files on Vim.
Solution:   Set the chdir reason to "drop".
This commit is contained in:
Bram Moolenaar
2021-11-22 17:21:48 +00:00
parent ce59b9f292
commit 4671e88d7d
2 changed files with 11 additions and 3 deletions

View File

@@ -5525,6 +5525,7 @@ gui_wingoto_xy(int x, int y)
drop_callback(void *cookie) drop_callback(void *cookie)
{ {
char_u *p = cookie; char_u *p = cookie;
int do_shorten = FALSE;
// If Shift held down, change to first file's directory. If the first // If Shift held down, change to first file's directory. If the first
// item is a directory, change to that directory (and let the explorer // item is a directory, change to that directory (and let the explorer
@@ -5534,11 +5535,16 @@ drop_callback(void *cookie)
if (mch_isdir(p)) if (mch_isdir(p))
{ {
if (mch_chdir((char *)p) == 0) if (mch_chdir((char *)p) == 0)
shorten_fnames(TRUE); do_shorten = TRUE;
} }
else if (vim_chdirfile(p, "drop") == OK) else if (vim_chdirfile(p, "drop") == OK)
shorten_fnames(TRUE); do_shorten = TRUE;
vim_free(p); vim_free(p);
if (do_shorten)
{
shorten_fnames(TRUE);
last_chdir_reason = "drop";
}
} }
// Update the screen display // Update the screen display

View File

@@ -757,6 +757,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
3648,
/**/ /**/
3647, 3647,
/**/ /**/