summaryrefslogtreecommitdiff
path: root/src/textprop.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-08-14 13:28:55 +0100
committerBram Moolenaar <Bram@vim.org>2022-08-14 13:28:55 +0100
commit28c9f895716cfa8f1220bc41b72a534c0e10cabe (patch)
tree274ccf5d35445ce4b46e733b209fb73edcf4ad0c /src/textprop.c
parent63acae13f57c5ad4c8ec3146d0c458550b9e984e (diff)
downloadvim-git-28c9f895716cfa8f1220bc41b72a534c0e10cabe.tar.gz
patch 9.0.0205: cursor in wrong position when inserting after virtual textv9.0.0205
Problem: Cursor in wrong position when inserting after virtual text. (Ben Jackson) Solution: Put the cursor after the virtual text, where the text will be inserted. (closes #10914)
Diffstat (limited to 'src/textprop.c')
-rw-r--r--src/textprop.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/textprop.c b/src/textprop.c
index 88156c272..e2de73165 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -294,7 +294,9 @@ prop_add_one(
tmp_prop.tp_type = type->pt_id;
tmp_prop.tp_flags = text_flags
| (lnum > start_lnum ? TP_FLAG_CONT_PREV : 0)
- | (lnum < end_lnum ? TP_FLAG_CONT_NEXT : 0);
+ | (lnum < end_lnum ? TP_FLAG_CONT_NEXT : 0)
+ | ((type->pt_flags & PT_FLAG_INS_START_INCL)
+ ? TP_FLAG_START_INCL : 0);
mch_memmove(newprops + i * sizeof(textprop_T), &tmp_prop,
sizeof(textprop_T));