🐛 small improvements

This commit is contained in:
Nate Sesti 2024-04-28 23:53:06 -07:00
parent a7da4c13bc
commit 21720596e7
4 changed files with 15 additions and 4 deletions

View file

@ -26,7 +26,7 @@ class ContinueCustomElementRenderer (
protected val font: Font
get() {
val editorFont = editor.colorsScheme.getFont(EditorFontType.PLAIN)
return editorFont.deriveFont(Font.ITALIC) ?: editorFont
return editorFont.deriveFont(Font.PLAIN) ?: editorFont
}
private fun offsetY(): Int {

View file

@ -39,7 +39,7 @@ class ContinueMultilineCustomElementRenderer (
protected val font: Font
get() {
val editorFont = editor.colorsScheme.getFont(EditorFontType.PLAIN)
return editorFont.deriveFont(Font.ITALIC) ?: editorFont
return editorFont.deriveFont(Font.PLAIN) ?: editorFont
}
private fun offsetY(): Int {

View file

@ -195,9 +195,11 @@ export class VsCodeExtension {
// from outside the window are also caught
fs.watchFile(getConfigJsonPath(), { interval: 1000 }, (stats) => {
this.configHandler.reloadConfig();
this.tabAutocompleteModel.clearLlm();
});
fs.watchFile(getConfigTsPath(), { interval: 1000 }, (stats) => {
this.configHandler.reloadConfig();
this.tabAutocompleteModel.clearLlm();
});
vscode.workspace.onDidSaveTextDocument((event) => {

View file

@ -194,6 +194,9 @@ function TipTapEditor(props: TipTapEditorProps) {
props.availableSlashCommands,
);
const active = useSelector((state: RootState) => state.state.active);
const activeRef = useUpdatingRef(active);
async function handleImageFile(
file: File,
): Promise<[HTMLImageElement, string] | undefined> {
@ -268,7 +271,14 @@ function TipTapEditor(props: TipTapEditorProps) {
onEnterRef.current({ useCodebase: true });
return true;
},
"Cmd-Backspace": () => {
// If you press cmd+backspace wanting to cancel,
// but are inside of a text box, it shouldn't
// delete the text
if (activeRef.current) {
return true;
}
},
"Shift-Enter": () =>
this.editor.commands.first(({ commands }) => [
() => commands.newlineInCode(),
@ -448,7 +458,6 @@ function TipTapEditor(props: TipTapEditorProps) {
}, []);
// Re-focus main input after done generating
const active = useSelector((state: RootState) => state.state.active);
useEffect(() => {
if (editor && !active && props.isMainInput && document.hasFocus()) {
editor.commands.focus();