How to use the prosemirror-commands.exitCode function in prosemirror-commands

To help you get started, we’ve selected a few prosemirror-commands examples, based on popular ways it is used in public projects.

github tinacms / tinacms / packages / tinacms / fields / src / Wysiwyg / node-views / CodeBlockView / CodeBlockView.tsx View on Github external
if (this.cm.somethingSelected() || pos.line != this.cm.lastLine()) {
          return CodeMirror.Pass
        }

        if (view.state.selection.$anchor.parentOffset) {
          const pos = view.state.selection.$anchor.pos
          view.dispatch(
            view.state.tr.setSelection(Selection.near(
              this.view.state.doc.resolve(pos - 1),
              -1
            ) as any)
          )
        }

        if (exitCode(view.state, view.dispatch)) {
          return view.focus()
        } else if (exitCodeHard(view.state, view.dispatch)) {
          return view.focus()
        }
      },
    })
github ProseMirror / website / example / codemirror / index.js View on Github external
"Ctrl-Enter": () => {
        if (exitCode(view.state, view.dispatch)) view.focus()
      }
    })
github zodiac-team / zodiac-ui / libs / editor / src / plugins / code / code.nodeview.ts View on Github external
"Ctrl-Enter": () => {
                if (exitCode(view.state, view.dispatch)) view.focus()
            },
        })