• R/O
  • SSH

vim: コミット

Mirror of the Vim source from https://github.com/vim/vim


コミットメタ情報

リビジョンc06c658691e20f22ae95d4cf117057c7d0736308 (tree)
日時2006-09-05 23:31:54
作者vimboss
コミッターvimboss

ログメッセージ

updated for version 7.0-087

変更サマリ

差分

diff -r 8c8d07318d8d -r c06c658691e2 src/buffer.c
--- a/src/buffer.c Tue Sep 05 13:37:47 2006 +0000
+++ b/src/buffer.c Tue Sep 05 14:31:54 2006 +0000
@@ -434,12 +434,8 @@
434434 if (usingNetbeans)
435435 netbeans_file_closed(buf);
436436 #endif
437-#ifdef FEAT_AUTOCHDIR
438- /* Change directories when the acd option is set on. */
439- if (p_acd && curbuf->b_ffname != NULL
440- && vim_chdirfile(curbuf->b_ffname) == OK)
441- shorten_fnames(TRUE);
442-#endif
437+ /* Change directories when the 'acd' option is set. */
438+ DO_AUTOCHDIR
443439
444440 /*
445441 * Remove the buffer from the list.
@@ -1422,12 +1418,8 @@
14221418 netbeans_file_activated(curbuf);
14231419 #endif
14241420
1425-#ifdef FEAT_AUTOCHDIR
1426- /* Change directories when the acd option is set on. */
1427- if (p_acd && curbuf->b_ffname != NULL
1428- && vim_chdirfile(curbuf->b_ffname) == OK)
1429- shorten_fnames(TRUE);
1430-#endif
1421+ /* Change directories when the 'acd' option is set. */
1422+ DO_AUTOCHDIR
14311423
14321424 #ifdef FEAT_KEYMAP
14331425 if (curbuf->b_kmap_state & KEYMAP_INIT)
@@ -1436,6 +1428,18 @@
14361428 redraw_later(NOT_VALID);
14371429 }
14381430
1431+#if defined(FEAT_AUTOCHDIR) || defined(PROTO)
1432+/*
1433+ * Change to the directory of the current buffer.
1434+ */
1435+ void
1436+do_autochdir()
1437+{
1438+ if (curbuf->b_ffname != NULL && vim_chdirfile(curbuf->b_ffname) == OK)
1439+ shorten_fnames(TRUE);
1440+}
1441+#endif
1442+
14391443 /*
14401444 * functions for dealing with the buffer list
14411445 */
diff -r 8c8d07318d8d -r c06c658691e2 src/ex_cmds.c
--- a/src/ex_cmds.c Tue Sep 05 13:37:47 2006 +0000
+++ b/src/ex_cmds.c Tue Sep 05 14:31:54 2006 +0000
@@ -2458,6 +2458,8 @@
24582458 #ifdef FEAT_AUTOCMD
24592459 apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf);
24602460 #endif
2461+ /* Change directories when the 'acd' option is set. */
2462+ DO_AUTOCHDIR
24612463 }
24622464 /* print full file name if :cd used */
24632465 fileinfo(FALSE, FALSE, eap->forceit);
@@ -2675,8 +2677,13 @@
26752677 eap, eap->append, eap->forceit, TRUE, FALSE);
26762678
26772679 /* After ":saveas fname" reset 'readonly'. */
2678- if (eap->cmdidx == CMD_saveas && retval == OK)
2679- curbuf->b_p_ro = FALSE;
2680+ if (eap->cmdidx == CMD_saveas)
2681+ {
2682+ if (retval == OK)
2683+ curbuf->b_p_ro = FALSE;
2684+ /* Change directories when the 'acd' option is set. */
2685+ DO_AUTOCHDIR
2686+ }
26802687 }
26812688
26822689 theend:
@@ -3547,11 +3554,9 @@
35473554 foldUpdateAll(curwin);
35483555 #endif
35493556
3550-#ifdef FEAT_AUTOCHDIR
3551- if (p_acd && curbuf->b_ffname != NULL
3552- && vim_chdirfile(curbuf->b_ffname) == OK)
3553- shorten_fnames(TRUE);
3554-#endif
3557+ /* Change directories when the 'acd' option is set. */
3558+ DO_AUTOCHDIR
3559+
35553560 /*
35563561 * Careful: open_buffer() and apply_autocmds() may change the current
35573562 * buffer and window.
@@ -3718,12 +3723,8 @@
37183723 if (p_im)
37193724 need_start_insertmode = TRUE;
37203725
3721-#ifdef FEAT_AUTOCHDIR
3722- /* Change directories when the acd option is set on. */
3723- if (p_acd && curbuf->b_ffname != NULL
3724- && vim_chdirfile(curbuf->b_ffname) == OK)
3725- shorten_fnames(TRUE);
3726-#endif
3726+ /* Change directories when the 'acd' option is set. */
3727+ DO_AUTOCHDIR
37273728
37283729 #if defined(FEAT_SUN_WORKSHOP) || defined(FEAT_NETBEANS_INTG)
37293730 if (gui.in_use && curbuf->b_ffname != NULL)
diff -r 8c8d07318d8d -r c06c658691e2 src/macros.h
--- a/src/macros.h Tue Sep 05 13:37:47 2006 +0000
+++ b/src/macros.h Tue Sep 05 14:31:54 2006 +0000
@@ -276,3 +276,9 @@
276276 # define MB_CHARLEN(p) STRLEN(p)
277277 # define PTR2CHAR(p) ((int)*(p))
278278 #endif
279+
280+#ifdef FEAT_AUTOCHDIR
281+# define DO_AUTOCHDIR if (p_acd) do_autochdir();
282+#else
283+# define DO_AUTOCHDIR
284+#endif
diff -r 8c8d07318d8d -r c06c658691e2 src/option.c
--- a/src/option.c Tue Sep 05 13:37:47 2006 +0000
+++ b/src/option.c Tue Sep 05 14:31:54 2006 +0000
@@ -7326,9 +7326,8 @@
73267326 #ifdef FEAT_AUTOCHDIR
73277327 else if ((int *)varp == &p_acd)
73287328 {
7329- if (p_acd && curbuf->b_ffname != NULL
7330- && vim_chdirfile(curbuf->b_ffname) == OK)
7331- shorten_fnames(TRUE);
7329+ /* Change directories when the 'acd' option is set now. */
7330+ DO_AUTOCHDIR
73327331 }
73337332 #endif
73347333
diff -r 8c8d07318d8d -r c06c658691e2 src/proto/buffer.pro
--- a/src/proto/buffer.pro Tue Sep 05 13:37:47 2006 +0000
+++ b/src/proto/buffer.pro Tue Sep 05 14:31:54 2006 +0000
@@ -10,6 +10,7 @@
1010 extern int do_buffer __ARGS((int action, int start, int dir, int count, int forceit));
1111 extern void set_curbuf __ARGS((buf_T *buf, int action));
1212 extern void enter_buffer __ARGS((buf_T *buf));
13+extern void do_autochdir __ARGS((void));
1314 extern buf_T *buflist_new __ARGS((char_u *ffname, char_u *sfname, linenr_T lnum, int flags));
1415 extern void free_buf_options __ARGS((buf_T *buf, int free_p_ff));
1516 extern int buflist_getfile __ARGS((int n, linenr_T lnum, int options, int forceit));
diff -r 8c8d07318d8d -r c06c658691e2 src/version.c
--- a/src/version.c Tue Sep 05 13:37:47 2006 +0000
+++ b/src/version.c Tue Sep 05 14:31:54 2006 +0000
@@ -667,6 +667,8 @@
667667 static int included_patches[] =
668668 { /* Add new patch number below this line */
669669 /**/
670+ 87,
671+/**/
670672 86,
671673 /**/
672674 85,
diff -r 8c8d07318d8d -r c06c658691e2 src/window.c
--- a/src/window.c Tue Sep 05 13:37:47 2006 +0000
+++ b/src/window.c Tue Sep 05 14:31:54 2006 +0000
@@ -3954,13 +3954,8 @@
39543954 setmouse(); /* in case jumped to/from help buffer */
39553955 #endif
39563956
3957-#ifdef FEAT_AUTOCHDIR
3958- /* Change directories when the 'acd' option is set on and after
3959- * switching windows. */
3960- if (p_acd && curbuf->b_ffname != NULL
3961- && vim_chdirfile(curbuf->b_ffname) == OK)
3962- shorten_fnames(TRUE);
3963-#endif
3957+ /* Change directories when the 'acd' option is set. */
3958+ DO_AUTOCHDIR
39643959 }
39653960
39663961 #endif /* FEAT_WINDOWS */
旧リポジトリブラウザで表示