Mercurial > vim
comparison src/ex_docmd.c @ 17458:cfdef48743ed v8.1.1727
patch 8.1.1727: code for viminfo support is spread out
commit https://github.com/vim/vim/commit/defa067c54874dd987121dd7252c62755e0aebfa
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 21 19:25:37 2019 +0200
patch 8.1.1727: code for viminfo support is spread out
Problem: Code for viminfo support is spread out.
Solution: Move to code to viminfo.c. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/4686)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 21 Jul 2019 19:30:06 +0200 |
parents | ce35cdbe9f74 |
children | bba80d61ea73 |
comparison
equal
deleted
inserted
replaced
17457:3a368ff28a0b | 17458:cfdef48743ed |
---|---|
316 # define ex_loadview ex_ni | 316 # define ex_loadview ex_ni |
317 #endif | 317 #endif |
318 #ifndef FEAT_EVAL | 318 #ifndef FEAT_EVAL |
319 # define ex_compiler ex_ni | 319 # define ex_compiler ex_ni |
320 #endif | 320 #endif |
321 #ifdef FEAT_VIMINFO | 321 #ifndef FEAT_VIMINFO |
322 static void ex_viminfo(exarg_T *eap); | |
323 #else | |
324 # define ex_viminfo ex_ni | 322 # define ex_viminfo ex_ni |
325 #endif | 323 #endif |
326 static void ex_behave(exarg_T *eap); | 324 static void ex_behave(exarg_T *eap); |
327 static void ex_filetype(exarg_T *eap); | 325 static void ex_filetype(exarg_T *eap); |
328 static void ex_setfiletype(exarg_T *eap); | 326 static void ex_setfiletype(exarg_T *eap); |
10711 if (fputs(s, fd) < 0 || put_eol(fd) == FAIL) | 10709 if (fputs(s, fd) < 0 || put_eol(fd) == FAIL) |
10712 return FAIL; | 10710 return FAIL; |
10713 return OK; | 10711 return OK; |
10714 } | 10712 } |
10715 | 10713 |
10716 #ifdef FEAT_VIMINFO | |
10717 /* | |
10718 * ":rviminfo" and ":wviminfo". | |
10719 */ | |
10720 static void | |
10721 ex_viminfo( | |
10722 exarg_T *eap) | |
10723 { | |
10724 char_u *save_viminfo; | |
10725 | |
10726 save_viminfo = p_viminfo; | |
10727 if (*p_viminfo == NUL) | |
10728 p_viminfo = (char_u *)"'100"; | |
10729 if (eap->cmdidx == CMD_rviminfo) | |
10730 { | |
10731 if (read_viminfo(eap->arg, VIF_WANT_INFO | VIF_WANT_MARKS | |
10732 | (eap->forceit ? VIF_FORCEIT : 0)) == FAIL) | |
10733 emsg(_("E195: Cannot open viminfo file for reading")); | |
10734 } | |
10735 else | |
10736 write_viminfo(eap->arg, eap->forceit); | |
10737 p_viminfo = save_viminfo; | |
10738 } | |
10739 #endif | |
10740 | |
10741 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) || defined(PROTO) | 10714 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) || defined(PROTO) |
10742 /* | 10715 /* |
10743 * Make a dialog message in "buff[DIALOG_MSG_SIZE]". | 10716 * Make a dialog message in "buff[DIALOG_MSG_SIZE]". |
10744 * "format" must contain "%s". | 10717 * "format" must contain "%s". |
10745 */ | 10718 */ |