Commit c9e9bc7
committed
fix(insert): inherit the full plist when extending a uniform interval
insert-and-inherit / insert-before-markers-and-inherit / insert-char with
INHERIT compute the inherited properties via a between-intervals sticky merge
that skips the front-sticky/rear-nonsticky meta keys and re-derives them, so
inserting into the middle of one uniform interval dropped its
`rear-nonsticky nil` (and any front-sticky/rear-nonsticky value). GNU's
adjust_intervals_for_insertion (src/intervals.c) extends the interval and
inherits its full plist verbatim in that case.
Add a fast path at the top of inherited_text_properties_for_inserted_range_in_state:
when the insert is strictly interior (both neighbors present) and the two
neighbors carry the same property set -- our proxy for "one interval", since
neomacs coalesces equal adjacent intervals -- and no real property is
rear-nonsticky (by value or text-property-default-nonsticky), return the left
neighbor's full plist. Otherwise fall through to the existing merge.
Fixes insert_and_inherit_full_plist and insert_char_inherit_property_plist;
the rear-nonsticky-blocks and sticky-merge-matrix cases still pass.1 parent 2fbc7e7 commit c9e9bc7
1 file changed
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
897 | 923 | | |
898 | 924 | | |
899 | 925 | | |
| |||
0 commit comments