]>
Commit | Line | Data |
---|---|---|
d02ad552 AG |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 6.2.200 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=ISO-8859-1 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 6.2.200 | |
11 | Problem: When recovering a file, 'fileformat' is always the default, thus | |
12 | writing the file may result in differences. (Penelope Fudd) | |
13 | Solution: Before recovering the file try reading the original file to obtain | |
14 | the values of 'fileformat', 'fileencoding', etc. | |
15 | Files: src/memline.c | |
16 | ||
17 | ||
18 | *** ../vim-6.2.199/src/memline.c Sun May 25 17:26:29 2003 | |
19 | --- src/memline.c Wed Jan 21 10:31:41 2004 | |
20 | *************** | |
21 | *** 932,937 **** | |
22 | --- 932,949 ---- | |
23 | while (!(curbuf->b_ml.ml_flags & ML_EMPTY)) | |
24 | ml_delete((linenr_T)1, FALSE); | |
25 | ||
26 | + /* | |
27 | + * Try reading the original file to obtain the values of 'fileformat', | |
28 | + * 'fileencoding', etc. Ignore errors. The text itself is not used. | |
29 | + */ | |
30 | + if (curbuf->b_ffname != NULL) | |
31 | + { | |
32 | + (void)readfile(curbuf->b_ffname, NULL, (linenr_T)0, | |
33 | + (linenr_T)0, (linenr_T)MAXLNUM, NULL, READ_NEW); | |
34 | + while (!(curbuf->b_ml.ml_flags & ML_EMPTY)) | |
35 | + ml_delete((linenr_T)1, FALSE); | |
36 | + } | |
37 | + | |
38 | bnum = 1; /* start with block 1 */ | |
39 | page_count = 1; /* which is 1 page */ | |
40 | lnum = 0; /* append after line 0 in curbuf */ | |
41 | *** ../vim-6.2.199/src/version.c Sun Jan 25 19:40:26 2004 | |
42 | --- src/version.c Sun Jan 25 19:44:09 2004 | |
43 | *************** | |
44 | *** 639,640 **** | |
45 | --- 639,642 ---- | |
46 | { /* Add new patch number below this line */ | |
47 | + /**/ | |
48 | + 200, | |
49 | /**/ | |
50 | ||
51 | -- | |
52 | SIGIRO -- irony detected (iron core dumped) | |
53 | ||
54 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
55 | /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
56 | \\\ Project leader for A-A-P -- http://www.A-A-P.org /// | |
57 | \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html /// |