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; display: flex;
gap: 5px; padding-left: 4px;
padding-left: 5px;
border-left: 1px solid var(--modal-border-color); border-left: 1px solid var(--modal-border-color);
}
.right-buttons {
gap: 5px;
button { button {
font-size: 12px; font-size: 12px;
} }
}
&.additional { .additional-buttons {
gap: 2px; gap: 2px;
button { button {
font-size: 10px; font-size: 10px;
i { i {
margin: auto 1px; margin: 1px;
}
} }
} }
} }

View File

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

View File

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