[vim/vim] search() timeout has no effect (when skipping) (Issue #15657)

11 views
Skip to first unread message

Maxim Kim

unread,
Sep 10, 2024, 7:29:32 AM9/10/24
to vim/vim, Subscribed

Steps to reproduce

Generate some text:

  1. vim -Nu NONE
  2. 2000iasdf qwer<esc>
  3. yy1000p

Search for something, skipping everything, with timeout 100:

  1. gg
  2. :call search('\S\+', 'W', 0, 100, {-> v:true})

Expected behaviour

Vim should be responsive almost immediately, in 100ms.

Instead vim is not responsive for many seconds

There is nothing in documentation for search() that would hint timeout shouldn't work for this case.

Real use case is comment text object where I need to skip non-commments(using synstack and friends) to find start of the next comment. If there are no comments in a large file or comments are too far away -- it "hangs" no matter what timeout is.

My workaround is to use stopline to search for the next 100 lines only, but am curious if timeout should work in this case?

Version of Vim

9.1.724

Environment

windows and debian, gui and terminal with bash.

Logs and stack traces

No response


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15657@github.com>

Christian Brabandt

unread,
Sep 10, 2024, 11:16:42 AM9/10/24
to vim/vim, Subscribed

That is true. The timeout is basically only for searching. It's not used for expression evaluation. It's basically a duplicate of #15404
Changing that would be a much bigger task and i am not sure how to do it currently.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15657/2341219897@github.com>

Reply all
Reply to author
Forward
0 new messages