Skip to content

Commit

Permalink
update default configuration and fix number field line number start
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardoperra committed Apr 27, 2024
1 parent a8accc6 commit 91ce749
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ export const EditorStyleForm: ParentComponent = () => {
max={lineNumbersConfig.max}
id={'frameLineNumberStartField'}
value={editor().lineNumberStart}
ref={el => {
el.autocomplete = 'off';
}}
onChange={setLineNumberStart}
/>
</SuspenseEditorItem>
Expand Down
6 changes: 4 additions & 2 deletions apps/codeimage/src/state/editor/activeEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ const $activeEditorState = () => {
setEditors(currentEditorIndex(), 'code', code);

const setLineNumberStart = (lineNumberStart: number | null | undefined) => {
if (lineNumberStart === null) return;
if (!lineNumberStart) {
lineNumberStart = 1;
}
return setEditors(
currentEditorIndex(),
'lineNumberStart',
// TODO Already done by @codeui/kit but I don't feel safe about this component I made
clamp(
lineNumberStart ?? 1,
lineNumberStart,
appEnvironment.lineNumbers.min,
appEnvironment.lineNumbers.max,
),
Expand Down

0 comments on commit 91ce749

Please sign in to comment.