Mercurial > vim
comparison src/testdir/test_textprop.vim @ 25624:0ef8ef1af478 v8.2.3348
patch 8.2.3348: line2byte() returns wrong value after adding textprop
Commit: https://github.com/vim/vim/commit/14c7530c4fca786d3594508e28943f10125827c3
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 15 14:28:40 2021 +0200
patch 8.2.3348: line2byte() returns wrong value after adding textprop
Problem: line2byte() returns wrong value after adding textprop. (Yuto
Kimura)
Solution: Reduce the length by the size of the text property. (closes #8759)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 15 Aug 2021 14:30:04 +0200 |
parents | 3678a11e71fa |
children | 0407a3db3ef6 |
comparison
equal
deleted
inserted
replaced
25623:6d259614c0f4 | 25624:0ef8ef1af478 |
---|---|
807 call setline(1, ['line1', 'second line', '']) | 807 call setline(1, ['line1', 'second line', '']) |
808 set ff=unix | 808 set ff=unix |
809 call assert_equal(19, line2byte(3)) | 809 call assert_equal(19, line2byte(3)) |
810 call prop_add(1, 1, {'end_col': 3, 'type': 'comment'}) | 810 call prop_add(1, 1, {'end_col': 3, 'type': 'comment'}) |
811 call assert_equal(19, line2byte(3)) | 811 call assert_equal(19, line2byte(3)) |
812 | 812 bwipe! |
813 bwipe! | 813 |
814 new | |
815 call setline(1, range(500)) | |
816 call assert_equal(1491, line2byte(401)) | |
817 call prop_add(2, 1, {'type': 'comment'}) | |
818 call prop_add(222, 1, {'type': 'comment'}) | |
819 call assert_equal(1491, line2byte(401)) | |
820 call prop_remove({'type': 'comment'}) | |
821 call assert_equal(1491, line2byte(401)) | |
822 bwipe! | |
823 | |
814 call prop_type_delete('comment') | 824 call prop_type_delete('comment') |
815 endfunc | 825 endfunc |
816 | 826 |
817 func Test_prop_byte2line() | 827 func Test_prop_byte2line() |
818 new | 828 new |