|
Karsten Hopp |
3bddd3 |
To: vim-dev@vim.org
|
|
Karsten Hopp |
3bddd3 |
Subject: Patch 7.1.211
|
|
Karsten Hopp |
3bddd3 |
Fcc: outbox
|
|
Karsten Hopp |
3bddd3 |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
3bddd3 |
Mime-Version: 1.0
|
|
Karsten Hopp |
3bddd3 |
Content-Type: text/plain; charset=ISO-8859-1
|
|
Karsten Hopp |
3bddd3 |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
3bddd3 |
------------
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
Patch 7.1.211
|
|
Karsten Hopp |
3bddd3 |
Problem: The matchparen plugin may take an unexpected amount of time, so
|
|
Karsten Hopp |
3bddd3 |
that it looks like Vim hangs.
|
|
Karsten Hopp |
3bddd3 |
Solution: Add a timeout to searchpair(), searchpairpos(), search() and
|
|
Karsten Hopp |
3bddd3 |
searchpos(). Use half a second timeout in the plugin.
|
|
Karsten Hopp |
3bddd3 |
Files: runtime/doc/eval.txt, runtime/plugin/matchparen.vim, src/edit.c,
|
|
Karsten Hopp |
3bddd3 |
src/eval.c, src/ex_cmds2.c, src/ex_docmd.c, src/normal.c,
|
|
Karsten Hopp |
3bddd3 |
src/proto/eval.pro, src/proto/ex_cmds2.pro, src/proto/search.pro,
|
|
Karsten Hopp |
3bddd3 |
src/search.c
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
*** ../vim-7.1.210/runtime/doc/eval.txt Sat Jan 5 13:34:01 2008
|
|
Karsten Hopp |
3bddd3 |
--- runtime/doc/eval.txt Sun Jan 6 16:27:33 2008
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 1,4 ****
|
|
Karsten Hopp |
3bddd3 |
! *eval.txt* For Vim version 7.1. Last change: 2008 Jan 04
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
VIM REFERENCE MANUAL by Bram Moolenaar
|
|
Karsten Hopp |
3bddd3 |
--- 1,4 ----
|
|
Karsten Hopp |
3bddd3 |
! *eval.txt* For Vim version 7.1. Last change: 2008 Jan 06
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
VIM REFERENCE MANUAL by Bram Moolenaar
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 1733,1746 ****
|
|
Karsten Hopp |
3bddd3 |
repeat( {expr}, {count}) String repeat {expr} {count} times
|
|
Karsten Hopp |
3bddd3 |
resolve( {filename}) String get filename a shortcut points to
|
|
Karsten Hopp |
3bddd3 |
reverse( {list}) List reverse {list} in-place
|
|
Karsten Hopp |
3bddd3 |
! search( {pattern} [, {flags}]) Number search for {pattern}
|
|
Karsten Hopp |
3bddd3 |
searchdecl({name} [, {global} [, {thisblock}]])
|
|
Karsten Hopp |
3bddd3 |
Number search for variable declaration
|
|
Karsten Hopp |
3bddd3 |
! searchpair( {start}, {middle}, {end} [, {flags} [, {skip} [, {stopline}]]])
|
|
Karsten Hopp |
3bddd3 |
Number search for other end of start/end pair
|
|
Karsten Hopp |
3bddd3 |
! searchpairpos( {start}, {middle}, {end} [, {flags} [, {skip} [, {stopline}]]])
|
|
Karsten Hopp |
3bddd3 |
List search for other end of start/end pair
|
|
Karsten Hopp |
3bddd3 |
! searchpos( {pattern} [, {flags} [, {stopline}]])
|
|
Karsten Hopp |
3bddd3 |
List search for {pattern}
|
|
Karsten Hopp |
3bddd3 |
server2client( {clientid}, {string})
|
|
Karsten Hopp |
3bddd3 |
Number send reply string
|
|
Karsten Hopp |
3bddd3 |
--- 1733,1747 ----
|
|
Karsten Hopp |
3bddd3 |
repeat( {expr}, {count}) String repeat {expr} {count} times
|
|
Karsten Hopp |
3bddd3 |
resolve( {filename}) String get filename a shortcut points to
|
|
Karsten Hopp |
3bddd3 |
reverse( {list}) List reverse {list} in-place
|
|
Karsten Hopp |
3bddd3 |
! search( {pattern} [, {flags} [, {stopline} [, {timeout}]]])
|
|
Karsten Hopp |
3bddd3 |
! Number search for {pattern}
|
|
Karsten Hopp |
3bddd3 |
searchdecl({name} [, {global} [, {thisblock}]])
|
|
Karsten Hopp |
3bddd3 |
Number search for variable declaration
|
|
Karsten Hopp |
3bddd3 |
! searchpair( {start}, {middle}, {end} [, {flags} [, {skip} [...]]])
|
|
Karsten Hopp |
3bddd3 |
Number search for other end of start/end pair
|
|
Karsten Hopp |
3bddd3 |
! searchpairpos( {start}, {middle}, {end} [, {flags} [, {skip} [...]]])
|
|
Karsten Hopp |
3bddd3 |
List search for other end of start/end pair
|
|
Karsten Hopp |
3bddd3 |
! searchpos( {pattern} [, {flags} [, {stopline} [, {timeout}]]])
|
|
Karsten Hopp |
3bddd3 |
List search for {pattern}
|
|
Karsten Hopp |
3bddd3 |
server2client( {clientid}, {string})
|
|
Karsten Hopp |
3bddd3 |
Number send reply string
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 4212,4218 ****
|
|
Karsten Hopp |
3bddd3 |
If you want a list to remain unmodified make a copy first: >
|
|
Karsten Hopp |
3bddd3 |
:let revlist = reverse(copy(mylist))
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
! search({pattern} [, {flags} [, {stopline}]]) *search()*
|
|
Karsten Hopp |
3bddd3 |
Search for regexp pattern {pattern}. The search starts at the
|
|
Karsten Hopp |
3bddd3 |
cursor position (you can use |cursor()| to set it).
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
--- 4216,4222 ----
|
|
Karsten Hopp |
3bddd3 |
If you want a list to remain unmodified make a copy first: >
|
|
Karsten Hopp |
3bddd3 |
:let revlist = reverse(copy(mylist))
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
! search({pattern} [, {flags} [, {stopline} [, {timeout}]]]) *search()*
|
|
Karsten Hopp |
3bddd3 |
Search for regexp pattern {pattern}. The search starts at the
|
|
Karsten Hopp |
3bddd3 |
cursor position (you can use |cursor()| to set it).
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 4240,4245 ****
|
|
Karsten Hopp |
3bddd3 |
--- 4244,4257 ----
|
|
Karsten Hopp |
3bddd3 |
let end = search('END', '', line("w$"))
|
|
Karsten Hopp |
3bddd3 |
< When {stopline} is used and it is not zero this also implies
|
|
Karsten Hopp |
3bddd3 |
that the search does not wrap around the end of the file.
|
|
Karsten Hopp |
3bddd3 |
+ A zero value is equal to not giving the argument.
|
|
Karsten Hopp |
3bddd3 |
+
|
|
Karsten Hopp |
3bddd3 |
+ When the {timeout} argument is given the search stops when
|
|
Karsten Hopp |
3bddd3 |
+ more than this many milli seconds have passed. Thus when
|
|
Karsten Hopp |
3bddd3 |
+ {timeout} is 500 the search stops after half a second.
|
|
Karsten Hopp |
3bddd3 |
+ The value must not be negative. A zero value is like not
|
|
Karsten Hopp |
3bddd3 |
+ giving the argument.
|
|
Karsten Hopp |
3bddd3 |
+ {only available when compiled with the +reltime feature}
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
If there is no match a 0 is returned and the cursor doesn't
|
|
Karsten Hopp |
3bddd3 |
move. No error message is given.
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 4302,4308 ****
|
|
Karsten Hopp |
3bddd3 |
endif
|
|
Karsten Hopp |
3bddd3 |
<
|
|
Karsten Hopp |
3bddd3 |
*searchpair()*
|
|
Karsten Hopp |
3bddd3 |
! searchpair({start}, {middle}, {end} [, {flags} [, {skip} [, {stopline}]]])
|
|
Karsten Hopp |
3bddd3 |
Search for the match of a nested start-end pair. This can be
|
|
Karsten Hopp |
3bddd3 |
used to find the "endif" that matches an "if", while other
|
|
Karsten Hopp |
3bddd3 |
if/endif pairs in between are ignored.
|
|
Karsten Hopp |
3bddd3 |
--- 4314,4321 ----
|
|
Karsten Hopp |
3bddd3 |
endif
|
|
Karsten Hopp |
3bddd3 |
<
|
|
Karsten Hopp |
3bddd3 |
*searchpair()*
|
|
Karsten Hopp |
3bddd3 |
! searchpair({start}, {middle}, {end} [, {flags} [, {skip}
|
|
Karsten Hopp |
3bddd3 |
! [, {stopline} [, {timeout}]]]])
|
|
Karsten Hopp |
3bddd3 |
Search for the match of a nested start-end pair. This can be
|
|
Karsten Hopp |
3bddd3 |
used to find the "endif" that matches an "if", while other
|
|
Karsten Hopp |
3bddd3 |
if/endif pairs in between are ignored.
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 4337,4343 ****
|
|
Karsten Hopp |
3bddd3 |
When evaluating {skip} causes an error the search is aborted
|
|
Karsten Hopp |
3bddd3 |
and -1 returned.
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
! For {stopline} see |search()|.
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
The value of 'ignorecase' is used. 'magic' is ignored, the
|
|
Karsten Hopp |
3bddd3 |
patterns are used like it's on.
|
|
Karsten Hopp |
3bddd3 |
--- 4350,4356 ----
|
|
Karsten Hopp |
3bddd3 |
When evaluating {skip} causes an error the search is aborted
|
|
Karsten Hopp |
3bddd3 |
and -1 returned.
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
! For {stopline} and {timeout} see |search()|.
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
The value of 'ignorecase' is used. 'magic' is ignored, the
|
|
Karsten Hopp |
3bddd3 |
patterns are used like it's on.
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 4383,4389 ****
|
|
Karsten Hopp |
3bddd3 |
\ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string"')
|
|
Karsten Hopp |
3bddd3 |
<
|
|
Karsten Hopp |
3bddd3 |
*searchpairpos()*
|
|
Karsten Hopp |
3bddd3 |
! searchpairpos({start}, {middle}, {end} [, {flags} [, {skip} [, {stopline}]]])
|
|
Karsten Hopp |
3bddd3 |
Same as searchpair(), but returns a |List| with the line and
|
|
Karsten Hopp |
3bddd3 |
column position of the match. The first element of the |List|
|
|
Karsten Hopp |
3bddd3 |
is the line number and the second element is the byte index of
|
|
Karsten Hopp |
3bddd3 |
--- 4396,4403 ----
|
|
Karsten Hopp |
3bddd3 |
\ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string"')
|
|
Karsten Hopp |
3bddd3 |
<
|
|
Karsten Hopp |
3bddd3 |
*searchpairpos()*
|
|
Karsten Hopp |
3bddd3 |
! searchpairpos({start}, {middle}, {end} [, {flags} [, {skip}
|
|
Karsten Hopp |
3bddd3 |
! [, {stopline} [, {timeout}]]]])
|
|
Karsten Hopp |
3bddd3 |
Same as searchpair(), but returns a |List| with the line and
|
|
Karsten Hopp |
3bddd3 |
column position of the match. The first element of the |List|
|
|
Karsten Hopp |
3bddd3 |
is the line number and the second element is the byte index of
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 4394,4400 ****
|
|
Karsten Hopp |
3bddd3 |
<
|
|
Karsten Hopp |
3bddd3 |
See |match-parens| for a bigger and more useful example.
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
! searchpos({pattern} [, {flags} [, {stopline}]]) *searchpos()*
|
|
Karsten Hopp |
3bddd3 |
Same as |search()|, but returns a |List| with the line and
|
|
Karsten Hopp |
3bddd3 |
column position of the match. The first element of the |List|
|
|
Karsten Hopp |
3bddd3 |
is the line number and the second element is the byte index of
|
|
Karsten Hopp |
3bddd3 |
--- 4408,4414 ----
|
|
Karsten Hopp |
3bddd3 |
<
|
|
Karsten Hopp |
3bddd3 |
See |match-parens| for a bigger and more useful example.
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
! searchpos({pattern} [, {flags} [, {stopline} [, {timeout}]]]) *searchpos()*
|
|
Karsten Hopp |
3bddd3 |
Same as |search()|, but returns a |List| with the line and
|
|
Karsten Hopp |
3bddd3 |
column position of the match. The first element of the |List|
|
|
Karsten Hopp |
3bddd3 |
is the line number and the second element is the byte index of
|
|
Karsten Hopp |
3bddd3 |
*** ../vim-7.1.210/runtime/plugin/matchparen.vim Sat Aug 18 18:20:57 2007
|
|
Karsten Hopp |
3bddd3 |
--- runtime/plugin/matchparen.vim Sun Jan 6 16:22:39 2008
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 1,6 ****
|
|
Karsten Hopp |
3bddd3 |
" Vim plugin for showing matching parens
|
|
Karsten Hopp |
3bddd3 |
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
|
Karsten Hopp |
3bddd3 |
! " Last Change: 2007 Aug 8
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
" Exit quickly when:
|
|
Karsten Hopp |
3bddd3 |
" - this plugin was already loaded (or disabled)
|
|
Karsten Hopp |
3bddd3 |
--- 1,6 ----
|
|
Karsten Hopp |
3bddd3 |
" Vim plugin for showing matching parens
|
|
Karsten Hopp |
3bddd3 |
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
|
Karsten Hopp |
3bddd3 |
! " Last Change: 2008 Jan 06
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
" Exit quickly when:
|
|
Karsten Hopp |
3bddd3 |
" - this plugin was already loaded (or disabled)
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 111,117 ****
|
|
Karsten Hopp |
3bddd3 |
\ '=~? "string\\|character\\|singlequote\\|comment"'
|
|
Karsten Hopp |
3bddd3 |
execute 'if' s_skip '| let s_skip = 0 | endif'
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
! let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
if before > 0
|
|
Karsten Hopp |
3bddd3 |
call winrestview(save_cursor)
|
|
Karsten Hopp |
3bddd3 |
--- 111,122 ----
|
|
Karsten Hopp |
3bddd3 |
\ '=~? "string\\|character\\|singlequote\\|comment"'
|
|
Karsten Hopp |
3bddd3 |
execute 'if' s_skip '| let s_skip = 0 | endif'
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
! try
|
|
Karsten Hopp |
3bddd3 |
! " Limit the search time to 500 msec to avoid a hang on very long lines.
|
|
Karsten Hopp |
3bddd3 |
! let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, 500)
|
|
Karsten Hopp |
3bddd3 |
! catch /E118/
|
|
Karsten Hopp |
3bddd3 |
! let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
|
|
Karsten Hopp |
3bddd3 |
! endtry
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
if before > 0
|
|
Karsten Hopp |
3bddd3 |
call winrestview(save_cursor)
|
|
Karsten Hopp |
3bddd3 |
*** ../vim-7.1.210/src/edit.c Wed Jan 2 22:08:43 2008
|
|
Karsten Hopp |
3bddd3 |
--- src/edit.c Sun Jan 6 16:08:00 2008
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 4062,4068 ****
|
|
Karsten Hopp |
3bddd3 |
found_new_match = searchit(NULL, ins_buf, pos,
|
|
Karsten Hopp |
3bddd3 |
compl_direction,
|
|
Karsten Hopp |
3bddd3 |
compl_pattern, 1L, SEARCH_KEEP + SEARCH_NFMSG,
|
|
Karsten Hopp |
3bddd3 |
! RE_LAST, (linenr_T)0);
|
|
Karsten Hopp |
3bddd3 |
--msg_silent;
|
|
Karsten Hopp |
3bddd3 |
if (!compl_started)
|
|
Karsten Hopp |
3bddd3 |
{
|
|
Karsten Hopp |
3bddd3 |
--- 4062,4068 ----
|
|
Karsten Hopp |
3bddd3 |
found_new_match = searchit(NULL, ins_buf, pos,
|
|
Karsten Hopp |
3bddd3 |
compl_direction,
|
|
Karsten Hopp |
3bddd3 |
compl_pattern, 1L, SEARCH_KEEP + SEARCH_NFMSG,
|
|
Karsten Hopp |
3bddd3 |
! RE_LAST, (linenr_T)0, NULL);
|
|
Karsten Hopp |
3bddd3 |
--msg_silent;
|
|
Karsten Hopp |
3bddd3 |
if (!compl_started)
|
|
Karsten Hopp |
3bddd3 |
{
|
|
Karsten Hopp |
3bddd3 |
*** ../vim-7.1.210/src/eval.c Sat Jan 5 22:15:21 2008
|
|
Karsten Hopp |
3bddd3 |
--- src/eval.c Sun Jan 6 16:37:42 2008
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 7213,7223 ****
|
|
Karsten Hopp |
3bddd3 |
{"repeat", 2, 2, f_repeat},
|
|
Karsten Hopp |
3bddd3 |
{"resolve", 1, 1, f_resolve},
|
|
Karsten Hopp |
3bddd3 |
{"reverse", 1, 1, f_reverse},
|
|
Karsten Hopp |
3bddd3 |
! {"search", 1, 3, f_search},
|
|
Karsten Hopp |
3bddd3 |
{"searchdecl", 1, 3, f_searchdecl},
|
|
Karsten Hopp |
3bddd3 |
! {"searchpair", 3, 6, f_searchpair},
|
|
Karsten Hopp |
3bddd3 |
! {"searchpairpos", 3, 6, f_searchpairpos},
|
|
Karsten Hopp |
3bddd3 |
! {"searchpos", 1, 3, f_searchpos},
|
|
Karsten Hopp |
3bddd3 |
{"server2client", 2, 2, f_server2client},
|
|
Karsten Hopp |
3bddd3 |
{"serverlist", 0, 0, f_serverlist},
|
|
Karsten Hopp |
3bddd3 |
{"setbufvar", 3, 3, f_setbufvar},
|
|
Karsten Hopp |
3bddd3 |
--- 7213,7223 ----
|
|
Karsten Hopp |
3bddd3 |
{"repeat", 2, 2, f_repeat},
|
|
Karsten Hopp |
3bddd3 |
{"resolve", 1, 1, f_resolve},
|
|
Karsten Hopp |
3bddd3 |
{"reverse", 1, 1, f_reverse},
|
|
Karsten Hopp |
3bddd3 |
! {"search", 1, 4, f_search},
|
|
Karsten Hopp |
3bddd3 |
{"searchdecl", 1, 3, f_searchdecl},
|
|
Karsten Hopp |
3bddd3 |
! {"searchpair", 3, 7, f_searchpair},
|
|
Karsten Hopp |
3bddd3 |
! {"searchpairpos", 3, 7, f_searchpairpos},
|
|
Karsten Hopp |
3bddd3 |
! {"searchpos", 1, 4, f_searchpos},
|
|
Karsten Hopp |
3bddd3 |
{"server2client", 2, 2, f_server2client},
|
|
Karsten Hopp |
3bddd3 |
{"serverlist", 0, 0, f_serverlist},
|
|
Karsten Hopp |
3bddd3 |
{"setbufvar", 3, 3, f_setbufvar},
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 14020,14025 ****
|
|
Karsten Hopp |
3bddd3 |
--- 14020,14029 ----
|
|
Karsten Hopp |
3bddd3 |
int dir;
|
|
Karsten Hopp |
3bddd3 |
int retval = 0; /* default: FAIL */
|
|
Karsten Hopp |
3bddd3 |
long lnum_stop = 0;
|
|
Karsten Hopp |
3bddd3 |
+ proftime_T tm;
|
|
Karsten Hopp |
3bddd3 |
+ #ifdef FEAT_RELTIME
|
|
Karsten Hopp |
3bddd3 |
+ long time_limit = 0;
|
|
Karsten Hopp |
3bddd3 |
+ #endif
|
|
Karsten Hopp |
3bddd3 |
int options = SEARCH_KEEP;
|
|
Karsten Hopp |
3bddd3 |
int subpatnum;
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 14033,14047 ****
|
|
Karsten Hopp |
3bddd3 |
if (flags & SP_END)
|
|
Karsten Hopp |
3bddd3 |
options |= SEARCH_END;
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
! /* Optional extra argument: line number to stop searching. */
|
|
Karsten Hopp |
3bddd3 |
! if (argvars[1].v_type != VAR_UNKNOWN
|
|
Karsten Hopp |
3bddd3 |
! && argvars[2].v_type != VAR_UNKNOWN)
|
|
Karsten Hopp |
3bddd3 |
{
|
|
Karsten Hopp |
3bddd3 |
lnum_stop = get_tv_number_chk(&argvars[2], NULL);
|
|
Karsten Hopp |
3bddd3 |
if (lnum_stop < 0)
|
|
Karsten Hopp |
3bddd3 |
goto theend;
|
|
Karsten Hopp |
3bddd3 |
}
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
/*
|
|
Karsten Hopp |
3bddd3 |
* This function does not accept SP_REPEAT and SP_RETCOUNT flags.
|
|
Karsten Hopp |
3bddd3 |
* Check to make sure only those flags are set.
|
|
Karsten Hopp |
3bddd3 |
--- 14037,14063 ----
|
|
Karsten Hopp |
3bddd3 |
if (flags & SP_END)
|
|
Karsten Hopp |
3bddd3 |
options |= SEARCH_END;
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
! /* Optional arguments: line number to stop searching and timeout. */
|
|
Karsten Hopp |
3bddd3 |
! if (argvars[1].v_type != VAR_UNKNOWN && argvars[2].v_type != VAR_UNKNOWN)
|
|
Karsten Hopp |
3bddd3 |
{
|
|
Karsten Hopp |
3bddd3 |
lnum_stop = get_tv_number_chk(&argvars[2], NULL);
|
|
Karsten Hopp |
3bddd3 |
if (lnum_stop < 0)
|
|
Karsten Hopp |
3bddd3 |
goto theend;
|
|
Karsten Hopp |
3bddd3 |
+ #ifdef FEAT_RELTIME
|
|
Karsten Hopp |
3bddd3 |
+ if (argvars[3].v_type != VAR_UNKNOWN)
|
|
Karsten Hopp |
3bddd3 |
+ {
|
|
Karsten Hopp |
3bddd3 |
+ time_limit = get_tv_number_chk(&argvars[3], NULL);
|
|
Karsten Hopp |
3bddd3 |
+ if (time_limit < 0)
|
|
Karsten Hopp |
3bddd3 |
+ goto theend;
|
|
Karsten Hopp |
3bddd3 |
+ }
|
|
Karsten Hopp |
3bddd3 |
+ #endif
|
|
Karsten Hopp |
3bddd3 |
}
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
+ #ifdef FEAT_RELTIME
|
|
Karsten Hopp |
3bddd3 |
+ /* Set the time limit, if there is one. */
|
|
Karsten Hopp |
3bddd3 |
+ profile_setlimit(time_limit, &tm;;
|
|
Karsten Hopp |
3bddd3 |
+ #endif
|
|
Karsten Hopp |
3bddd3 |
+
|
|
Karsten Hopp |
3bddd3 |
/*
|
|
Karsten Hopp |
3bddd3 |
* This function does not accept SP_REPEAT and SP_RETCOUNT flags.
|
|
Karsten Hopp |
3bddd3 |
* Check to make sure only those flags are set.
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 14057,14063 ****
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
pos = save_cursor = curwin->w_cursor;
|
|
Karsten Hopp |
3bddd3 |
subpatnum = searchit(curwin, curbuf, &pos, dir, pat, 1L,
|
|
Karsten Hopp |
3bddd3 |
! options, RE_SEARCH, (linenr_T)lnum_stop);
|
|
Karsten Hopp |
3bddd3 |
if (subpatnum != FAIL)
|
|
Karsten Hopp |
3bddd3 |
{
|
|
Karsten Hopp |
3bddd3 |
if (flags & SP_SUBPAT)
|
|
Karsten Hopp |
3bddd3 |
--- 14073,14079 ----
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
pos = save_cursor = curwin->w_cursor;
|
|
Karsten Hopp |
3bddd3 |
subpatnum = searchit(curwin, curbuf, &pos, dir, pat, 1L,
|
|
Karsten Hopp |
3bddd3 |
! options, RE_SEARCH, (linenr_T)lnum_stop, &tm;;
|
|
Karsten Hopp |
3bddd3 |
if (subpatnum != FAIL)
|
|
Karsten Hopp |
3bddd3 |
{
|
|
Karsten Hopp |
3bddd3 |
if (flags & SP_SUBPAT)
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 14147,14152 ****
|
|
Karsten Hopp |
3bddd3 |
--- 14163,14169 ----
|
|
Karsten Hopp |
3bddd3 |
char_u nbuf3[NUMBUFLEN];
|
|
Karsten Hopp |
3bddd3 |
int retval = 0; /* default: FAIL */
|
|
Karsten Hopp |
3bddd3 |
long lnum_stop = 0;
|
|
Karsten Hopp |
3bddd3 |
+ long time_limit = 0;
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
/* Get the three pattern arguments: start, middle, end. */
|
|
Karsten Hopp |
3bddd3 |
spat = get_tv_string_chk(&argvars[0]);
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 14182,14194 ****
|
|
Karsten Hopp |
3bddd3 |
lnum_stop = get_tv_number_chk(&argvars[5], NULL);
|
|
Karsten Hopp |
3bddd3 |
if (lnum_stop < 0)
|
|
Karsten Hopp |
3bddd3 |
goto theend;
|
|
Karsten Hopp |
3bddd3 |
}
|
|
Karsten Hopp |
3bddd3 |
}
|
|
Karsten Hopp |
3bddd3 |
if (skip == NULL)
|
|
Karsten Hopp |
3bddd3 |
goto theend; /* type error */
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
retval = do_searchpair(spat, mpat, epat, dir, skip, flags,
|
|
Karsten Hopp |
3bddd3 |
! match_pos, lnum_stop);
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
theend:
|
|
Karsten Hopp |
3bddd3 |
p_ws = save_p_ws;
|
|
Karsten Hopp |
3bddd3 |
--- 14199,14219 ----
|
|
Karsten Hopp |
3bddd3 |
lnum_stop = get_tv_number_chk(&argvars[5], NULL);
|
|
Karsten Hopp |
3bddd3 |
if (lnum_stop < 0)
|
|
Karsten Hopp |
3bddd3 |
goto theend;
|
|
Karsten Hopp |
3bddd3 |
+ #ifdef FEAT_RELTIME
|
|
Karsten Hopp |
3bddd3 |
+ if (argvars[6].v_type != VAR_UNKNOWN)
|
|
Karsten Hopp |
3bddd3 |
+ {
|
|
Karsten Hopp |
3bddd3 |
+ time_limit = get_tv_number_chk(&argvars[6], NULL);
|
|
Karsten Hopp |
3bddd3 |
+ if (time_limit < 0)
|
|
Karsten Hopp |
3bddd3 |
+ goto theend;
|
|
Karsten Hopp |
3bddd3 |
+ }
|
|
Karsten Hopp |
3bddd3 |
+ #endif
|
|
Karsten Hopp |
3bddd3 |
}
|
|
Karsten Hopp |
3bddd3 |
}
|
|
Karsten Hopp |
3bddd3 |
if (skip == NULL)
|
|
Karsten Hopp |
3bddd3 |
goto theend; /* type error */
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
retval = do_searchpair(spat, mpat, epat, dir, skip, flags,
|
|
Karsten Hopp |
3bddd3 |
! match_pos, lnum_stop, time_limit);
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
theend:
|
|
Karsten Hopp |
3bddd3 |
p_ws = save_p_ws;
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 14240,14246 ****
|
|
Karsten Hopp |
3bddd3 |
* Returns 0 or -1 for no match,
|
|
Karsten Hopp |
3bddd3 |
*/
|
|
Karsten Hopp |
3bddd3 |
long
|
|
Karsten Hopp |
3bddd3 |
! do_searchpair(spat, mpat, epat, dir, skip, flags, match_pos, lnum_stop)
|
|
Karsten Hopp |
3bddd3 |
char_u *spat; /* start pattern */
|
|
Karsten Hopp |
3bddd3 |
char_u *mpat; /* middle pattern */
|
|
Karsten Hopp |
3bddd3 |
char_u *epat; /* end pattern */
|
|
Karsten Hopp |
3bddd3 |
--- 14265,14272 ----
|
|
Karsten Hopp |
3bddd3 |
* Returns 0 or -1 for no match,
|
|
Karsten Hopp |
3bddd3 |
*/
|
|
Karsten Hopp |
3bddd3 |
long
|
|
Karsten Hopp |
3bddd3 |
! do_searchpair(spat, mpat, epat, dir, skip, flags, match_pos,
|
|
Karsten Hopp |
3bddd3 |
! lnum_stop, time_limit)
|
|
Karsten Hopp |
3bddd3 |
char_u *spat; /* start pattern */
|
|
Karsten Hopp |
3bddd3 |
char_u *mpat; /* middle pattern */
|
|
Karsten Hopp |
3bddd3 |
char_u *epat; /* end pattern */
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 14249,14254 ****
|
|
Karsten Hopp |
3bddd3 |
--- 14275,14281 ----
|
|
Karsten Hopp |
3bddd3 |
int flags; /* SP_SETPCMARK and other SP_ values */
|
|
Karsten Hopp |
3bddd3 |
pos_T *match_pos;
|
|
Karsten Hopp |
3bddd3 |
linenr_T lnum_stop; /* stop at this line if not zero */
|
|
Karsten Hopp |
3bddd3 |
+ long time_limit; /* stop after this many msec */
|
|
Karsten Hopp |
3bddd3 |
{
|
|
Karsten Hopp |
3bddd3 |
char_u *save_cpo;
|
|
Karsten Hopp |
3bddd3 |
char_u *pat, *pat2 = NULL, *pat3 = NULL;
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 14263,14273 ****
|
|
Karsten Hopp |
3bddd3 |
--- 14290,14306 ----
|
|
Karsten Hopp |
3bddd3 |
int nest = 1;
|
|
Karsten Hopp |
3bddd3 |
int err;
|
|
Karsten Hopp |
3bddd3 |
int options = SEARCH_KEEP;
|
|
Karsten Hopp |
3bddd3 |
+ proftime_T tm;
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
/* Make 'cpoptions' empty, the 'l' flag should not be used here. */
|
|
Karsten Hopp |
3bddd3 |
save_cpo = p_cpo;
|
|
Karsten Hopp |
3bddd3 |
p_cpo = (char_u *)"";
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
+ #ifdef FEAT_RELTIME
|
|
Karsten Hopp |
3bddd3 |
+ /* Set the time limit, if there is one. */
|
|
Karsten Hopp |
3bddd3 |
+ profile_setlimit(time_limit, &tm;;
|
|
Karsten Hopp |
3bddd3 |
+ #endif
|
|
Karsten Hopp |
3bddd3 |
+
|
|
Karsten Hopp |
3bddd3 |
/* Make two search patterns: start/end (pat2, for in nested pairs) and
|
|
Karsten Hopp |
3bddd3 |
* start/middle/end (pat3, for the top pair). */
|
|
Karsten Hopp |
3bddd3 |
pat2 = alloc((unsigned)(STRLEN(spat) + STRLEN(epat) + 15));
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 14291,14297 ****
|
|
Karsten Hopp |
3bddd3 |
for (;;)
|
|
Karsten Hopp |
3bddd3 |
{
|
|
Karsten Hopp |
3bddd3 |
n = searchit(curwin, curbuf, &pos, dir, pat, 1L,
|
|
Karsten Hopp |
3bddd3 |
! options, RE_SEARCH, lnum_stop);
|
|
Karsten Hopp |
3bddd3 |
if (n == FAIL || (firstpos.lnum != 0 && equalpos(pos, firstpos)))
|
|
Karsten Hopp |
3bddd3 |
/* didn't find it or found the first match again: FAIL */
|
|
Karsten Hopp |
3bddd3 |
break;
|
|
Karsten Hopp |
3bddd3 |
--- 14324,14330 ----
|
|
Karsten Hopp |
3bddd3 |
for (;;)
|
|
Karsten Hopp |
3bddd3 |
{
|
|
Karsten Hopp |
3bddd3 |
n = searchit(curwin, curbuf, &pos, dir, pat, 1L,
|
|
Karsten Hopp |
3bddd3 |
! options, RE_SEARCH, lnum_stop, &tm;;
|
|
Karsten Hopp |
3bddd3 |
if (n == FAIL || (firstpos.lnum != 0 && equalpos(pos, firstpos)))
|
|
Karsten Hopp |
3bddd3 |
/* didn't find it or found the first match again: FAIL */
|
|
Karsten Hopp |
3bddd3 |
break;
|
|
Karsten Hopp |
3bddd3 |
*** ../vim-7.1.210/src/ex_cmds2.c Fri Jan 4 16:00:10 2008
|
|
Karsten Hopp |
3bddd3 |
--- src/ex_cmds2.c Sun Jan 6 18:22:28 2008
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 895,913 ****
|
|
Karsten Hopp |
3bddd3 |
sprintf(buf, "%10.6lf", (double)tm->QuadPart / (double)fr.QuadPart);
|
|
Karsten Hopp |
3bddd3 |
# else
|
|
Karsten Hopp |
3bddd3 |
sprintf(buf, "%3ld.%06ld", (long)tm->tv_sec, (long)tm->tv_usec);
|
|
Karsten Hopp |
3bddd3 |
! #endif
|
|
Karsten Hopp |
3bddd3 |
return buf;
|
|
Karsten Hopp |
3bddd3 |
}
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
! # endif /* FEAT_PROFILE || FEAT_RELTIME */
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
- # if defined(FEAT_PROFILE) || defined(PROTO)
|
|
Karsten Hopp |
3bddd3 |
/*
|
|
Karsten Hopp |
3bddd3 |
! * Functions for profiling.
|
|
Karsten Hopp |
3bddd3 |
*/
|
|
Karsten Hopp |
3bddd3 |
! static void script_do_profile __ARGS((scriptitem_T *si));
|
|
Karsten Hopp |
3bddd3 |
! static void script_dump_profile __ARGS((FILE *fd));
|
|
Karsten Hopp |
3bddd3 |
! static proftime_T prof_wait_time;
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
/*
|
|
Karsten Hopp |
3bddd3 |
* Set the time in "tm" to zero.
|
|
Karsten Hopp |
3bddd3 |
--- 895,955 ----
|
|
Karsten Hopp |
3bddd3 |
sprintf(buf, "%10.6lf", (double)tm->QuadPart / (double)fr.QuadPart);
|
|
Karsten Hopp |
3bddd3 |
# else
|
|
Karsten Hopp |
3bddd3 |
sprintf(buf, "%3ld.%06ld", (long)tm->tv_sec, (long)tm->tv_usec);
|
|
Karsten Hopp |
3bddd3 |
! # endif
|
|
Karsten Hopp |
3bddd3 |
return buf;
|
|
Karsten Hopp |
3bddd3 |
}
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
! /*
|
|
Karsten Hopp |
3bddd3 |
! * Put the time "msec" past now in "tm".
|
|
Karsten Hopp |
3bddd3 |
! */
|
|
Karsten Hopp |
3bddd3 |
! void
|
|
Karsten Hopp |
3bddd3 |
! profile_setlimit(msec, tm)
|
|
Karsten Hopp |
3bddd3 |
! long msec;
|
|
Karsten Hopp |
3bddd3 |
! proftime_T *tm;
|
|
Karsten Hopp |
3bddd3 |
! {
|
|
Karsten Hopp |
3bddd3 |
! if (msec <= 0) /* no limit */
|
|
Karsten Hopp |
3bddd3 |
! profile_zero(tm);
|
|
Karsten Hopp |
3bddd3 |
! else
|
|
Karsten Hopp |
3bddd3 |
! {
|
|
Karsten Hopp |
3bddd3 |
! # ifdef WIN3264
|
|
Karsten Hopp |
3bddd3 |
! LARGE_INTEGER fr;
|
|
Karsten Hopp |
3bddd3 |
!
|
|
Karsten Hopp |
3bddd3 |
! QueryPerformanceCounter(tm);
|
|
Karsten Hopp |
3bddd3 |
! QueryPerformanceFrequency(&fr);
|
|
Karsten Hopp |
3bddd3 |
! tm->QuadPart += (double)msec / 1000.0 * (double)fr.QuadPart;
|
|
Karsten Hopp |
3bddd3 |
! # else
|
|
Karsten Hopp |
3bddd3 |
! long usec;
|
|
Karsten Hopp |
3bddd3 |
!
|
|
Karsten Hopp |
3bddd3 |
! gettimeofday(tm, NULL);
|
|
Karsten Hopp |
3bddd3 |
! usec = (long)tm->tv_usec + (long)msec * 1000;
|
|
Karsten Hopp |
3bddd3 |
! tm->tv_usec = usec % 1000000L;
|
|
Karsten Hopp |
3bddd3 |
! tm->tv_sec += usec / 1000000L;
|
|
Karsten Hopp |
3bddd3 |
! # endif
|
|
Karsten Hopp |
3bddd3 |
! }
|
|
Karsten Hopp |
3bddd3 |
! }
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
/*
|
|
Karsten Hopp |
3bddd3 |
! * Return TRUE if the current time is past "tm".
|
|
Karsten Hopp |
3bddd3 |
*/
|
|
Karsten Hopp |
3bddd3 |
! int
|
|
Karsten Hopp |
3bddd3 |
! profile_passed_limit(tm)
|
|
Karsten Hopp |
3bddd3 |
! proftime_T *tm;
|
|
Karsten Hopp |
3bddd3 |
! {
|
|
Karsten Hopp |
3bddd3 |
! proftime_T now;
|
|
Karsten Hopp |
3bddd3 |
!
|
|
Karsten Hopp |
3bddd3 |
! # ifdef WIN3264
|
|
Karsten Hopp |
3bddd3 |
! if (tm->QuadPart == 0) /* timer was not set */
|
|
Karsten Hopp |
3bddd3 |
! return FALSE;
|
|
Karsten Hopp |
3bddd3 |
! QueryPerformanceCounter(&now;;
|
|
Karsten Hopp |
3bddd3 |
! return (now.QuadPart > tm->QuadPart);
|
|
Karsten Hopp |
3bddd3 |
! # else
|
|
Karsten Hopp |
3bddd3 |
! if (tm->tv_sec == 0) /* timer was not set */
|
|
Karsten Hopp |
3bddd3 |
! return FALSE;
|
|
Karsten Hopp |
3bddd3 |
! gettimeofday(&now, NULL);
|
|
Karsten Hopp |
3bddd3 |
! return (now.tv_sec > tm->tv_sec
|
|
Karsten Hopp |
3bddd3 |
! || (now.tv_sec == tm->tv_sec && now.tv_usec > tm->tv_usec));
|
|
Karsten Hopp |
3bddd3 |
! # endif
|
|
Karsten Hopp |
3bddd3 |
! }
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
/*
|
|
Karsten Hopp |
3bddd3 |
* Set the time in "tm" to zero.
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 923,928 ****
|
|
Karsten Hopp |
3bddd3 |
--- 965,980 ----
|
|
Karsten Hopp |
3bddd3 |
tm->tv_sec = 0;
|
|
Karsten Hopp |
3bddd3 |
# endif
|
|
Karsten Hopp |
3bddd3 |
}
|
|
Karsten Hopp |
3bddd3 |
+
|
|
Karsten Hopp |
3bddd3 |
+ # endif /* FEAT_PROFILE || FEAT_RELTIME */
|
|
Karsten Hopp |
3bddd3 |
+
|
|
Karsten Hopp |
3bddd3 |
+ # if defined(FEAT_PROFILE) || defined(PROTO)
|
|
Karsten Hopp |
3bddd3 |
+ /*
|
|
Karsten Hopp |
3bddd3 |
+ * Functions for profiling.
|
|
Karsten Hopp |
3bddd3 |
+ */
|
|
Karsten Hopp |
3bddd3 |
+ static void script_do_profile __ARGS((scriptitem_T *si));
|
|
Karsten Hopp |
3bddd3 |
+ static void script_dump_profile __ARGS((FILE *fd));
|
|
Karsten Hopp |
3bddd3 |
+ static proftime_T prof_wait_time;
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
/*
|
|
Karsten Hopp |
3bddd3 |
* Add the time "tm2" to "tm".
|
|
Karsten Hopp |
3bddd3 |
*** ../vim-7.1.210/src/ex_docmd.c Fri Jan 4 16:00:10 2008
|
|
Karsten Hopp |
3bddd3 |
--- src/ex_docmd.c Sun Jan 6 16:08:29 2008
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 3979,3985 ****
|
|
Karsten Hopp |
3bddd3 |
*cmd == '?' ? BACKWARD : FORWARD,
|
|
Karsten Hopp |
3bddd3 |
(char_u *)"", 1L,
|
|
Karsten Hopp |
3bddd3 |
SEARCH_MSG + SEARCH_START,
|
|
Karsten Hopp |
3bddd3 |
! i, (linenr_T)0) != FAIL)
|
|
Karsten Hopp |
3bddd3 |
lnum = pos.lnum;
|
|
Karsten Hopp |
3bddd3 |
else
|
|
Karsten Hopp |
3bddd3 |
{
|
|
Karsten Hopp |
3bddd3 |
--- 3980,3986 ----
|
|
Karsten Hopp |
3bddd3 |
*cmd == '?' ? BACKWARD : FORWARD,
|
|
Karsten Hopp |
3bddd3 |
(char_u *)"", 1L,
|
|
Karsten Hopp |
3bddd3 |
SEARCH_MSG + SEARCH_START,
|
|
Karsten Hopp |
3bddd3 |
! i, (linenr_T)0, NULL) != FAIL)
|
|
Karsten Hopp |
3bddd3 |
lnum = pos.lnum;
|
|
Karsten Hopp |
3bddd3 |
else
|
|
Karsten Hopp |
3bddd3 |
{
|
|
Karsten Hopp |
3bddd3 |
*** ../vim-7.1.210/src/normal.c Sat Jan 5 13:34:01 2008
|
|
Karsten Hopp |
3bddd3 |
--- src/normal.c Sun Jan 6 16:08:54 2008
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 4194,4200 ****
|
|
Karsten Hopp |
3bddd3 |
for (;;)
|
|
Karsten Hopp |
3bddd3 |
{
|
|
Karsten Hopp |
3bddd3 |
t = searchit(curwin, curbuf, &curwin->w_cursor, FORWARD,
|
|
Karsten Hopp |
3bddd3 |
! pat, 1L, searchflags, RE_LAST, (linenr_T)0);
|
|
Karsten Hopp |
3bddd3 |
if (curwin->w_cursor.lnum >= old_pos.lnum)
|
|
Karsten Hopp |
3bddd3 |
t = FAIL; /* match after start is failure too */
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
--- 4194,4200 ----
|
|
Karsten Hopp |
3bddd3 |
for (;;)
|
|
Karsten Hopp |
3bddd3 |
{
|
|
Karsten Hopp |
3bddd3 |
t = searchit(curwin, curbuf, &curwin->w_cursor, FORWARD,
|
|
Karsten Hopp |
3bddd3 |
! pat, 1L, searchflags, RE_LAST, (linenr_T)0, NULL);
|
|
Karsten Hopp |
3bddd3 |
if (curwin->w_cursor.lnum >= old_pos.lnum)
|
|
Karsten Hopp |
3bddd3 |
t = FAIL; /* match after start is failure too */
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
*** ../vim-7.1.210/src/proto/eval.pro Sun May 6 15:18:09 2007
|
|
Karsten Hopp |
3bddd3 |
--- src/proto/eval.pro Sun Jan 6 15:55:47 2008
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 54,60 ****
|
|
Karsten Hopp |
3bddd3 |
long get_dict_number __ARGS((dict_T *d, char_u *key));
|
|
Karsten Hopp |
3bddd3 |
char_u *get_function_name __ARGS((expand_T *xp, int idx));
|
|
Karsten Hopp |
3bddd3 |
char_u *get_expr_name __ARGS((expand_T *xp, int idx));
|
|
Karsten Hopp |
3bddd3 |
! long do_searchpair __ARGS((char_u *spat, char_u *mpat, char_u *epat, int dir, char_u *skip, int flags, pos_T *match_pos, linenr_T lnum_stop));
|
|
Karsten Hopp |
3bddd3 |
void set_vim_var_nr __ARGS((int idx, long val));
|
|
Karsten Hopp |
3bddd3 |
long get_vim_var_nr __ARGS((int idx));
|
|
Karsten Hopp |
3bddd3 |
char_u *get_vim_var_str __ARGS((int idx));
|
|
Karsten Hopp |
3bddd3 |
--- 54,60 ----
|
|
Karsten Hopp |
3bddd3 |
long get_dict_number __ARGS((dict_T *d, char_u *key));
|
|
Karsten Hopp |
3bddd3 |
char_u *get_function_name __ARGS((expand_T *xp, int idx));
|
|
Karsten Hopp |
3bddd3 |
char_u *get_expr_name __ARGS((expand_T *xp, int idx));
|
|
Karsten Hopp |
3bddd3 |
! long do_searchpair __ARGS((char_u *spat, char_u *mpat, char_u *epat, int dir, char_u *skip, int flags, pos_T *match_pos, linenr_T lnum_stop, long time_limit));
|
|
Karsten Hopp |
3bddd3 |
void set_vim_var_nr __ARGS((int idx, long val));
|
|
Karsten Hopp |
3bddd3 |
long get_vim_var_nr __ARGS((int idx));
|
|
Karsten Hopp |
3bddd3 |
char_u *get_vim_var_str __ARGS((int idx));
|
|
Karsten Hopp |
3bddd3 |
*** ../vim-7.1.210/src/proto/ex_cmds2.pro Sat May 5 20:21:13 2007
|
|
Karsten Hopp |
3bddd3 |
--- src/proto/ex_cmds2.pro Sun Jan 6 16:42:24 2008
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 14,19 ****
|
|
Karsten Hopp |
3bddd3 |
--- 14,21 ----
|
|
Karsten Hopp |
3bddd3 |
void profile_end __ARGS((proftime_T *tm));
|
|
Karsten Hopp |
3bddd3 |
void profile_sub __ARGS((proftime_T *tm, proftime_T *tm2));
|
|
Karsten Hopp |
3bddd3 |
char *profile_msg __ARGS((proftime_T *tm));
|
|
Karsten Hopp |
3bddd3 |
+ void profile_setlimit __ARGS((long msec, proftime_T *tm));
|
|
Karsten Hopp |
3bddd3 |
+ int profile_passed_limit __ARGS((proftime_T *tm));
|
|
Karsten Hopp |
3bddd3 |
void profile_zero __ARGS((proftime_T *tm));
|
|
Karsten Hopp |
3bddd3 |
void profile_add __ARGS((proftime_T *tm, proftime_T *tm2));
|
|
Karsten Hopp |
3bddd3 |
void profile_self __ARGS((proftime_T *self, proftime_T *total, proftime_T *children));
|
|
Karsten Hopp |
3bddd3 |
*** ../vim-7.1.210/src/proto/search.pro Wed Aug 8 22:48:16 2007
|
|
Karsten Hopp |
3bddd3 |
--- src/proto/search.pro Sun Jan 6 16:11:53 2008
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 10,16 ****
|
|
Karsten Hopp |
3bddd3 |
void reset_search_dir __ARGS((void));
|
|
Karsten Hopp |
3bddd3 |
void set_last_search_pat __ARGS((char_u *s, int idx, int magic, int setlast));
|
|
Karsten Hopp |
3bddd3 |
void last_pat_prog __ARGS((regmmatch_T *regmatch));
|
|
Karsten Hopp |
3bddd3 |
! int searchit __ARGS((win_T *win, buf_T *buf, pos_T *pos, int dir, char_u *pat, long count, int options, int pat_use, linenr_T stop_lnum));
|
|
Karsten Hopp |
3bddd3 |
int do_search __ARGS((oparg_T *oap, int dirc, char_u *pat, long count, int options));
|
|
Karsten Hopp |
3bddd3 |
int search_for_exact_line __ARGS((buf_T *buf, pos_T *pos, int dir, char_u *pat));
|
|
Karsten Hopp |
3bddd3 |
int searchc __ARGS((cmdarg_T *cap, int t_cmd));
|
|
Karsten Hopp |
3bddd3 |
--- 10,16 ----
|
|
Karsten Hopp |
3bddd3 |
void reset_search_dir __ARGS((void));
|
|
Karsten Hopp |
3bddd3 |
void set_last_search_pat __ARGS((char_u *s, int idx, int magic, int setlast));
|
|
Karsten Hopp |
3bddd3 |
void last_pat_prog __ARGS((regmmatch_T *regmatch));
|
|
Karsten Hopp |
3bddd3 |
! int searchit __ARGS((win_T *win, buf_T *buf, pos_T *pos, int dir, char_u *pat, long count, int options, int pat_use, linenr_T stop_lnum, proftime_T *tm));
|
|
Karsten Hopp |
3bddd3 |
int do_search __ARGS((oparg_T *oap, int dirc, char_u *pat, long count, int options));
|
|
Karsten Hopp |
3bddd3 |
int search_for_exact_line __ARGS((buf_T *buf, pos_T *pos, int dir, char_u *pat));
|
|
Karsten Hopp |
3bddd3 |
int searchc __ARGS((cmdarg_T *cap, int t_cmd));
|
|
Karsten Hopp |
3bddd3 |
*** ../vim-7.1.210/src/search.c Tue Jan 1 15:42:45 2008
|
|
Karsten Hopp |
3bddd3 |
--- src/search.c Sun Jan 6 18:23:37 2008
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 494,501 ****
|
|
Karsten Hopp |
3bddd3 |
* When FEAT_EVAL is defined, returns the index of the first matching
|
|
Karsten Hopp |
3bddd3 |
* subpattern plus one; one if there was none.
|
|
Karsten Hopp |
3bddd3 |
*/
|
|
Karsten Hopp |
3bddd3 |
int
|
|
Karsten Hopp |
3bddd3 |
! searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum)
|
|
Karsten Hopp |
3bddd3 |
win_T *win; /* window to search in; can be NULL for a
|
|
Karsten Hopp |
3bddd3 |
buffer without a window! */
|
|
Karsten Hopp |
3bddd3 |
buf_T *buf;
|
|
Karsten Hopp |
3bddd3 |
--- 494,502 ----
|
|
Karsten Hopp |
3bddd3 |
* When FEAT_EVAL is defined, returns the index of the first matching
|
|
Karsten Hopp |
3bddd3 |
* subpattern plus one; one if there was none.
|
|
Karsten Hopp |
3bddd3 |
*/
|
|
Karsten Hopp |
3bddd3 |
+ /*ARGSUSED*/
|
|
Karsten Hopp |
3bddd3 |
int
|
|
Karsten Hopp |
3bddd3 |
! searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
|
|
Karsten Hopp |
3bddd3 |
win_T *win; /* window to search in; can be NULL for a
|
|
Karsten Hopp |
3bddd3 |
buffer without a window! */
|
|
Karsten Hopp |
3bddd3 |
buf_T *buf;
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 506,511 ****
|
|
Karsten Hopp |
3bddd3 |
--- 507,513 ----
|
|
Karsten Hopp |
3bddd3 |
int options;
|
|
Karsten Hopp |
3bddd3 |
int pat_use; /* which pattern to use when "pat" is empty */
|
|
Karsten Hopp |
3bddd3 |
linenr_T stop_lnum; /* stop after this line number when != 0 */
|
|
Karsten Hopp |
3bddd3 |
+ proftime_T *tm; /* timeout limit or NULL */
|
|
Karsten Hopp |
3bddd3 |
{
|
|
Karsten Hopp |
3bddd3 |
int found;
|
|
Karsten Hopp |
3bddd3 |
linenr_T lnum; /* no init to shut up Apollo cc */
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 594,599 ****
|
|
Karsten Hopp |
3bddd3 |
--- 596,606 ----
|
|
Karsten Hopp |
3bddd3 |
if (stop_lnum != 0 && (dir == FORWARD
|
|
Karsten Hopp |
3bddd3 |
? lnum > stop_lnum : lnum < stop_lnum))
|
|
Karsten Hopp |
3bddd3 |
break;
|
|
Karsten Hopp |
3bddd3 |
+ #ifdef FEAT_RELTIME
|
|
Karsten Hopp |
3bddd3 |
+ /* Stop after passing the "tm" time limit. */
|
|
Karsten Hopp |
3bddd3 |
+ if (tm != NULL && profile_passed_limit(tm))
|
|
Karsten Hopp |
3bddd3 |
+ break;
|
|
Karsten Hopp |
3bddd3 |
+ #endif
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
/*
|
|
Karsten Hopp |
3bddd3 |
* Look for a match somewhere in line "lnum".
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 1249,1255 ****
|
|
Karsten Hopp |
3bddd3 |
(SEARCH_KEEP + SEARCH_PEEK + SEARCH_HIS
|
|
Karsten Hopp |
3bddd3 |
+ SEARCH_MSG + SEARCH_START
|
|
Karsten Hopp |
3bddd3 |
+ ((pat != NULL && *pat == ';') ? 0 : SEARCH_NOOF))),
|
|
Karsten Hopp |
3bddd3 |
! RE_LAST, (linenr_T)0);
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
if (dircp != NULL)
|
|
Karsten Hopp |
3bddd3 |
*dircp = dirc; /* restore second '/' or '?' for normal_cmd() */
|
|
Karsten Hopp |
3bddd3 |
--- 1256,1262 ----
|
|
Karsten Hopp |
3bddd3 |
(SEARCH_KEEP + SEARCH_PEEK + SEARCH_HIS
|
|
Karsten Hopp |
3bddd3 |
+ SEARCH_MSG + SEARCH_START
|
|
Karsten Hopp |
3bddd3 |
+ ((pat != NULL && *pat == ';') ? 0 : SEARCH_NOOF))),
|
|
Karsten Hopp |
3bddd3 |
! RE_LAST, (linenr_T)0, NULL);
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
if (dircp != NULL)
|
|
Karsten Hopp |
3bddd3 |
*dircp = dirc; /* restore second '/' or '?' for normal_cmd() */
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 3780,3786 ****
|
|
Karsten Hopp |
3bddd3 |
if (do_searchpair((char_u *)"<[^ \t>/!]\\+\\%(\\_s\\_[^>]\\{-}[^/]>\\|$\\|\\_s\\=>\\)",
|
|
Karsten Hopp |
3bddd3 |
(char_u *)"",
|
|
Karsten Hopp |
3bddd3 |
(char_u *)"</[^>]*>", BACKWARD, (char_u *)"", 0,
|
|
Karsten Hopp |
3bddd3 |
! NULL, (linenr_T)0) <= 0)
|
|
Karsten Hopp |
3bddd3 |
{
|
|
Karsten Hopp |
3bddd3 |
curwin->w_cursor = old_pos;
|
|
Karsten Hopp |
3bddd3 |
goto theend;
|
|
Karsten Hopp |
3bddd3 |
--- 3787,3793 ----
|
|
Karsten Hopp |
3bddd3 |
if (do_searchpair((char_u *)"<[^ \t>/!]\\+\\%(\\_s\\_[^>]\\{-}[^/]>\\|$\\|\\_s\\=>\\)",
|
|
Karsten Hopp |
3bddd3 |
(char_u *)"",
|
|
Karsten Hopp |
3bddd3 |
(char_u *)"</[^>]*>", BACKWARD, (char_u *)"", 0,
|
|
Karsten Hopp |
3bddd3 |
! NULL, (linenr_T)0, 0L) <= 0)
|
|
Karsten Hopp |
3bddd3 |
{
|
|
Karsten Hopp |
3bddd3 |
curwin->w_cursor = old_pos;
|
|
Karsten Hopp |
3bddd3 |
goto theend;
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 3814,3820 ****
|
|
Karsten Hopp |
3bddd3 |
sprintf((char *)epat, "</%.*s>\\c", len, p);
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
r = do_searchpair(spat, (char_u *)"", epat, FORWARD, (char_u *)"",
|
|
Karsten Hopp |
3bddd3 |
! 0, NULL, (linenr_T)0);
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
vim_free(spat);
|
|
Karsten Hopp |
3bddd3 |
vim_free(epat);
|
|
Karsten Hopp |
3bddd3 |
--- 3821,3827 ----
|
|
Karsten Hopp |
3bddd3 |
sprintf((char *)epat, "</%.*s>\\c", len, p);
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
r = do_searchpair(spat, (char_u *)"", epat, FORWARD, (char_u *)"",
|
|
Karsten Hopp |
3bddd3 |
! 0, NULL, (linenr_T)0, 0L);
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
vim_free(spat);
|
|
Karsten Hopp |
3bddd3 |
vim_free(epat);
|
|
Karsten Hopp |
3bddd3 |
*** ../vim-7.1.210/src/version.c Sun Jan 6 17:18:16 2008
|
|
Karsten Hopp |
3bddd3 |
--- src/version.c Sun Jan 6 20:00:03 2008
|
|
Karsten Hopp |
3bddd3 |
***************
|
|
Karsten Hopp |
3bddd3 |
*** 668,669 ****
|
|
Karsten Hopp |
3bddd3 |
--- 668,671 ----
|
|
Karsten Hopp |
3bddd3 |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
3bddd3 |
+ /**/
|
|
Karsten Hopp |
3bddd3 |
+ 211,
|
|
Karsten Hopp |
3bddd3 |
/**/
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
--
|
|
Karsten Hopp |
3bddd3 |
No letters of the alphabet were harmed in the creation of this message.
|
|
Karsten Hopp |
3bddd3 |
|
|
Karsten Hopp |
3bddd3 |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
3bddd3 |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
3bddd3 |
\\\ download, build and distribute -- http://www.A-A-P.org ///
|
|
Karsten Hopp |
3bddd3 |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|