Skip to content

Commit

Permalink
fix(editor): fix undo (#1110)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocavue authored Jul 29, 2022
1 parent 7948267 commit 65884f4
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .changeset/popular-zebras-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@rino.app/editor": patch
"@rino.app/electron": patch
---

Fix an issue that causes undo keyboard shortcut not to work.
2 changes: 1 addition & 1 deletion packages/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@remirror/extension-codemirror6": "^1.0.0-beta.12",
"@remirror/extension-doc": "^2.0.0-beta.12",
"@remirror/extension-drop-cursor": "^2.0.0-beta.12",
"@remirror/extension-events": "2.0.0-beta.12",
"@remirror/extension-events": "^2.0.0-beta.12",
"@remirror/extension-hard-break": "^2.0.0-beta.12",
"@remirror/extension-heading": "^2.0.0-beta.12",
"@remirror/extension-horizontal-rule": "^2.0.0-beta.12",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { Node as ProsemirrorNode } from "@remirror/pm/model"
import { EditorState } from "@remirror/pm/state"
import { Decoration, DecorationSet } from "@remirror/pm/view"

import { isAutoHideMark, RinnMarkAttrs } from "./inline-mark-extensions"
import { isAutoHideMark, RinoMarkAttrs } from "./inline-mark-extensions"

type TextAttrs = Partial<RinnMarkAttrs & { isAutoHideMark?: boolean }>
type TextAttrs = Partial<RinoMarkAttrs & { isAutoHideMark?: boolean }>

/**
* Read a text node and return information from its mark
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class CodeText extends MarkExtension {
}
}

class CodeSapce extends MarkExtension {
class CodeSpace extends MarkExtension {
static disableExtraAttributes = true
get name() {
return "mdCodeSpace" as const
Expand Down Expand Up @@ -226,7 +226,7 @@ export const rinoMarkExtensions = [
new Emphasis(),
new Strong(),
new CodeText(),
new CodeSapce(),
new CodeSpace(),
new Delete(),
new LinkText(),
new LinkUri(),
Expand All @@ -235,7 +235,7 @@ export const rinoMarkExtensions = [
]
export type RinoMarkExtension = typeof rinoMarkExtensions[number]
export type RinoMarkName = RinoMarkExtension["name"]
export type RinnMarkAttrs = {
export type RinoMarkAttrs = {
depth: number

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export function applySelectionMarks(view: EditorView): void {
if (view.isDestroyed) return

const tr = view.state.tr
tr.setMeta("addToHistory", false)
if (updateRangeMarks(tr)) {
view.dispatch(tr)
}
Expand Down
4 changes: 2 additions & 2 deletions packages/editor/src/extensions/inline/inline-types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { RinnMarkAttrs, RinoMarkName } from "./inline-mark-extensions"
import type { RinoMarkAttrs, RinoMarkName } from "./inline-mark-extensions"

export enum InlineDecorateType {
Ignore = "IGNORE",
Expand All @@ -15,5 +15,5 @@ export interface InlineToken {
// end position
end: number

attrs: RinnMarkAttrs
attrs: RinoMarkAttrs
}
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 65884f4

Please sign in to comment.