Mercurial > vim
comparison src/testdir/test_set.vim @ 26400:d26bab4f6aca v8.2.3731
patch 8.2.3731: "set! termcap" shows codes in one column, but not keys
Commit: https://github.com/vim/vim/commit/15a24f08987e3831be255333bb84b7bc9c00db24
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Dec 3 20:43:24 2021 +0000
patch 8.2.3731: "set! termcap" shows codes in one column, but not keys
Problem: "set! termcap" shows codes in one column, but not keys.
Solution: Also use one column for keys. (closes https://github.com/vim/vim/issues/9258)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 03 Dec 2021 21:45:03 +0100 |
parents | dd98794f7d8c |
children | 9a7fb0665f9f |
comparison
equal
deleted
inserted
replaced
26399:0a13343e1eb9 | 26400:d26bab4f6aca |
---|---|
1 " Tests for the :set command | 1 " Tests for the :set command |
2 | |
3 source check.vim | |
2 | 4 |
3 function Test_set_backslash() | 5 function Test_set_backslash() |
4 let isk_save = &isk | 6 let isk_save = &isk |
5 | 7 |
6 set isk=a,b,c | 8 set isk=a,b,c |
43 let a = execute('setglobal') | 45 let a = execute('setglobal') |
44 call assert_match("^\n--- Global option values ---\n.*textwidth=77\\>", a) | 46 call assert_match("^\n--- Global option values ---\n.*textwidth=77\\>", a) |
45 setglobal textwidth& | 47 setglobal textwidth& |
46 endfunc | 48 endfunc |
47 | 49 |
50 func Test_set_termcap() | |
51 CheckNotGui | |
52 | |
53 let lines = split(execute('set termcap'), "\n") | |
54 call assert_match('--- Terminal codes ---', lines[0]) | |
55 " four columns | |
56 call assert_match('t_..=.*t_..=.*t_..=.*t_..=', lines[1]) | |
57 | |
58 for keys_idx in range(len(lines)) | |
59 if lines[keys_idx] =~ '--- Terminal keys ---' | |
60 break | |
61 endif | |
62 endfor | |
63 call assert_true(keys_idx < len(lines)) | |
64 " three columns | |
65 call assert_match('t_.. .*t_.. .*t_.. ', lines[keys_idx + 1]) | |
66 | |
67 let more_lines = split(execute('set! termcap'), "\n") | |
68 for i in range(len(more_lines)) | |
69 if more_lines[i] =~ '--- Terminal keys ---' | |
70 break | |
71 endif | |
72 endfor | |
73 call assert_true(i < len(more_lines)) | |
74 call assert_true(i > keys_idx) | |
75 call assert_true(len(more_lines) - i > len(lines) - keys_idx) | |
76 endfunc | |
77 | |
48 " vim: shiftwidth=2 sts=2 expandtab | 78 " vim: shiftwidth=2 sts=2 expandtab |