Ernie Rael wrote:

> I want to determine what text property, if any, is under the mouse
> position. The best options seems to be
> 
>     prop_find({lnum: mpos.line, col: mpos.column, ...})
> 
> and then check if the returned property covers the mouse position.
> 
> I am wondering about having an "exact: true" option in prop_find's
> "search for" options. When "exact: true" a property is only returned
> if (lnum, col) are covered by the property, otherwise an empty
> dictionary is returned.
> 
> Using this would minimize extra code, including vim9 code to check
> if returned property covers mouse pos. This is used on every mouse
> movement event, would be nice to minimize overhead.
> 
> Would a patch that adds "exact: true" be considered? I haven't looked
> at the code yet; first looking for comments on this approach.

prop_find() can be inefficient, since it searches the whole buffer.
That is especially when no match is found.

How about using prop_list() instead?  It only checks for properties in
one line, which is what you want.  We could add a "col" entry in the
{props} argument to narrow down to properties that include this column.

-- 
>From "know your smileys":
 :q     vi user saying, "How do I get out of this damn emacs editor?"

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20230203122603.A74461C054B%40moolenaar.net.

Raspunde prin e-mail lui