Mercurial > vim
comparison src/evalvars.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 | 2ef19eed524a |
children | d776967d0f0d |
comparison
equal
deleted
inserted
replaced
19200:654ef8f794a6 | 19201:e7b4fff348dd |
---|---|
841 { | 841 { |
842 emsg(_("E688: More targets than List items")); | 842 emsg(_("E688: More targets than List items")); |
843 return FAIL; | 843 return FAIL; |
844 } | 844 } |
845 | 845 |
846 range_list_materialize(l); | |
846 item = l->lv_first; | 847 item = l->lv_first; |
847 while (*arg != ']') | 848 while (*arg != ']') |
848 { | 849 { |
849 arg = skipwhite(arg + 1); | 850 arg = skipwhite(arg + 1); |
850 arg = ex_let_one(arg, &item->li_tv, TRUE, flags, (char_u *)",;]", op); | 851 arg = ex_let_one(arg, &item->li_tv, TRUE, flags, (char_u *)",;]", op); |
1697 { | 1698 { |
1698 if (lock) | 1699 if (lock) |
1699 l->lv_lock |= VAR_LOCKED; | 1700 l->lv_lock |= VAR_LOCKED; |
1700 else | 1701 else |
1701 l->lv_lock &= ~VAR_LOCKED; | 1702 l->lv_lock &= ~VAR_LOCKED; |
1702 if (deep < 0 || deep > 1) | 1703 if ((deep < 0 || deep > 1) && l->lv_first != &range_list_item) |
1703 // recursive: lock/unlock the items the List contains | 1704 // recursive: lock/unlock the items the List contains |
1704 for (li = l->lv_first; li != NULL; li = li->li_next) | 1705 for (li = l->lv_first; li != NULL; li = li->li_next) |
1705 item_lock(&li->li_tv, deep - 1, lock); | 1706 item_lock(&li->li_tv, deep - 1, lock); |
1706 } | 1707 } |
1707 break; | 1708 break; |