Mercurial > vim
annotate src/proto/textprop.pro @ 33713:9aa03e12b2b5 v9.0.2090
patch 9.0.2090: complete_info() skips entries with 'noselect'
Commit: https://github.com/vim/vim/commit/57f9ce1a0977da13e5923214086795ffa2d28ce1
Author: Christian Brabandt <cb@256bit.org>
Date: Sat Nov 4 09:58:14 2023 +0100
patch 9.0.2090: complete_info() skips entries with 'noselect'
Problem: complete_info() skips entries with 'noselect'
Solution: Check, if first entry is at original text state
Unfortunately, Commit daef8c74375141974d61b85199b383017644978c
introduced a regression, that when ':set completeopt+=noselect' is set
and no completion item has been selected yet, it did not fill the
complete_info['items'] list.
This happened, because the current match item did not have the
CP_ORIGINAL_TEXT flag set and then the cp->prev pointer did point to the
original flag item, which caused the following while loop to not being
run but being skipped instead.
So when the 'noselect' is set, only start with to the previous selection
item, if the initial completion item has the CP_ORIGINAL_TEXT flag set,
else use the 2nd previous item instead.
fixes: #13451
closes: #13452
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 04 Nov 2023 10:15:04 +0100 |
parents | 243c35fad9cb |
children |
rev | line source |
---|---|
15138
9df130fd5e0d
patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1 /* textprop.c */ |
17863
08f1dd29550e
patch 8.1.1928: popup windows don't move with the text when making changes
Bram Moolenaar <Bram@vim.org>
parents:
17789
diff
changeset
|
2 int find_prop_type_id(char_u *name, buf_T *buf); |
15138
9df130fd5e0d
patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3 void f_prop_add(typval_T *argvars, typval_T *rettv); |
25640
78ef12e0ce8c
patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents:
20583
diff
changeset
|
4 void f_prop_add_list(typval_T *argvars, typval_T *rettv); |
29451
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
25640
diff
changeset
|
5 int prop_add_common(linenr_T start_lnum, colnr_T start_col, dict_T *dict, buf_T *default_buf, typval_T *dict_arg); |
15138
9df130fd5e0d
patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
6 int get_text_props(buf_T *buf, linenr_T lnum, char_u **props, int will_change); |
30231
0d084880276a
patch 9.0.0451: virtual text "above" does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29816
diff
changeset
|
7 int prop_count_above_below(buf_T *buf, linenr_T lnum); |
29585
e357bc89bb95
patch 9.0.0133: virtual text after line moves to joined line
Bram Moolenaar <Bram@vim.org>
parents:
29451
diff
changeset
|
8 int count_props(linenr_T lnum, int only_starting, int last_line); |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29621
diff
changeset
|
9 void sort_text_props(buf_T *buf, textprop_T *props, int *idxs, int count); |
17863
08f1dd29550e
patch 8.1.1928: popup windows don't move with the text when making changes
Bram Moolenaar <Bram@vim.org>
parents:
17789
diff
changeset
|
10 int find_visible_prop(win_T *wp, int type_id, int id, textprop_T *prop, linenr_T *found_lnum); |
29609
e1c370197030
patch 9.0.0145: substitute that joins lines drops text properties
Bram Moolenaar <Bram@vim.org>
parents:
29585
diff
changeset
|
11 void add_text_props(linenr_T lnum, textprop_T *text_props, int text_prop_count); |
15138
9df130fd5e0d
patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
12 proptype_T *text_prop_type_by_id(buf_T *buf, int id); |
31319
243c35fad9cb
patch 9.0.0993: display errors when adding or removing text property type
Bram Moolenaar <Bram@vim.org>
parents:
30261
diff
changeset
|
13 int text_prop_type_valid(buf_T *buf, textprop_T *prop); |
15138
9df130fd5e0d
patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
14 void f_prop_clear(typval_T *argvars, typval_T *rettv); |
19100
91bb12995034
patch 8.2.0110: prop_find() is not implemented
Bram Moolenaar <Bram@vim.org>
parents:
17863
diff
changeset
|
15 void f_prop_find(typval_T *argvars, typval_T *rettv); |
15138
9df130fd5e0d
patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
16 void f_prop_list(typval_T *argvars, typval_T *rettv); |
9df130fd5e0d
patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
17 void f_prop_remove(typval_T *argvars, typval_T *rettv); |
9df130fd5e0d
patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
18 void f_prop_type_add(typval_T *argvars, typval_T *rettv); |
9df130fd5e0d
patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
19 void f_prop_type_change(typval_T *argvars, typval_T *rettv); |
9df130fd5e0d
patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
20 void f_prop_type_delete(typval_T *argvars, typval_T *rettv); |
9df130fd5e0d
patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
21 void f_prop_type_get(typval_T *argvars, typval_T *rettv); |
9df130fd5e0d
patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
22 void f_prop_type_list(typval_T *argvars, typval_T *rettv); |
9df130fd5e0d
patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
23 void clear_global_prop_types(void); |
9df130fd5e0d
patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
24 void clear_buf_prop_types(buf_T *buf); |
16714
ba592f30c082
patch 8.1.1359: text property wrong after :substitute with backslash
Bram Moolenaar <Bram@vim.org>
parents:
16698
diff
changeset
|
25 int adjust_prop_columns(linenr_T lnum, colnr_T col, int bytes_added, int flags); |
30261
6b658ef69e93
patch 9.0.0466: virtual text wrong after adding line break after line
Bram Moolenaar <Bram@vim.org>
parents:
30231
diff
changeset
|
26 void adjust_props_for_split(linenr_T lnum_props, linenr_T lnum_top, int kept, int deleted, int at_eol); |
29585
e357bc89bb95
patch 9.0.0133: virtual text after line moves to joined line
Bram Moolenaar <Bram@vim.org>
parents:
29451
diff
changeset
|
27 void prepend_joined_props(char_u *new_props, int propcount, int *props_remaining, linenr_T lnum, int last_line, long col, int removed); |
15138
9df130fd5e0d
patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
28 /* vim: set ft=c : */ |