Mercurial > vim
comparison src/testdir/test_textprop.vim @ 15255:19e79a1ed6b6 v8.1.0636
patch 8.1.0636: line2byte() gives wrong values with text properties
commit https://github.com/vim/vim/commit/b413d2e6a8cc7b1611a41bfa9462b986393ca5fe
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Dec 25 23:15:46 2018 +0100
patch 8.1.0636: line2byte() gives wrong values with text properties
Problem: line2byte() gives wrong values with text properties. (Bjorn Linse)
Solution: Compute byte offsets differently when text properties were added.
(closes #3718)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 25 Dec 2018 23:30:07 +0100 |
parents | 17525ca95e1e |
children | c5cb5151940d |
comparison
equal
deleted
inserted
replaced
15254:7790044a7348 | 15255:19e79a1ed6b6 |
---|---|
224 | 224 |
225 bwipe! | 225 bwipe! |
226 call prop_type_delete('comment') | 226 call prop_type_delete('comment') |
227 endfunc | 227 endfunc |
228 | 228 |
229 func Test_prop_byteoff() | |
230 call prop_type_add('comment', {'highlight': 'Directory'}) | |
231 new | |
232 call setline(1, ['line1', 'line2', '']) | |
233 call assert_equal(13, line2byte(3)) | |
234 call prop_add(1, 1, {'end_col': 3, 'type': 'comment'}) | |
235 call assert_equal(13, line2byte(3)) | |
236 | |
237 bwipe! | |
238 call prop_type_delete('comment') | |
239 endfunc | |
240 | |
229 | 241 |
230 " TODO: screenshot test with highlighting | 242 " TODO: screenshot test with highlighting |