orbitalquark / textadept

Textadept is a fast, minimalist, and remarkably extensible cross-platform text editor for programmers.
https://orbitalquark.github.io/textadept
MIT License
624 stars 38 forks source link

Just updated from old (2019) version, howto question about API changes #522

Open BURN-MICROSUCK opened 3 months ago

BURN-MICROSUCK commented 3 months ago

Been using this editor nearly every day for about 5 years now, finally decided to update to a more recent version. I'm in the process of adapting my old lua functions to work with the new version.

I had a nice "word highlight" function in my init.lua that i (vaguely) remember writing, this function is a handler for events.UPDATE_UI and uses the (seemingly now non-existent) API call textadept.editing.highlight_word (str) which simply causes all instances of str in the current window (not necessarily exactly 1 word with no punctuation) to be highlighted. What would be the equivalent of this in the current version? Does it still exist?

Another similar thing i've been trying to do, but failing, is each time the search text in the search/replace box is changed, highlight all instances of it in the same way (without changing current select range or cursor position) then disable highlighting / unhighlight when either of these two changes.

orbitalquark commented 3 months ago

Thanks so much for your support! It's quite possible that the features you're asking about have been baked into the editor as options in the meantime.

There are a couple of options for word highlighting mentioned in the manual: https://orbitalquark.github.io/textadept/manual.html#word-highlight

For find results highlighting, the manual suggests the ui.find.highlight_all_matches option: https://orbitalquark.github.io/textadept/manual.html#find--replace-pane

Hopefully that answers your questions and fills in the blanks.