Mercurial > vim
comparison src/testdir/test_textprop.vim @ 28854:647d7f439622 v8.2.4950
patch 8.2.4950: text properties position wrong after shifting text
Commit: https://github.com/vim/vim/commit/4b93674159d60c985de906c30f45dbaf2b64056f
Author: LemonBoy <thatlemon@gmail.com>
Date: Fri May 13 21:56:28 2022 +0100
patch 8.2.4950: text properties position wrong after shifting text
Problem: Text properties position wrong after shifting text.
Solution: Adjust the text properties when shifting a block of text.
(closes #10418)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 13 May 2022 23:00:03 +0200 |
parents | ba81f4ed59e2 |
children | 92736a673e3c |
comparison
equal
deleted
inserted
replaced
28853:e397a7fd7fc1 | 28854:647d7f439622 |
---|---|
1931 call DeletePropTypes() | 1931 call DeletePropTypes() |
1932 set spell& | 1932 set spell& |
1933 bwipe! | 1933 bwipe! |
1934 endfunc | 1934 endfunc |
1935 | 1935 |
1936 func Test_prop_shift_block() | |
1937 new | |
1938 call AddPropTypes() | |
1939 | |
1940 call setline(1, ['some highlighted text']->repeat(2)) | |
1941 call prop_add(1, 10, #{type: 'one', length: 11}) | |
1942 call prop_add(2, 10, #{type: 'two', length: 11}) | |
1943 | |
1944 call cursor(1, 1) | |
1945 call feedkeys("5l\<c-v>>", 'nxt') | |
1946 call cursor(2, 1) | |
1947 call feedkeys("5l\<c-v><", 'nxt') | |
1948 | |
1949 let expected = [ | |
1950 \ {'lnum': 1, 'id': 0, 'col': 8, 'type_bufnr': 0, 'end': 1, 'type': 'one', | |
1951 \ 'length': 11, 'start' : 1}, | |
1952 \ {'lnum': 2, 'id': 0, 'col': 6, 'type_bufnr': 0, 'end': 1, 'type': 'two', | |
1953 \ 'length': 11, 'start' : 1} | |
1954 \ ] | |
1955 call assert_equal(expected, prop_list(1, #{end_lnum: 2})) | |
1956 | |
1957 call DeletePropTypes() | |
1958 bwipe! | |
1959 endfunc | |
1936 | 1960 |
1937 " vim: shiftwidth=2 sts=2 expandtab | 1961 " vim: shiftwidth=2 sts=2 expandtab |