Add annotation on state change to ignore first block protection filter

This commit is contained in:
wolimst 2024-02-22 21:11:30 +09:00
parent 81bbc2ed47
commit 650bb18c0b
2 changed files with 3 additions and 1 deletions

View File

@ -5,3 +5,4 @@ export const LANGUAGE_CHANGE = "heynote-change"
export const CURRENCIES_LOADED = "heynote-currencies-loaded"
export const SET_CONTENT = "heynote-set-content"
export const ADD_NEW_BLOCK = "heynote-add-new-block"
export const MOVE_BLOCK = "heynote-move-block"

View File

@ -1,5 +1,5 @@
import { EditorSelection } from "@codemirror/state"
import { heynoteEvent, LANGUAGE_CHANGE, CURRENCIES_LOADED, ADD_NEW_BLOCK } from "../annotation.js";
import { heynoteEvent, LANGUAGE_CHANGE, CURRENCIES_LOADED, ADD_NEW_BLOCK, MOVE_BLOCK } from "../annotation.js";
import { blockState, getActiveNoteBlock, getFirstNoteBlock, getLastNoteBlock, getNoteBlockFromPos } from "./block"
import { moveLineDown, moveLineUp } from "./move-lines.js";
import { selectAll } from "./select-all.js";
@ -362,6 +362,7 @@ function moveCurrentBlock(state, dispatch, up) {
insert: newContent,
},
selection: newSelectionRange,
annotations: [heynoteEvent.of(MOVE_BLOCK)],
}, {
scrollIntoView: true,
userEvent: "input",