Skip to content

Commit

Permalink
disable auto indenting
Browse files Browse the repository at this point in the history
  • Loading branch information
felixroos committed Jan 17, 2025
1 parent c8c9893 commit f19d50a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import './style.css';
import theme from './themes/strudel-theme.js';
import { highlightMiniLocations, updateMiniLocations } from '@strudel/codemirror';
import { getSettings } from './settings.js';
import { insertNewline } from '@codemirror/commands';

// we need to access these variables from the strudel iframe:
window.highlightMiniLocations = highlightMiniLocations; // we cannot import this for some reason
Expand Down Expand Up @@ -69,6 +70,15 @@ export class PastaMirror {
return true;
},
})),
// overrides Enter to disable auto indenting..
// feel free to remove this again if it annoys you
{
key: 'Enter',
run: (view) => {
insertNewline(view);
return true;
},
},
]),
),
],
Expand Down

0 comments on commit f19d50a

Please sign in to comment.