UI: add cursor options to the script editor (#615)

This commit is contained in:
Aleksei Bezrodnov
2023-06-19 03:17:15 +02:00
committed by GitHub
parent 709875d9ca
commit 9e75621cd2
9 changed files with 70 additions and 16 deletions
+7 -2
View File
@@ -40,8 +40,13 @@ export function Toolbar({ editor, onSave }: IProps) {
const { ram, ramEntries, isUpdatingRAM, options, saveOptions } = useScriptEditorContext();
const onOptionChange: OptionsModalProps["onOptionChange"] = (option, value) => {
saveOptions({ ...options, [option]: value });
editor?.updateOptions(options);
const newOptions = { ...options, [option]: value };
saveOptions(newOptions);
// delaying editor options update to avoid an issue
// where switching between vim and regular modes causes some settings to be reset
setTimeout(() => {
editor?.updateOptions(newOptions);
}, 100);
};
const onThemeChange = () => {