Mercurial > vim
changeset 2240:6b4879aea261 vim73
Add test for gettabvar() and settabvar().
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Mon, 31 May 2010 21:27:30 +0200 |
parents | 732cb7b31956 |
children | 60da25e3aab7 |
files | runtime/doc/options.txt runtime/doc/todo.txt src/memline.c src/misc2.c src/testdir/test62.in src/testdir/test62.ok |
diffstat | 6 files changed, 38 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1450,6 +1450,8 @@ A jump table for the options with a shor as HTML. This works to copy rendered HTML from Firefox, paste it as raw HTML in Vim, select the HTML in Vim and paste it in a rich edit box in Firefox. + You probably want to add this only temporarily, + possibly use BufEnter autocommands. Only supported for GTK version 2 and later. Only available with the |+multi_byte| feature.
--- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1087,12 +1087,16 @@ Vim 7.3: Ron's version: http://dev.ronware.org/p/vim/finfo?name=gvim.nsi - Also crypt the swap file, each block separately. Change mf_write() and mf_read(). How to get b_p_key to these functions? + Generate seed for each block, store in pointer block. Block 1 is not + encrypted. + When changing the password need to read back with the old password and + write again with the new one. + Verify recovery works. +- Update for crypt code to use salt. (Mohsin May 30) + Make the strengthen_key value configurable and store it in the header. - Do profiling on sha256 code to find obvious bottlenecks. - Do profiling on crypt code to find obvious bottlenecks. -- Make 'clipboard' global-local, for "html"? Christian J. Robinson. Patches to include: -- Extend test62 for gettabvar() and settabvar(). (Yegappan Lakshmanan, 2010 - May 23) - Use off_t instead of long for bytes in a buffer. (James Vega, 2010 May 22, update next day) - Include conceal patch?
--- a/src/memline.c +++ b/src/memline.c @@ -87,7 +87,7 @@ struct pointer_entry struct pointer_block { short_u pb_id; /* ID for pointer block: PTR_ID */ - short_u pb_count; /* number of pointer in this block */ + short_u pb_count; /* number of pointers in this block */ short_u pb_count_max; /* maximum value for pb_count */ PTR_EN pb_pointer[1]; /* list of pointers to blocks (actually longer) * followed by empty space until end of page */ @@ -3270,7 +3270,8 @@ ml_new_ptr(mfp) pp = (PTR_BL *)(hp->bh_data); pp->pb_id = PTR_ID; pp->pb_count = 0; - pp->pb_count_max = (short_u)((mfp->mf_page_size - sizeof(PTR_BL)) / sizeof(PTR_EN) + 1); + pp->pb_count_max = (short_u)((mfp->mf_page_size - sizeof(PTR_BL)) + / sizeof(PTR_EN) + 1); return hp; }
--- a/src/misc2.c +++ b/src/misc2.c @@ -3749,7 +3749,7 @@ update_keys(c) int c; /* byte of plain text */ { if (use_crypt_method > 0) - bf_ofb_update( (unsigned char) c); + bf_ofb_update(c); else { keys[0] = CRC32(keys[0], c);
--- a/src/testdir/test62.in +++ b/src/testdir/test62.in @@ -26,6 +26,29 @@ STARTTEST :call append(line('$'), line2) :unlet line1 line2 :" +:" Test for settabvar() and gettabvar() functions. Open a new tab page and +:" set 3 variables to a number, string and a list. Verify that the variables +:" are correctly set. +:tabnew +:tabfirst +:call settabvar(2, 'val_num', 100) +:call settabvar(2, 'val_str', 'SetTabVar test') +:call settabvar(2, 'val_list', ['red', 'blue', 'green']) +:" +:let test_status = 'gettabvar: fail' +:if gettabvar(2, 'val_num') == 100 && gettabvar(2, 'val_str') == 'SetTabVar test') && gettabvar(2, 'val_list') == ['red', 'blue', 'green']) +: let test_status = 'gettabvar: pass' +:endif +:call append(line('$'), test_status) +:" +:tabnext 2 +:let test_status = 'settabvar: fail' +:if t:val_num == 100 && t:val_str == 'SetTabVar test' && t:val_list == ['red', 'blue', 'green'] +: let test_status = 'settabvar: pass' +:endif +:tabclose +:call append(line('$'), test_status) +:" :" :/^Results/,$w! test.out :qa!