Mercurial > vim
comparison src/insexpand.c @ 19201:e7b4fff348dd v8.2.0159
patch 8.2.0159: non-materialized range() list causes problems
Commit: https://github.com/vim/vim/commit/50985eb1f0bd3c73ce727f9bbd66c839c92ef0da
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jan 27 22:09:39 2020 +0100
patch 8.2.0159: non-materialized range() list causes problems
Problem: Non-materialized range() list causes problems. (Fujiwara Takuya)
Solution: Materialize the list where needed.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 27 Jan 2020 22:15:07 +0100 |
parents | 8cbadf7fb9d4 |
children | 435726a03481 |
comparison
equal
deleted
inserted
replaced
19200:654ef8f794a6 | 19201:e7b4fff348dd |
---|---|
2328 { | 2328 { |
2329 listitem_T *li; | 2329 listitem_T *li; |
2330 int dir = compl_direction; | 2330 int dir = compl_direction; |
2331 | 2331 |
2332 // Go through the List with matches and add each of them. | 2332 // Go through the List with matches and add each of them. |
2333 range_list_materialize(list); | |
2333 for (li = list->lv_first; li != NULL; li = li->li_next) | 2334 for (li = list->lv_first; li != NULL; li = li->li_next) |
2334 { | 2335 { |
2335 if (ins_compl_add_tv(&li->li_tv, dir) == OK) | 2336 if (ins_compl_add_tv(&li->li_tv, dir) == OK) |
2336 // if dir was BACKWARD then honor it just once | 2337 // if dir was BACKWARD then honor it just once |
2337 dir = FORWARD; | 2338 dir = FORWARD; |
2509 if (what_list == NULL) | 2510 if (what_list == NULL) |
2510 what_flag = CI_WHAT_ALL; | 2511 what_flag = CI_WHAT_ALL; |
2511 else | 2512 else |
2512 { | 2513 { |
2513 what_flag = 0; | 2514 what_flag = 0; |
2515 range_list_materialize(what_list); | |
2514 for (item = what_list->lv_first; item != NULL; item = item->li_next) | 2516 for (item = what_list->lv_first; item != NULL; item = item->li_next) |
2515 { | 2517 { |
2516 char_u *what = tv_get_string(&item->li_tv); | 2518 char_u *what = tv_get_string(&item->li_tv); |
2517 | 2519 |
2518 if (STRCMP(what, "mode") == 0) | 2520 if (STRCMP(what, "mode") == 0) |