mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix code style
This commit is contained in:
@@ -6206,10 +6206,8 @@ export async function displayPastChats() {
|
|||||||
// Fragment search a.k.a. swoop (as in `helm-swoop` in the Helm package of Emacs).
|
// Fragment search a.k.a. swoop (as in `helm-swoop` in the Helm package of Emacs).
|
||||||
// Split a `query` {string} into its fragments {string[]}.
|
// Split a `query` {string} into its fragments {string[]}.
|
||||||
function makeQueryFragments(query) {
|
function makeQueryFragments(query) {
|
||||||
let fragments = query.trim().split(/\s+/).map( function (str) { return str.trim(); } );
|
let fragments = query.trim().split(/\s+/).map(str => str.trim().toLowerCase()).filter(onlyUnique);
|
||||||
fragments = [...new Set(fragments)]; // uniques only
|
|
||||||
// fragments = fragments.filter( function(str) { return str.length >= 3; } ); // Helm does this, but perhaps better if we don't.
|
// fragments = fragments.filter( function(str) { return str.length >= 3; } ); // Helm does this, but perhaps better if we don't.
|
||||||
fragments = fragments.map( function (str) { return str.toLowerCase(); } );
|
|
||||||
return fragments;
|
return fragments;
|
||||||
}
|
}
|
||||||
// Check whether `text` {string} includes all of the `fragments` {string[]}.
|
// Check whether `text` {string} includes all of the `fragments` {string[]}.
|
||||||
@@ -6217,7 +6215,7 @@ export async function displayPastChats() {
|
|||||||
if (!text) {
|
if (!text) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return fragments.every(function (item, idx, arr) { return text.includes(item); });
|
return fragments.every(item => text.includes(item));
|
||||||
}
|
}
|
||||||
const fragments = makeQueryFragments(searchQuery);
|
const fragments = makeQueryFragments(searchQuery);
|
||||||
// At least one chat message must match *all* the fragments.
|
// At least one chat message must match *all* the fragments.
|
||||||
|
@@ -275,8 +275,7 @@ table.responsiveTable {
|
|||||||
color: var(--SmartThemeEmColor);
|
color: var(--SmartThemeEmColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
.mes_text u
|
.mes_text u {
|
||||||
{
|
|
||||||
color: var(--SmartThemeUnderlineColor);
|
color: var(--SmartThemeUnderlineColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user