Skip to content

Commit

Permalink
use include instead of indexOf
Browse files Browse the repository at this point in the history
  • Loading branch information
tmhglnd committed Jan 9, 2025
1 parent deb8b08 commit baa1f28
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/web/src/components/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,11 @@ const panicKeymap = (
const autoIndentKeymap = (
doc: Document
) => {
const noIndent = noAutoIndent.indexOf(doc.target) > -1;
console.log(noIndent);

// if any of the targets is part of the noAutoIndent setting in settings.json
const noIndent = noAutoIndent.includes(doc.target);
// overwrite the Enter with insertNewline
return noIndent ? Prec.high(
keymap.of([
{ key: 'Enter', run: insertNewline }
])
keymap.of([{ key: 'Enter', run: insertNewline }])
) : [];
};

Expand Down

0 comments on commit baa1f28

Please sign in to comment.