Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ctrl-N / P always move cursor by 2 lines while use emacs/default keyMap, But vim works well. #7015

Open
Mitoax opened this issue Jan 1, 2023 · 0 comments

Comments

@Mitoax
Copy link

Mitoax commented Jan 1, 2023

Whenever I use 'Ctrl-P/N', it always move 2 lines each time. Is there any directions or hints to soluve this problem?

Here is my init code

// codemirror 和 语言支持
import "codemirror";
import "codemirror/mode/markdown/markdown";
import "codemirror/addon/selection/active-line";
import "codemirror/keymap/emacs.js";
import "codemirror/keymap/vim.js";
import CodeMirror from "codemirror";

import "codemirror/lib/codemirror.css";
import "codemirror/theme/darcula.css";
import "codemirror/theme/ambiance.css";
import "codemirror/theme/solarized.css";
// import "codemirror/theme/solarized-dark.css";
import "./css/ambiance_patch.css";
import "./css/solarized_patch.css";
import "codemirror/theme/panda-syntax.css";
import "codemirror/theme/base16-dark.css";
import "./css/style.css";

......

    const editor = CodeMirror.fromTextArea(textArea.current, {
      lineNumbers: true,
      lineWrapping: true,
      matchBrackets: true,
      theme: options.currentEditorTheme,
      styleActiveLine: { nonEmpty: false },
      scrollbarStyle: "null",
      keyMap: "emacs",
      mode: "text/x-markdown",
    });
    editor.setSize("100%", "100%");

If change keyMap to vim, it works well.

Any one can Help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant