diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-01-04 15:09:57 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-01-04 15:09:57 +0100 |
commit | ccae4672fd622f2feac8322be71b6e43e68dc4fc (patch) | |
tree | ac94dc01665017c2e109546a1f0e09ab7e5df728 /src/structs.h | |
parent | 6d3a1940be9d3f2b079f81baa9b19f839289b69e (diff) | |
download | vim-git-ccae4672fd622f2feac8322be71b6e43e68dc4fc.tar.gz |
patch 8.1.0688: text properties are not restored by undov8.1.0688
Problem: Text properties are not restored by undo.
Solution: Also save text properties for undo.
Diffstat (limited to 'src/structs.h')
-rw-r--r-- | src/structs.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/structs.h b/src/structs.h index 5b8c80b6e..a53d1d062 100644 --- a/src/structs.h +++ b/src/structs.h @@ -347,6 +347,14 @@ typedef struct * structures used for undo */ +// One line saved for undo. After the NUL terminated text there might be text +// properties, thus ul_len can be larger than STRLEN(ul_line) + 1. +typedef struct { + char_u *ul_line; // text of the line + long ul_len; // length of the line including NUL, plus text + // properties +} undoline_T; + typedef struct u_entry u_entry_T; typedef struct u_header u_header_T; struct u_entry @@ -355,7 +363,7 @@ struct u_entry linenr_T ue_top; /* number of line above undo block */ linenr_T ue_bot; /* number of line below undo block */ linenr_T ue_lcount; /* linecount when u_save called */ - char_u **ue_array; /* array of lines in undo block */ + undoline_T *ue_array; /* array of lines in undo block */ long ue_size; /* number of lines in ue_array */ #ifdef U_DEBUG int ue_magic; /* magic number to check allocation */ @@ -2167,7 +2175,7 @@ struct file_buffer /* * variables for "U" command in undo.c */ - char_u *b_u_line_ptr; /* saved line for "U" command */ + undoline_T b_u_line_ptr; /* saved line for "U" command */ linenr_T b_u_line_lnum; /* line number of line in u_line */ colnr_T b_u_line_colnr; /* optional column number */ |