Skip to content

Commit

Permalink
patch 8.2.3648: "verbose pwd" is incorrect after dropping files on Vim
Browse files Browse the repository at this point in the history
Problem:    "verbose pwd" is incorrect after dropping files on Vim.
Solution:   Set the chdir reason to "drop".
  • Loading branch information
brammool committed Nov 22, 2021
1 parent ce59b9f commit 4671e88
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/gui.c
Expand Up @@ -5525,6 +5525,7 @@ gui_wingoto_xy(int x, int y)
drop_callback(void *cookie)
{
char_u *p = cookie;
int do_shorten = FALSE;

// 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
Expand All @@ -5534,11 +5535,16 @@ drop_callback(void *cookie)
if (mch_isdir(p))
{
if (mch_chdir((char *)p) == 0)
shorten_fnames(TRUE);
do_shorten = TRUE;
}
else if (vim_chdirfile(p, "drop") == OK)
shorten_fnames(TRUE);
do_shorten = TRUE;
vim_free(p);
if (do_shorten)
{
shorten_fnames(TRUE);
last_chdir_reason = "drop";
}
}

// Update the screen display
Expand Down Expand Up @@ -5635,7 +5641,7 @@ gui_handle_drop(
}
else
handle_drop(count, fnames, (modifiers & MOUSE_CTRL) != 0,
drop_callback, (void *)p);
drop_callback, (void *)p);
}

entered = FALSE;
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -757,6 +757,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3648,
/**/
3647,
/**/
Expand Down

0 comments on commit 4671e88

Please sign in to comment.