comparison src/testdir/test_textprop.vim @ 19045:143d44d8f477 v8.2.0083

patch 8.2.0083: text properties wrong when tabs and spaces are exchanged Commit: https://github.com/vim/vim/commit/5cb0b93d52fa5c12ca50a18509947ee6459bb7a8 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jan 3 21:25:59 2020 +0100 patch 8.2.0083: text properties wrong when tabs and spaces are exchanged Problem: Text properties wrong when tabs and spaces are exchanged. Solution: Take text properties into account. (Nobuhiro Takasaki, closes #5427)
author Bram Moolenaar <Bram@vim.org>
date Fri, 03 Jan 2020 21:30:14 +0100
parents e2d9f4d030fa
children bcbc9fe665b5
comparison
equal deleted inserted replaced
19044:af795b6a2624 19045:143d44d8f477
923 :1s/[a-z]\{3\}//g 923 :1s/[a-z]\{3\}//g
924 let expected = [{'id': 0, 'col': 10, 'end': 1, 'type': 'number', 'length': 3, 'start': 1}] 924 let expected = [{'id': 0, 'col': 10, 'end': 1, 'type': 'number', 'length': 3, 'start': 1}]
925 call assert_equal(expected, prop_list(1)) 925 call assert_equal(expected, prop_list(1))
926 bwipe! 926 bwipe!
927 endfunc 927 endfunc
928
929 func Test_textprop_noexpandtab()
930 %bwipe!
931 new
932 let save_ts = &tabstop
933 set tabstop=8
934 let save_sts = &softtabstop
935 set softtabstop=4
936 let save_sw = &shiftwidth
937 set shiftwidth=4
938 let save_et = &expandtab
939 set noexpandtab
940 let save_fdm = &foldmethod
941 set foldmethod=marker
942 call feedkeys("\<esc>\<esc>0Ca\<cr>\<esc>\<up>", "tx")
943 call prop_type_add('test', {'highlight': 'ErrorMsg'})
944 call prop_add(1, 1, {'end_col': 2, 'type': 'test'})
945 call feedkeys("0i\<tab>", "tx")
946 call prop_remove({'type': 'test'})
947 call prop_add(1, 2, {'end_col': 3, 'type': 'test'})
948 call feedkeys("A\<left>\<tab>", "tx")
949 call prop_remove({'type': 'test'})
950 try
951 " It is correct that this does not pass
952 call prop_add(1, 6, {'end_col': 7, 'type': 'test'})
953 " Has already collapsed here, start_col:6 does not result in an error
954 call feedkeys("A\<left>\<tab>", "tx")
955 catch /^Vim\%((\a\+)\)\=:E964/
956 endtry
957 call prop_remove({'type': 'test'})
958 let &foldmethod = save_fdm
959 let &expandtab = save_et
960 let &shiftwidth = save_sw
961 let &softtabstop = save_sts
962 let &tabstop = save_ts
963 endfunc