]> granicus.if.org Git - vim/commitdiff
patch 8.2.3648: "verbose pwd" is incorrect after dropping files on Vim v8.2.3648
authorBram Moolenaar <Bram@vim.org>
Mon, 22 Nov 2021 17:21:48 +0000 (17:21 +0000)
committerBram Moolenaar <Bram@vim.org>
Mon, 22 Nov 2021 17:21:48 +0000 (17:21 +0000)
Problem:    "verbose pwd" is incorrect after dropping files on Vim.
Solution:   Set the chdir reason to "drop".

src/gui.c
src/version.c

index 39f69e1045fbbe625cc818705aa9c3794a486254..13f1fe4fa3862d3dc8e95f11598a637cdb680d8c 100644 (file)
--- a/src/gui.c
+++ b/src/gui.c
@@ -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
@@ -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
@@ -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;
index 1871c7fc4c9b5f93e7a48949b0236894bf76affd..bd4114780186977754f1157431315b2e3c36b808 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3648,
 /**/
     3647,
 /**/