Mercurial > vim
view src/testdir/bench_re_freeze.vim @ 18025:d19caa851682 v8.1.2008
patch 8.1.2008: error for invalid range when using listener and undo
Commit: https://github.com/vim/vim/commit/4544bd2f247425c9dd743c76618dd70f53c72538
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 8 15:27:21 2019 +0200
patch 8.1.2008: error for invalid range when using listener and undo
Problem: Error for invalid range when using listener and undo. (Paul Jolly)
Solution: Do not change the cursor before the lines are restored.
(closes #4908)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 08 Sep 2019 15:30:04 +0200 |
parents | adfbffe1e642 |
children |
line wrap: on
line source
"Test for benchmarking the RE engine so small.vim if !has("reltime") | finish | endif func! Measure(file, pattern, arg) for re in range(3) let sstart=reltime() let cmd=printf("../vim -u NONE -N --cmd ':set re=%d'". \ " -c 'call search(\"%s\", \"\", \"\", 10000)' -c ':q!' %s", re, escape(a:pattern, '\\'), empty(a:arg) ? '' : a:arg) call system(cmd. ' '. a:file) $put =printf('file: %s, re: %d, time: %s', a:file, re, reltimestr(reltime(sstart))) endfor endfunc