comparison src/main.c @ 13170:6559e98f3e74 v8.0.1459

patch 8.0.1459: cannot handle change of directory commit https://github.com/vim/vim/commit/b7407d3fc9496f9048fb65ab17b5ba3444965c0e Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 3 17:36:27 2018 +0100 patch 8.0.1459: cannot handle change of directory Problem: Cannot handle change of directory. Solution: Add the DirChanged autocommand event. (Andy Massimino, closes #888) Avoid changing directory for 'autochdir' too often.
author Christian Brabandt <cb@256bit.org>
date Sat, 03 Feb 2018 17:45:05 +0100
parents cb99d9198c39
children 5ed6e4a25925
comparison
equal deleted inserted replaced
13169:570e10c8313d 13170:6559e98f3e74
262 * If there is one filename, fully qualified, we have very probably 262 * If there is one filename, fully qualified, we have very probably
263 * been invoked from explorer, so change to the file's directory. 263 * been invoked from explorer, so change to the file's directory.
264 * Hint: to avoid this when typing a command use a forward slash. 264 * Hint: to avoid this when typing a command use a forward slash.
265 * If the cd fails, it doesn't matter. 265 * If the cd fails, it doesn't matter.
266 */ 266 */
267 (void)vim_chdirfile(params.fname); 267 (void)vim_chdirfile(params.fname, "drop");
268 if (start_dir != NULL) 268 if (start_dir != NULL)
269 mch_dirname(start_dir, MAXPATHL); 269 mch_dirname(start_dir, MAXPATHL);
270 } 270 }
271 #endif 271 #endif
272 TIME_MSG("expanding arguments"); 272 TIME_MSG("expanding arguments");
312 * HandleODocAE() and "fname" will be NULL. */ 312 * HandleODocAE() and "fname" will be NULL. */
313 if (getcwd((char *)NameBuff, MAXPATHL) != NULL 313 if (getcwd((char *)NameBuff, MAXPATHL) != NULL
314 && STRCMP(NameBuff, "/") == 0) 314 && STRCMP(NameBuff, "/") == 0)
315 { 315 {
316 if (params.fname != NULL) 316 if (params.fname != NULL)
317 (void)vim_chdirfile(params.fname); 317 (void)vim_chdirfile(params.fname, "drop");
318 else 318 else
319 { 319 {
320 expand_env((char_u *)"$HOME", NameBuff, MAXPATHL); 320 expand_env((char_u *)"$HOME", NameBuff, MAXPATHL);
321 vim_chdir(NameBuff); 321 vim_chdir(NameBuff);
322 } 322 }