MurzNN/TST-Colored-tabs

regex seem not to work properly

reinerblock opened this issue · 4 comments

In settings I added some regex and testet it with (RegexBuddy but it didn't work with the addon even if RegexBuddy (tested with regex type JavaScript) gave it's o.k. after debugging.

Regex:
.*\.?joplinapp\.org/.*

grafik

Teststring in RegexBuddy
https://discourse.joplinapp.org/t/vertical-line-in-split-editor/21525

Result in RegexBuddy was "Match found in 170 steps".

But with Waterfox there is no match. :(

grafik

Regex is checking only domain part of tab only, not the full url, so try something like .*\.?joplinapp\.org$ - it should work.

Why is that? You could implement it just easy.

if (/.*\.?joplinapp\.org\/.*/.test(subject)) {
	// Successful match
} else {
	// Match attempt failed
}
if (regexstring.test(subject)) {
	// Successful match
} else {
	// Match attempt failed
}

BTW, would it be possible to e.g. paint a border around the active tab instead of "just" saturation and brightness?

I do not argue that this can be implemented simply, but current implementation uses only host path to all checks.

Now I'm too busy, when I got some free time, I'll try to extend this in future versions to support full url matching, but main problem is migration of already filled user settings (that match to host only) to full url match without breaking old behavior.

Paint border is possible too, but needs time to implement too... :(