Skip to content
Snippets Groups Projects
Commit 03ecb3f1 authored by Loïc Correnson's avatar Loïc Correnson
Browse files

Merge branch 'feature/ivette/scrollback-prefs' into 'master'

Feature/ivette/scrollback prefs

See merge request frama-c/frama-c!3596
parents 7af551e3 4fdc6c46
No related branches found
No related tags found
No related merge requests found
...@@ -133,7 +133,7 @@ let killingTimer: NodeJS.Timeout | undefined; ...@@ -133,7 +133,7 @@ let killingTimer: NodeJS.Timeout | undefined;
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
/** The server console buffer. */ /** The server console buffer. */
export const buffer = new RichTextBuffer({ maxlines: 200 }); export const buffer = new RichTextBuffer();
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// --- Server Status // --- Server Status
......
...@@ -93,3 +93,14 @@ export const EditorCommand = ...@@ -93,3 +93,14 @@ export const EditorCommand =
new Settings.GString('Editor.Command', 'emacs +%n:%c %s'); new Settings.GString('Editor.Command', 'emacs +%n:%c %s');
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// --- Console Scrollback configuration
// --------------------------------------------------------------------------
export const ConsoleScrollback =
new Settings.GNumber('Console.Scrollback', 2000);
export interface ConsoleScrollbackProps {
scrollback: Settings.GlobalSettings<number>;
}
// --------------------------------------------------------------------------
...@@ -30,6 +30,7 @@ import React from 'react'; ...@@ -30,6 +30,7 @@ import React from 'react';
import * as Dome from 'dome'; import * as Dome from 'dome';
import * as Json from 'dome/data/json'; import * as Json from 'dome/data/json';
import * as Settings from 'dome/data/settings'; import * as Settings from 'dome/data/settings';
import * as Preferences from 'ivette/prefs';
import * as Toolbars from 'dome/frame/toolbars'; import * as Toolbars from 'dome/frame/toolbars';
import { IconButton } from 'dome/controls/buttons'; import { IconButton } from 'dome/controls/buttons';
...@@ -211,6 +212,11 @@ const RenderConsole = () => { ...@@ -211,6 +212,11 @@ const RenderConsole = () => {
return () => { editor.off('change', callback); }; return () => { editor.off('change', callback); };
}); });
const [maxLines] = Settings.useGlobalSettings(Preferences.ConsoleScrollback);
React.useEffect(() => {
Server.buffer.setMaxlines(maxLines);
});
const doReload = () => { const doReload = () => {
const cfg = Server.getConfig(); const cfg = Server.getConfig();
const hst = insertConfig(history, cfg); const hst = insertConfig(history, cfg);
......
...@@ -99,6 +99,17 @@ function EditorFields() { ...@@ -99,6 +99,17 @@ function EditorFields() {
); );
} }
// --------------------------------------------------------------------------
// --- Console Scrollback Forms
// --------------------------------------------------------------------------
function ConsoleScrollbackFields(props: IvettePrefs.ConsoleScrollbackProps) {
const scrollback = Forms.useDefined(Forms.useValid(
Settings.useGlobalSettings(props.scrollback),
));
const title = 'Maximum number of lines in the console window';
return (<Forms.NumberField state={scrollback} label="Lines" title={title} />);
}
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// --- Export Components // --- Export Components
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
...@@ -112,6 +123,9 @@ export default function Preferences() { ...@@ -112,6 +123,9 @@ export default function Preferences() {
<Forms.Section label="Editors" unfold> <Forms.Section label="Editors" unfold>
<EditorFields /> <EditorFields />
</Forms.Section> </Forms.Section>
<Forms.Section label="Console Scrollback" unfold>
<ConsoleScrollbackFields scrollback={IvettePrefs.ConsoleScrollback} />
</Forms.Section>
</Forms.Page> </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