[code] Textadept: trying to script "hover tips"..

From: Phil S. <accountz.att.mailbox.org>
Date: Fri, 2 Nov 2018 12:39:09 +0100

Just discovered TA shortly ago and am depressed I haven't encountered it
years ago =) it seems mostly "a dev's dream editor" because unlike my
previous choices in recent years, SublimeText and VScode, one can "own
it and mold it" for years to come, not worry about the editor-dev's
proprietary shenanigans or future bloat etc, even run it on BSDs,
fine-tune most-every aspect, and have a much saner (imho) scripting
choice than ST's Python or VSC's Nodejs. Kudos! Brilliant.

In daily editor use I tend to involve the mouse somewhat, particularly
for hover tips (ie. what your Ctrl+H does but on mouse-dwell). I wrote a
little script for that which "mostly works" but requires the following
changes to modules/textadept/editing.lua:

- show_documentation() is renamed to show_documentation_at(buffer_pos),
with all occurrences of `buffer.current_pos` changed to `buffer_pos`

- reintroduce show_documentation() and have it call

- BUT further below (just following the above) at
`events.connect(events.CALL_TIP_CLICK, function(position)....` the
buffer.current_pos would need to be replaced with the current call-tip
pos! I would have thought that `buffer.call_tip_pos_start(buffer)` could
do the trick here but alas, still the "new"/"next" tip pops up at the
current-caret-pos instead of re-using its current tip pos! Any ideas
why, or how one would approach this better? Am a newb to TA Lua
scripting =)

Thanks for creating this & looking forward to learning more.

Bonus question, probably more of a Scintilla than TA one, but is there a
smooth-scrolling-of-sorts option? Scrolling the-page-by-pixels instead
of line-sized-jumps would improve UX quite a bit for us folks coming
from other modern editors, I feel =)

You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Fri 02 Nov 2018 - 07:39:09 EDT

This archive was generated by hypermail 2.2.0 : Sat 03 Nov 2018 - 06:41:55 EDT