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

CodeMirror 5 + Sublime Text Key Bindings + Multiple Selections = #19

Open
chriscoyier opened this issue Jun 22, 2021 · 2 comments
Open

Comments

@chriscoyier
Copy link

So Command-D in "normal" emmet does outward-expansion. But in CodeMirror, if you turn on the official Sublime Text bindings:

https://codemirror.net/demo/sublime.html

Then Command-D gets replaced with "select next occurrence" (selectNextOccurrence).

Because CodeMirror supports multiple selections/multiple cursors, that means you don't just have the original selection, but it keeps adding to the selection.

That's all fine, and so far working as expected:

CleanShot.2021-06-22.at.05.52.22.mp4

But that's without Emmet.

I would test it here, but this demo doesn't have Sublime Text bindings on:

https://download.emmet.io/codemirror/index.html

On CodePen, we do (you have to turn on Sublime Text bindinds, and Emmet, in Editor Preferences).

When BOTH are active, in HTML specifically, something gets funky with line positions. You can see here:

CleanShot.2021-06-22.at.05.54.24.mp4

It looks like maybe Emmet's tag-matching thing is catching the second-and-beyond selection?

@chriscoyier
Copy link
Author

Noting that I now DON'T think it's related to those sublime text bindings. I can make it happen right here:

https://download.emmet.io/codemirror/index.html

See HTML like this:

  <body>
    <Chart />
    <div class=""></div>
    <Chart />
    <div class=""></div>
    <Chart />
    <div class=""></div>
  </body>

The multiple cursors + return + type screws it up.

Screen.Capture.on.2021-08-24.at.16-06-13.mp4

@sergeche
Copy link
Member

Hmm, that's look really weird. Will check it out

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

2 participants