Mercurial > vim
comparison src/ex_cmds.c @ 17476:d4b2a212fa2f v8.1.1736
patch 8.1.1736: viminfo support is spread out
commit https://github.com/vim/vim/commit/c3328169d5566b97a6a6921067017e4369dd7cd6
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jul 23 22:15:25 2019 +0200
patch 8.1.1736: viminfo support is spread out
Problem: Viminfo support is spread out.
Solution: Move more viminfo code to viminfo.c. (Yegappan Lakshmanan,
closes #4717) Reorder code to make most functions static.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 23 Jul 2019 22:30:07 +0200 |
parents | cfdef48743ed |
children | 8cca2654d459 |
comparison
equal
deleted
inserted
replaced
17475:8584e1c0e426 | 17476:d4b2a212fa2f |
---|---|
5083 if (!do_sub_msg(FALSE) && curbuf == old_buf) | 5083 if (!do_sub_msg(FALSE) && curbuf == old_buf) |
5084 msgmore(curbuf->b_ml.ml_line_count - old_lcount); | 5084 msgmore(curbuf->b_ml.ml_line_count - old_lcount); |
5085 } | 5085 } |
5086 | 5086 |
5087 #ifdef FEAT_VIMINFO | 5087 #ifdef FEAT_VIMINFO |
5088 int | 5088 /* |
5089 read_viminfo_sub_string(vir_T *virp, int force) | 5089 * Get the previous substitute pattern. |
5090 */ | |
5091 char_u * | |
5092 get_old_sub(void) | |
5090 { | 5093 { |
5091 if (force) | 5094 return old_sub; |
5092 vim_free(old_sub); | |
5093 if (force || old_sub == NULL) | |
5094 old_sub = viminfo_readstring(virp, 1, TRUE); | |
5095 return viminfo_readline(virp); | |
5096 } | 5095 } |
5097 | 5096 |
5097 /* | |
5098 * Set the previous substitute pattern. "val" must be allocated. | |
5099 */ | |
5098 void | 5100 void |
5099 write_viminfo_sub_string(FILE *fp) | 5101 set_old_sub(char_u *val) |
5100 { | 5102 { |
5101 if (get_viminfo_parameter('/') != 0 && old_sub != NULL) | 5103 vim_free(old_sub); |
5102 { | 5104 old_sub = val; |
5103 fputs(_("\n# Last Substitute String:\n$"), fp); | |
5104 viminfo_writestring(fp, old_sub); | |
5105 } | |
5106 } | 5105 } |
5107 #endif // FEAT_VIMINFO | 5106 #endif // FEAT_VIMINFO |
5108 | 5107 |
5109 #if defined(EXITFREE) || defined(PROTO) | 5108 #if defined(EXITFREE) || defined(PROTO) |
5110 void | 5109 void |