Mercurial > vim
comparison src/testdir/test_textprop.vim @ 28526:171f9def0398 v8.2.4787
patch 8.2.4787: prop_find() does not find the right property
Commit: https://github.com/vim/vim/commit/9bd3ce22e36b5760a5e22e7d34d1bd6a3411258e
Author: LemonBoy <thatlemon@gmail.com>
Date: Mon Apr 18 21:54:02 2022 +0100
patch 8.2.4787: prop_find() does not find the right property
Problem: prop_find() does not find the right property.
Solution: Fix the scan order. (closes https://github.com/vim/vim/issues/10220)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 18 Apr 2022 23:00:03 +0200 |
parents | 95d6e3c9aa1e |
children | 77a00aa3e215 |
comparison
equal
deleted
inserted
replaced
28525:ea09c444fb6b | 28526:171f9def0398 |
---|---|
1845 :%bw! | 1845 :%bw! |
1846 END | 1846 END |
1847 call v9.CheckLegacyAndVim9Success(lines) | 1847 call v9.CheckLegacyAndVim9Success(lines) |
1848 endfunc | 1848 endfunc |
1849 | 1849 |
1850 func Test_prop_find_prev_on_same_line() | |
1851 new | |
1852 | |
1853 call setline(1, 'the quikc bronw fox jumsp over the layz dog') | |
1854 call prop_type_add('misspell', #{highlight: 'ErrorMsg'}) | |
1855 for col in [8, 14, 24, 38] | |
1856 call prop_add(1, col, #{type: 'misspell', length: 2}) | |
1857 endfor | |
1858 | |
1859 call cursor(1,18) | |
1860 let expected = [ | |
1861 \ #{lnum: 1, id: 0, col: 14, end: 1, type: 'misspell', type_bufnr: 0, length: 2, start: 1}, | |
1862 \ #{lnum: 1, id: 0, col: 24, end: 1, type: 'misspell', type_bufnr: 0, length: 2, start: 1} | |
1863 \ ] | |
1864 | |
1865 let result = prop_find(#{type: 'misspell'}, 'b') | |
1866 call assert_equal(expected[0], result) | |
1867 let result = prop_find(#{type: 'misspell'}, 'f') | |
1868 call assert_equal(expected[1], result) | |
1869 | |
1870 call prop_type_delete('misspell') | |
1871 bwipe! | |
1872 endfunc | |
1873 | |
1850 " vim: shiftwidth=2 sts=2 expandtab | 1874 " vim: shiftwidth=2 sts=2 expandtab |