How can I make my view text searchable?

Hi guys, I’ve been using as a template for a package I’m developing. So far, it’s been working fine. However, I noticed that doing a search inside the new html view does not work. What would I need to do to enable a user to do a text search inside it?

Do you mean do a text search by using the find-and-replace package?

yes, exactly!

In my estimation, you would have to fool the find-and-replace package into thinking that your view was a text editor. This would be a pretty complicated process at this point since the find-and-replace package depends on a number of TextEditor features, such as:

  • Markers and MarkerLayers
  • TextEditor and TextBuffer events
  • TextEditor.scanInBufferRange
  • Selections

This does bring up an interesting point of “what does it mean to be searchable?” Maybe we should abstract that a little more at some point.

1 Like

Would be useful for a few packages, including the styleguide package (styleguide#5).

Sure, my tablr package would benefit greatly of reusing the find-and-replace UI rather than having to create my own (I had to postpone that feature until I get enough time to tackle it).

It would be great if somebody did a dialog for this that anyone could use. (hint, hint)