Mercurial > vim
comparison src/fileio.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 | 10e0d7d96cb0 |
children | 0026ea34a8d5 |
comparison
equal
deleted
inserted
replaced
17475:8584e1c0e426 | 17476:d4b2a212fa2f |
---|---|
28 #define USE_MCH_ACCESS | 28 #define USE_MCH_ACCESS |
29 | 29 |
30 static char_u *next_fenc(char_u **pp); | 30 static char_u *next_fenc(char_u **pp); |
31 #ifdef FEAT_EVAL | 31 #ifdef FEAT_EVAL |
32 static char_u *readfile_charconvert(char_u *fname, char_u *fenc, int *fdp); | 32 static char_u *readfile_charconvert(char_u *fname, char_u *fenc, int *fdp); |
33 #endif | |
34 #ifdef FEAT_VIMINFO | |
35 static void check_marks_read(void); | |
36 #endif | 33 #endif |
37 #ifdef FEAT_CRYPT | 34 #ifdef FEAT_CRYPT |
38 static char_u *check_for_cryptkey(char_u *cryptkey, char_u *ptr, long *sizep, off_T *filesizep, int newfile, char_u *fname, int *did_ask); | 35 static char_u *check_for_cryptkey(char_u *cryptkey, char_u *ptr, long *sizep, off_T *filesizep, int newfile, char_u *fname, int *did_ask); |
39 #endif | 36 #endif |
40 static int set_rw_fname(char_u *fname, char_u *sfname); | 37 static int set_rw_fname(char_u *fname, char_u *sfname); |
2853 | 2850 |
2854 return tmpname; | 2851 return tmpname; |
2855 } | 2852 } |
2856 #endif | 2853 #endif |
2857 | 2854 |
2858 | |
2859 #ifdef FEAT_VIMINFO | |
2860 /* | |
2861 * Read marks for the current buffer from the viminfo file, when we support | |
2862 * buffer marks and the buffer has a name. | |
2863 */ | |
2864 static void | |
2865 check_marks_read(void) | |
2866 { | |
2867 if (!curbuf->b_marks_read && get_viminfo_parameter('\'') > 0 | |
2868 && curbuf->b_ffname != NULL) | |
2869 read_viminfo(NULL, VIF_WANT_MARKS); | |
2870 | |
2871 /* Always set b_marks_read; needed when 'viminfo' is changed to include | |
2872 * the ' parameter after opening a buffer. */ | |
2873 curbuf->b_marks_read = TRUE; | |
2874 } | |
2875 #endif | |
2876 | |
2877 #if defined(FEAT_CRYPT) || defined(PROTO) | 2855 #if defined(FEAT_CRYPT) || defined(PROTO) |
2878 /* | 2856 /* |
2879 * Check for magic number used for encryption. Applies to the current buffer. | 2857 * Check for magic number used for encryption. Applies to the current buffer. |
2880 * If found, the magic number is removed from ptr[*sizep] and *sizep and | 2858 * If found, the magic number is removed from ptr[*sizep] and *sizep and |
2881 * *filesizep are updated. | 2859 * *filesizep are updated. |