Mercurial > vim
comparison src/evalwindow.c @ 26796:63be149f733c v8.2.3926
patch 8.2.3926: build failure without the 'autochdir' option
Commit: https://github.com/vim/vim/commit/92f246e4f9936f15471d5ee71b9afd5f3e6e0653
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Dec 28 20:03:43 2021 +0000
patch 8.2.3926: build failure without the 'autochdir' option
Problem: Build failure without the 'autochdir' option. (John Marriott)
Solution: Add #ifdefs.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 28 Dec 2021 21:15:03 +0100 |
parents | c95a3f25b6b1 |
children | bce848ec8b1b |
comparison
equal
deleted
inserted
replaced
26795:c64f6f1f1fae | 26796:63be149f733c |
---|---|
707 if (wp != NULL && tp != NULL) | 707 if (wp != NULL && tp != NULL) |
708 { | 708 { |
709 pos_T curpos = wp->w_cursor; | 709 pos_T curpos = wp->w_cursor; |
710 char_u cwd[MAXPATHL]; | 710 char_u cwd[MAXPATHL]; |
711 int cwd_status; | 711 int cwd_status; |
712 #ifdef FEAT_AUTOCHDIR | |
712 char_u autocwd[MAXPATHL]; | 713 char_u autocwd[MAXPATHL]; |
713 int apply_acd = FALSE; | 714 int apply_acd = FALSE; |
715 #endif | |
714 | 716 |
715 cwd_status = mch_dirname(cwd, MAXPATHL); | 717 cwd_status = mch_dirname(cwd, MAXPATHL); |
716 | 718 |
719 #ifdef FEAT_AUTOCHDIR | |
717 // If 'acd' is set, check we are using that directory. If yes, then | 720 // If 'acd' is set, check we are using that directory. If yes, then |
718 // apply 'acd' afterwards, otherwise restore the current directory. | 721 // apply 'acd' afterwards, otherwise restore the current directory. |
719 if (cwd_status == OK && p_acd) | 722 if (cwd_status == OK && p_acd) |
720 { | 723 { |
721 do_autochdir(); | 724 do_autochdir(); |
722 apply_acd = mch_dirname(autocwd, MAXPATHL) == OK | 725 apply_acd = mch_dirname(autocwd, MAXPATHL) == OK |
723 && STRCMP(cwd, autocwd) == 0; | 726 && STRCMP(cwd, autocwd) == 0; |
724 } | 727 } |
728 #endif | |
725 | 729 |
726 if (switch_win_noblock(&save_curwin, &save_curtab, wp, tp, TRUE) == OK) | 730 if (switch_win_noblock(&save_curwin, &save_curtab, wp, tp, TRUE) == OK) |
727 { | 731 { |
728 check_cursor(); | 732 check_cursor(); |
729 execute_common(argvars, rettv, 1); | 733 execute_common(argvars, rettv, 1); |
730 } | 734 } |
731 restore_win_noblock(save_curwin, save_curtab, TRUE); | 735 restore_win_noblock(save_curwin, save_curtab, TRUE); |
736 #ifdef FEAT_AUTOCHDIR | |
732 if (apply_acd) | 737 if (apply_acd) |
733 do_autochdir(); | 738 do_autochdir(); |
734 else if (cwd_status == OK) | 739 else |
740 #endif | |
741 if (cwd_status == OK) | |
735 mch_chdir((char *)cwd); | 742 mch_chdir((char *)cwd); |
736 | 743 |
737 // Update the status line if the cursor moved. | 744 // Update the status line if the cursor moved. |
738 if (win_valid(wp) && !EQUAL_POS(curpos, wp->w_cursor)) | 745 if (win_valid(wp) && !EQUAL_POS(curpos, wp->w_cursor)) |
739 wp->w_redr_status = TRUE; | 746 wp->w_redr_status = TRUE; |