<@U7HPJNG20> took a look at your project last nigh...
# tornadofx
a
@Kevin took a look at your project last night and compared it to some of what @carlw pulled - what I was personally curious about was your highlight function
k
That's my starting attempt at making "find" functionality. I'd like to be able to search for stuff and jump to it (right now it just highlights search terms).
a
looks fun! I think I have to look at the code again but I might just go ahead and build off @carlw's fork. What you're doing looks like it works now according to your giphy but there might be a thing or two that could be optimized. Hoping to find a little time for it today
k
As far as how it works, the idea is that when I split a string, I get all the groupings that I need for the highlighting. So if I do
"some simple string".split("simple")
, I get
["some ", "", " string"]
, which is almost what I want. The weird regex is so that the search term doesn't go away
Yeah I imagine it's not super efficient, especially with that regex in there
a
I guess what i was wondering was why you're splitting the string in the first place as opposed to just matching the string?
to be fair I last looked at this at 1am last night 😄
k
If I could just match the string, that would be great. I thought I needed to build up this TextFlow thing by having individual bits of strings and their properties. So if I wanted to highlight "simple" in "some simple string", I need to have something like: "some " + "simple" + " string" | | | nohighlight highlight nohighlight
so each group of text has its own formatting
a
ohhh - you want partial matching as well?
k
If I could specify it on a per-character basis then I could just do a straight search
Ah yeah, I do want partial matching
a
If that's the case, what you're doing now won't work, right? I have to look at the code again later tonight.
There are some cool algorithmic things done with partial matches - I send it over real quick if I find it
k
It's doing partial matching right now I'm pretty sure
a
okay, no problem 😄 I'll take a look again and I'll want to compare it with other algorithmic solutions
k
like in that gif, it doesn't need to match a whole word
lol thank you! I think it is a bit confusing
a
alright, back to work work hahaha I'll be back on though. Edits I make from here on out will be on Carl's stuff
k
sweet, thanks 👍 🙂
a
at the very least, it's a really cool concept to look at!