Skip to content
Snippets Groups Projects
Commit 098502ea authored by Maxime Jacquemin's avatar Maxime Jacquemin Committed by David Bühler
Browse files

[ivette] For the linter

parent 7f228465
No related branches found
No related tags found
No related merge requests found
......@@ -95,10 +95,10 @@ export default function SourceCode() {
const [command] = Settings.useGlobalSettings(Preferences.EditorCommand);
const launchEditor = () => {
const cmd = command.replace('\%s', file).replace('\%d', line.toString());
const cmd = command.replace('%s', file).replace('%d', line.toString());
const args = cmd.split(' ');
const prog = args.shift();
if (prog) System.spawn(prog, args);
if (prog) System.spawn(prog, args).catch(/* TODO */);
};
// Building the React component.
......
......@@ -131,16 +131,10 @@ export function useThemeButtons(props: ThemeProps): ThemeControls {
// --------------------------------------------------------------------------
export const EditorCommand =
new Settings.GString('Editor.Command', 'emacs +\%d \%s');
new Settings.GString('Editor.Command', 'emacs +%d %s');
export interface EditorCommandProps {
command: Settings.GlobalSettings<string>;
}
// function produceCommand(command: string, file: string, line: number): string {
// command.replace('\%s', file);
// command.replace('\%d', line.toString());
// return "";
// }
// --------------------------------------------------------------------------
......@@ -86,11 +86,11 @@ function ThemeFields(props: P.ThemeProps) {
// --------------------------------------------------------------------------
// --- Editor Command Forms
// --------------------------------------------------------------------------
function EditorCommandFields(props : P.EditorCommandProps) {
const command = Forms.useDefined(
Forms.useValid(Settings.useGlobalSettings(props.command)
function EditorCommandFields(props: P.EditorCommandProps) {
const command = Forms.useDefined(Forms.useValid(
Settings.useGlobalSettings(props.command),
));
return (<Forms.TextCodeField state={command} label="Command"/>);
return (<Forms.TextCodeField state={command} label="Command" />);
}
// --------------------------------------------------------------------------
......@@ -116,7 +116,7 @@ export default (() => (
/>
</Forms.Section>
<Forms.Section label="Editor Command" unfold>
<EditorCommandFields command={P.EditorCommand}/>
<EditorCommandFields command={P.EditorCommand} />
</Forms.Section>
</Forms.Page>
));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment