Skip to content
Snippets Groups Projects
Commit 9db58063 authored by Bram Moolenaar's avatar Bram Moolenaar
Browse files

Various improvements to undo file code to make it more robust.

parent f05e3b02
No related branches found
No related tags found
No related merge requests found
......@@ -4170,13 +4170,10 @@ E822 undo.txt /*E822*
E823 undo.txt /*E823*
E824 undo.txt /*E824*
E825 undo.txt /*E825*
E826 undo.txt /*E826*
E827 undo.txt /*E827*
E828 undo.txt /*E828*
E829 undo.txt /*E829*
E83 message.txt /*E83*
E830 undo.txt /*E830*
E831 undo.txt /*E831*
E84 windows.txt /*E84*
E85 options.txt /*E85*
E86 windows.txt /*E86*
......
......@@ -1097,6 +1097,7 @@ Vim 7.3:
- When there is no undo info (undolevels negative), delete the undo file.
- Need to check all values for evil manipulation.
- Add undofile(name): get undo file name for buffer "name".
- patch for unused functions. (Dominique Pelle, 2010 May 29)
- Also crypt the undo file.
- Also crypt the swap file, each block separately. Change mf_write() and
mf_read(). How to get b_p_key to these functions?
......
......@@ -267,10 +267,7 @@ Reading an existing undo file may fail for several reasons:
The file text differs from when the undo file was written. This means
the undo file cannot be used, it would corrupt the text. This also
happens when 'encoding' differs from when the undo file was written.
*E825* *E826* *E831*
The undo file does not contain valid contents and cannot be used.
*E827* The magic number at the end of the file was not found. This usually
means the file was truncated.
*E825* The undo file does not contain valid contents and cannot be used.
Writing an undo file may fail for these reasons:
*E828* The file to be written cannot be created. Perhaps you do not have
......
......@@ -2,7 +2,7 @@
" Language: sed
" Maintainer: Haakon Riiser <hakonrk@fys.uio.no>
" URL: http://folk.uio.no/hakonrk/vim/syntax/sed.vim
" Last Change: 2005 Dec 15
" Last Change: 2010 May 29
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
......@@ -49,7 +49,7 @@ syn match sedReplaceMeta "&\|\\\($\|.\)" contains=sedTab contained
" Metacharacters: $ * . \ ^ [ ~
" @ is used as delimiter and treated on its own below
let __at = char2nr("@")
let __sed_i = char2nr(" ")
let __sed_i = char2nr(" ") " ASCII: 32, EBCDIC: 64
if has("ebcdic")
let __sed_last = 255
else
......@@ -105,8 +105,8 @@ if version >= 508 || !exists("did_sed_syntax_inits")
if exists("highlight_sedtabs")
HiLink sedTab Todo
endif
let __sed_i = 32
while __sed_i <= 126
let __sed_i = char2nr(" ") " ASCII: 32, EBCDIC: 64
while __sed_i <= __sed_last
exe "HiLink sedRegexp".__sed_i "Macro"
exe "HiLink sedReplacement".__sed_i "NONE"
let __sed_i = __sed_i + 1
......@@ -115,7 +115,7 @@ if version >= 508 || !exists("did_sed_syntax_inits")
delcommand HiLink
endif
unlet __sed_i __sed_delimiter __sed_metacharacters
unlet __sed_i __sed_last __sed_delimiter __sed_metacharacters
let b:current_syntax = "sed"
......
......@@ -6134,7 +6134,7 @@ emsgn(s, n)
get2c(fd)
FILE *fd;
{
long n;
int n;
n = getc(fd);
n = (n << 8) + getc(fd);
......@@ -6148,7 +6148,7 @@ get2c(fd)
get3c(fd)
FILE *fd;
{
long n;
int n;
n = getc(fd);
n = (n << 8) + getc(fd);
......@@ -6163,7 +6163,7 @@ get3c(fd)
get4c(fd)
FILE *fd;
{
long n;
int n;
n = getc(fd);
n = (n << 8) + getc(fd);
......
/* undo.c */
void u_check __ARGS((int newhead_may_be_NULL));
int u_save_cursor __ARGS((void));
int u_save __ARGS((linenr_T top, linenr_T bot));
int u_savesub __ARGS((linenr_T lnum));
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment