comparison src/textprop.c @ 15939:8013b532a1f7 v8.1.0975

patch 8.1.0975: using STRNCPY() wrongly. Warning for uninitialized variable commit https://github.com/vim/vim/commit/c666388367282c3c7d1d7af24883cfa0d40b046e Author: Bram Moolenaar <Bram@vim.org> Date: Fri Feb 22 19:14:54 2019 +0100 patch 8.1.0975: using STRNCPY() wrongly. Warning for uninitialized variable Problem: Using STRNCPY() wrongly. Warning for uninitialized variable. Solution: Use mch_memmove(). Initialize variable. (Yasuhiro Matsumoto, closes #3979)
author Bram Moolenaar <Bram@vim.org>
date Fri, 22 Feb 2019 19:15:12 +0100
parents 55ccc2d353bd
children 176872829dc2
comparison
equal deleted inserted replaced
15938:d44981435a1a 15939:8013b532a1f7
15 * 15 *
16 * Text properties have a user specified ID number, which can be unique. 16 * Text properties have a user specified ID number, which can be unique.
17 * Text properties have a type, which can be used to specify highlighting. 17 * Text properties have a type, which can be used to specify highlighting.
18 * 18 *
19 * TODO: 19 * TODO:
20 * - When using 'cursorline' attributes should be merged. (#3912)
20 * - Adjust text property column and length when text is inserted/deleted. 21 * - Adjust text property column and length when text is inserted/deleted.
21 * -> a :substitute with a multi-line match 22 * -> a :substitute with a multi-line match
22 * -> search for changed_bytes() from misc1.c 23 * -> search for changed_bytes() from misc1.c
23 * - Perhaps we only need TP_FLAG_CONT_NEXT and can drop TP_FLAG_CONT_PREV? 24 * - Perhaps we only need TP_FLAG_CONT_NEXT and can drop TP_FLAG_CONT_PREV?
24 * - Add an arrray for global_proptypes, to quickly lookup a prop type by ID 25 * - Add an arrray for global_proptypes, to quickly lookup a prop type by ID
25 * - Add an arrray for b_proptypes, to quickly lookup a prop type by ID 26 * - Add an arrray for b_proptypes, to quickly lookup a prop type by ID
26 * - Checking the text length to detect text properties is slow. Use a flag in 27 * - Checking the text length to detect text properties is slow. Use a flag in
27 * the index, like DB_MARKED? 28 * the index, like DB_MARKED?
28 * - Also test line2byte() with many lines, so that ml_updatechunk() is taken 29 * - Also test line2byte() with many lines, so that ml_updatechunk() is taken
29 * into account. 30 * into account.
30 * - add mechanism to keep track of changed lines. 31 * - Add mechanism to keep track of changed lines, so that plugin can update
32 * text properties in these.
33 * - Perhaps have a window-local option to disable highlighting from text
34 * properties?
31 */ 35 */
32 36
33 #include "vim.h" 37 #include "vim.h"
34 38
35 #if defined(FEAT_TEXT_PROP) || defined(PROTO) 39 #if defined(FEAT_TEXT_PROP) || defined(PROTO)
156 buf_T *buf = curbuf; 160 buf_T *buf = curbuf;
157 int id = 0; 161 int id = 0;
158 char_u *newtext; 162 char_u *newtext;
159 int proplen; 163 int proplen;
160 size_t textlen; 164 size_t textlen;
161 char_u *props; 165 char_u *props = NULL;
162 char_u *newprops; 166 char_u *newprops;
163 textprop_T tmp_prop; 167 textprop_T tmp_prop;
164 int i; 168 int i;
165 169
166 start_lnum = tv_get_number(&argvars[0]); 170 start_lnum = tv_get_number(&argvars[0]);