home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / old / 5.5.028 < prev    next >
Encoding:
Internet Message Format  |  1999-10-16  |  4.1 KB

  1. To: vim-dev@vim.org
  2. Subject: patch 5.5.028 (extra)
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. ------------
  6.  
  7. Patch 5.5.028 (extra)
  8. Problem:    Win32 GUI: When a file is dropped on Win32 gvim while at the ":"
  9.         prompt, the file is edited but the command line is actually still
  10.         there, the cursor goes back to command line on the next command.
  11.         (Krishna)
  12. Solution:   When dropping a file or directory on gvim while at the ":" prompt,
  13.         insert the name of the file/directory.  Allows using the
  14.         file/directory name for any Ex command.
  15. Files:        src/gui_w32.c
  16.  
  17.  
  18. *** ../vim-5.5.27/src/gui_w32.c    Sun Oct 17 15:00:38 1999
  19. --- src/gui_w32.c    Sun Oct 17 20:05:00 1999
  20. ***************
  21. *** 653,659 ****
  22.       update_curbuf(NOT_VALID);    /* delete the inversion */
  23.       }
  24.   
  25. !     fnames = (char_u **) alloc(cFiles * sizeof(char_u *));
  26.   
  27.       for (i = 0; i < cFiles; ++i)
  28.       {
  29. --- 665,671 ----
  30.       update_curbuf(NOT_VALID);    /* delete the inversion */
  31.       }
  32.   
  33. !     fnames = (char_u **)alloc(cFiles * sizeof(char_u *));
  34.   
  35.       for (i = 0; i < cFiles; ++i)
  36.       {
  37. ***************
  38. *** 666,707 ****
  39.           fname = szFile;
  40.       fnames[i] = vim_strsave(fname);
  41.       }
  42.   
  43.       /*
  44. !      * Handle dropping a directory on Vim.
  45. !      * Change to that directory and don't open any file.
  46.        */
  47. !     if (cFiles == 1 && mch_isdir(fnames[0]))
  48.       {
  49. !     if (mch_chdir(fnames[0]) == 0)
  50.       {
  51. !         smsg((char_u *)":cd %s", fnames[0]);
  52. !         vim_free(fnames[0]);
  53. !         fnames[0] = NULL;
  54. !         redo_dirs = TRUE;
  55.       }
  56.       }
  57. !     DragFinish(hDrop);
  58. !     if (fnames[0] != NULL)
  59.       {
  60. !     /* Shift held down, change to first file's directory */
  61. !     if (GetKeyState(VK_SHIFT) & 0x8000)
  62. !         if (vim_chdirfile(fnames[0]) == 0)
  63.           redo_dirs = TRUE;
  64.   
  65. !     /* Handle the drop, :edit or :split to get to the file */
  66. !     handle_drop(cFiles, fnames, ((GetKeyState(VK_CONTROL) & 0x8000) != 0));
  67. !     }
  68.   
  69. !     if (redo_dirs)
  70. !     shorten_fnames(TRUE);
  71.   
  72. !     /* Update the screen display */
  73. !     update_screen(NOT_VALID);
  74. !     setcursor();
  75. !     out_flush();
  76.   
  77.       /* SetActiveWindow() doesn't work here... */
  78.       (void)SetForegroundWindow(s_hwnd);
  79. --- 678,738 ----
  80.           fname = szFile;
  81.       fnames[i] = vim_strsave(fname);
  82.       }
  83. +     DragFinish(hDrop);
  84.   
  85.       /*
  86. !      * When the cursor is at the command line, add the file names to the
  87. !      * command line, don't edit the files.
  88.        */
  89. !     if (State & CMDLINE)
  90.       {
  91. !     for (i = 0; i < cFiles; ++i)
  92.       {
  93. !         if (fnames[i] != NULL)
  94. !         {
  95. !         if (i > 0)
  96. !             add_to_input_buf(" ", 1);
  97. !         add_to_input_buf(fnames[i], STRLEN(fnames[i]));
  98. !         }
  99.       }
  100.       }
  101. !     else
  102.       {
  103. !     /*
  104. !      * Handle dropping a directory on Vim.
  105. !      * Change to that directory and don't open any file.
  106. !      */
  107. !     if (cFiles == 1 && mch_isdir(fnames[0]))
  108. !     {
  109. !         if (mch_chdir(fnames[0]) == 0)
  110. !         {
  111. !         smsg((char_u *)":cd %s", fnames[0]);
  112. !         vim_free(fnames[0]);
  113. !         fnames[0] = NULL;
  114.           redo_dirs = TRUE;
  115. +         }
  116. +     }
  117.   
  118. !     if (fnames[0] != NULL)
  119. !     {
  120. !         /* Shift held down, change to first file's directory */
  121. !         if (GetKeyState(VK_SHIFT) & 0x8000)
  122. !         if (vim_chdirfile(fnames[0]) == 0)
  123. !             redo_dirs = TRUE;
  124. !         /* Handle the drop, :edit or :split to get to the file */
  125. !         handle_drop(cFiles, fnames,
  126. !                    ((GetKeyState(VK_CONTROL) & 0x8000) != 0));
  127. !     }
  128.   
  129. !     if (redo_dirs)
  130. !         shorten_fnames(TRUE);
  131.   
  132. !     /* Update the screen display */
  133. !     update_screen(NOT_VALID);
  134. !     setcursor();
  135. !     out_flush();
  136. !     }
  137.   
  138.       /* SetActiveWindow() doesn't work here... */
  139.       (void)SetForegroundWindow(s_hwnd);
  140. *** ../vim-5.5.27/src/version.c    Sun Oct 17 17:18:13 1999
  141. --- src/version.c    Sun Oct 17 20:10:04 1999
  142. ***************
  143. *** 420,420 ****
  144. --- 420,421 ----
  145.   {   /* Add new patch number below this line */
  146. +     28,
  147.  
  148. --
  149. LAUNCELOT: Isn't there a St. Aaaaarrrrrrggghhh's in Cornwall?
  150. ARTHUR:    No, that's Saint Ives.
  151.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  152.  
  153. --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\--
  154.   \ \    www.vim.org/iccf      www.moolenaar.net       www.vim.org    / /
  155.