cleaner styling

This commit is contained in:
Evan Simkowitz 2024-12-29 22:12:03 -05:00
parent 8c49ea4139
commit e901ada9b7
No known key found for this signature in database
3 changed files with 36 additions and 18 deletions

View File

@ -34,22 +34,26 @@
}
}
.right-buttons:not(:empty) {
.right-buttons,
.additional-buttons {
display: flex;
gap: 5px;
padding-left: 5px;
padding-left: 4px;
border-left: 1px solid var(--modal-border-color);
}
.right-buttons {
gap: 5px;
button {
font-size: 12px;
}
}
&.additional {
gap: 2px;
button {
font-size: 10px;
i {
margin: auto 1px;
}
.additional-buttons {
gap: 2px;
button {
font-size: 10px;
i {
margin: 1px;
}
}
}

View File

@ -160,11 +160,13 @@ const SearchComponent = ({
{index + 1}/{numResults}
</div>
<div className="right-buttons additional">
{caseSensitiveDecl && <ToggleIconButton decl={caseSensitiveDecl} />}
{wholeWordDecl && <ToggleIconButton decl={wholeWordDecl} />}
{regexDecl && <ToggleIconButton decl={regexDecl} />}
</div>
{(caseSensitiveDecl || wholeWordDecl || regexDecl) && (
<div className="additional-buttons">
{caseSensitiveDecl && <ToggleIconButton decl={caseSensitiveDecl} />}
{wholeWordDecl && <ToggleIconButton decl={wholeWordDecl} />}
{regexDecl && <ToggleIconButton decl={regexDecl} />}
</div>
)}
<div className="right-buttons">
<IconButton decl={prevDecl} />

View File

@ -825,15 +825,27 @@ const TerminalView = ({ blockId, model }: TerminalViewProps) => {
model.termRef.current?.searchAddon.clearDecorations();
return;
}
model.termRef.current?.searchAddon.findNext(searchText, searchOpts);
try {
model.termRef.current?.searchAddon.findNext(searchText, searchOpts);
} catch (e) {
console.warn("search error:", e);
}
},
[searchOpts]
);
searchProps.onPrev = React.useCallback(() => {
model.termRef.current?.searchAddon.findPrevious(searchVal, searchOpts);
try {
model.termRef.current?.searchAddon.findPrevious(searchVal, searchOpts);
} catch (e) {
console.warn("search error:", e);
}
}, [searchVal, searchOpts]);
searchProps.onNext = React.useCallback(() => {
model.termRef.current?.searchAddon.findNext(searchVal, searchOpts);
try {
model.termRef.current?.searchAddon.findNext(searchVal, searchOpts);
} catch (e) {
console.warn("search error:", e);
}
}, [searchVal, searchOpts]);
// rerun search when the searchOpts change