Mercurial > vim
comparison src/fileio.c @ 3342:bb67cd961fc3 v7.3.438
updated for version 7.3.438
Problem: There is no way to avoid ":doautoall" reading modelines.
Solution: Add the <nomodeline> argument. Adjust documentation.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 12 Feb 2012 00:18:58 +0100 |
parents | 539613ce999d |
children | 198ec1fff71a |
comparison
equal
deleted
inserted
replaced
3341:4d2f7f850f63 | 3342:bb67cd961fc3 |
---|---|
8737 exarg_T *eap; | 8737 exarg_T *eap; |
8738 { | 8738 { |
8739 int retval; | 8739 int retval; |
8740 aco_save_T aco; | 8740 aco_save_T aco; |
8741 buf_T *buf; | 8741 buf_T *buf; |
8742 char_u *arg = eap->arg; | |
8743 int call_do_modelines = TRUE; | |
8744 | |
8745 if (STRNCMP(arg, "<nomodeline>", 12) == 0) | |
8746 { | |
8747 call_do_modelines = FALSE; | |
8748 arg = skipwhite(arg + 12); | |
8749 } | |
8742 | 8750 |
8743 /* | 8751 /* |
8744 * This is a bit tricky: For some commands curwin->w_buffer needs to be | 8752 * This is a bit tricky: For some commands curwin->w_buffer needs to be |
8745 * equal to curbuf, but for some buffers there may not be a window. | 8753 * equal to curbuf, but for some buffers there may not be a window. |
8746 * So we change the buffer for the current window for a moment. This | 8754 * So we change the buffer for the current window for a moment. This |
8753 { | 8761 { |
8754 /* find a window for this buffer and save some values */ | 8762 /* find a window for this buffer and save some values */ |
8755 aucmd_prepbuf(&aco, buf); | 8763 aucmd_prepbuf(&aco, buf); |
8756 | 8764 |
8757 /* execute the autocommands for this buffer */ | 8765 /* execute the autocommands for this buffer */ |
8758 retval = do_doautocmd(eap->arg, FALSE); | 8766 retval = do_doautocmd(arg, FALSE); |
8759 | 8767 |
8760 /* Execute the modeline settings, but don't set window-local | 8768 if (call_do_modelines) |
8761 * options if we are using the current window for another buffer. */ | 8769 { |
8762 do_modelines(curwin == aucmd_win ? OPT_NOWIN : 0); | 8770 /* Execute the modeline settings, but don't set window-local |
8771 * options if we are using the current window for another | |
8772 * buffer. */ | |
8773 do_modelines(curwin == aucmd_win ? OPT_NOWIN : 0); | |
8774 } | |
8763 | 8775 |
8764 /* restore the current window */ | 8776 /* restore the current window */ |
8765 aucmd_restbuf(&aco); | 8777 aucmd_restbuf(&aco); |
8766 | 8778 |
8767 /* stop if there is some error or buffer was deleted */ | 8779 /* stop if there is some error or buffer was deleted */ |