profile
viewpoint
Marijn Haverbeke marijnh Berlin http://marijnhaverbeke.nl Independent open-source programmer person

acornjs/acorn 6085

A small, fast, JavaScript-based JavaScript parser

marijnh/Eloquent-JavaScript 2397

The sources for the Eloquent JavaScript book

codemirror/CodeMirror-v1 358

An editable-iframe based code editor in JavaScript. See https://github.com/marijnh/CodeMirror for the currently maintained version

marijnh/Eloquent-JavaScript-1st-edition 318

The source for http://eloquentjavascript.net

lezer-parser/lezer 192

Incremental parsing system

akapav/js 168

JavaScript compiler for Common Lisp

marijnh/getdocs 143

Getdocs is not JSDoc

marijnh/browserkeymap 40

Map key events to key names, and key names to values

marijnh/distfs 40

Mount a directory of ES6 code as a FUSE directory of babel-compiled output

lezer-parser/lezer-generator 26

Parser generator for the lezer incremental parser

issue commentcodemirror/codemirror.next

Can Text be made iterable?

We're doing without polyfills so far, and I think that's a good thing—requiring polyfills in libraries is awkward.

justinfagnani

comment created time in an hour

issue closedlezer-parser/javascript

Package.json main field points to `index.js` instead of `index.cjs`

I ran into this issue when trying to get some tests to run with jest:

Cannot find module 'lezer-javascript' from 'index.js'
at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:265:17)
      at Object.<anonymous> (../../node_modules/@codemirror/next/lang-javascript/dist/index.js:10:24)

All of the other packages point to index.cjs in their main, and when built, dist does not contain an index.js in lezer-javascript.

closed time in a day

cachgill

issue commentlezer-parser/javascript

Package.json main field points to `index.js` instead of `index.cjs`

Right, that was an oversight. I didn't catch it because with node 13.5 and up it'll use the exports field instead. Released 0.8.4 with a fix.

cachgill

comment created time in a day

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha 01b831ec161513325ff2fdf6c65c40a976625c10

Remove unused import

view details

push time in a day

created taglezer-parser/javascript

tag8.4.0

A JavaScript lezer grammar

created time in a day

push eventlezer-parser/javascript

Marijn Haverbeke

commit sha 080f3a5e04712c8f09772ecec17f34f35b516d23

Fix outdated field in package.json

view details

Marijn Haverbeke

commit sha 6a8d3b1eefc0246b4bb2d0bcf738ceb24f97e38b

Mark version 0.8.4

view details

push time in a day

issue commentcodemirror/codemirror.next

Can Text be made iterable?

I think I gave up on this because doing this in a way that doesn't break on engines that don't have Symbol in a way that TypeScript accepts was really hard. I guess we could punt to // @ts-ignore comments, but I'm always a bit wary of those since they might mask other issues.

justinfagnani

comment created time in a day

issue commentcodemirror/CodeMirror

Changing `tabSize` to `0` causes freezing

I don't think it makes sense to support this. Would it help to default to 1 when a value <1 is given?

shshaw

comment created time in a day

issue commentcodemirror/CodeMirror

Changing `tabSize` to `0` causes freezing

I think I'd consider this a user error. Making tabs zero-length makes no sense, and I don't think the library can be expected to support that. Were you trying to do something like hiding tabs, or was this just an accidental value?

shshaw

comment created time in 2 days

issue closedcodemirror/CodeMirror

fenced block syntax highlighting inside markdown mode does not work if the mode contains a slash

for example text/x-pgsql

the regex /^(~~~+|```+)[ \t]([\w+#-])[^\n`]*$/ isn't broad enough

PR here: https://github.com/codemirror/CodeMirror/pull/6299

should I open an issue and a PR for this sort of thing or just a PR?

closed time in 2 days

jackdouglas

push eventcodemirror/CodeMirror

Jack Douglas

commit sha cc92ea5fdb5d156bfefa745fe784ac0146f6353b

[gfm mode] Allow forward slash in fenced code language

view details

push time in 2 days

PR merged codemirror/CodeMirror

allow forward slash in fenced code language

fenced block syntax highlighting inside markdown mode does not work if the mode contains a slash

for example text/x-pgsql

the regex /^(~~~+|```+)[ \t]([\w+#-])[^\n`]*$/ isn't broad enough

+1 -1

0 comment

1 changed file

jackdouglas

pr closed time in 2 days

issue closedacornjs/acorn

optional chaining and null coalescing

Is work to support these newer features of JavaScript syntax underway?

closed time in 2 days

mvolkmann

issue commentacornjs/acorn

optional chaining and null coalescing

Nullish coalescing is in the current release. Optional chaining is stuck on governance issues in the ESTree AST spec.

mvolkmann

comment created time in 2 days

issue closedcodemirror/codemirror.next

Goal column preservation during vertical arrow motion is broken on Chrome

In general, we need a more coherent strategy for dealing with preserving horizontal position during cursor motion.

closed time in 2 days

marijnh

issue commentcodemirror/codemirror.next

Goal column preservation during vertical arrow motion is broken on Chrome

The rewritten cursor motion system doesn't have this problem anymore.

marijnh

comment created time in 2 days

issue closedcodemirror/codemirror.next

Ligature Support

This may be too much of an ask, but I thought I'd propose that CM6 support ligatures.

For example, I'd be interested in using FiraCode with certain ligatures enabled such as fat arrow.

Related:

closed time in 2 days

curran

issue commentcodemirror/codemirror.next

Ligature Support

Modern browsers seem to handle ligatures pretty well, and for ones that conceptually contain multiple characters, they provide working cursor positions between the characters. Feel free to open an issue if something specific is broken, but I don't think this needs to say open.

curran

comment created time in 2 days

issue commentcodemirror/codemirror.next

View test »EditorView extension / calls update when the viewport changes« is failing for Adrian alone

Since most of the code involved in this has been rewritten in the meantime, I'm going to close this, but feel free to reopen if you're still seeing something similar.

adrianheine

comment created time in 2 days

issue closedcodemirror/codemirror.next

Incorrect line-break selection markup on Chrome

On Chrome (versions 79&80, MacOS), the selection markup does not advance correctly across line breaks. E.g. for

a
b

when selecting from before the a to before the b, only a will be highlighted (i.e. no indication that a line break is selected too).

When moving the selection past the b, both a and b and a space after the a will be highlighted.

Correct behavior would be for the space after the a to be highlighted in the first case too.

This is probably a Chrome-specific contenteditable bug.

closed time in 2 days

afri

issue commentcodemirror/codemirror.next

Incorrect line-break selection markup on Chrome

Closing this—given that the new design uses the native selection, the selection is going to look the way the browser draws it.

afri

comment created time in 2 days

issue closedcodemirror/codemirror.next

Figure out a better way of computing text navigation

Text navigation (i.e. move left one character, forward one word, up one line) is extremely hard to get right, in the face of unicode combining characters, bidirectional text, ligatures, in-text widgets, and so on.

Thus, we need the help of the browser to reliably do this. CodeMirror 5 tried to do this in JS, and got pretty far, but this required a lot of code, a lot of effort, and still couldn't cover all cases (some things require font information) and continues to be a source of bugs.

But the only interface that browsers provide for this at the moment is Selection.modify, which imperatively updates the current document selection. So that means that, to query where a given motion would take you, you have to first move the user selection there, then modify it and read it out again. This is terrible enough on its own, but the fact that messing with the selection can have all kinds of side effects (scrolling, focus changes, virtual keyboards appearing or disappearing) makes this extra terrible.

I would like to continue to have a method that allows you to just query where a given motion would go, without directly applying it, since that is often useful and the build-transaction → dispatch → update DOM architecture of CodeMirror makes it really awkward to do this in another way.

The current approach (in view/src/cursor.ts) does, when the target content is in the DOM, imperatively update the selection, and then makes sure to reset it again real soon unless a transaction comes in that moves it to its new position anyway. This is a clumsy hack, and falls apart when querying a position that isn't rendered. It also requires lots of workarounds for things like widgets, which are rendered as uneditable DOM and cause browsers to behave poorly, often blocking motion entirely.


One direction to explore would be to see if a hidden iframe can be used to try out motion without messing with the selection in the main, focused document. If, for content that hasn't been rendered or that contains problematic elements (widgets), we can render a look-alike piece of text off screen and run the motion on that, we could get a reasonable answer to the question of what the cursor motion would look like without side effects in the main document.

closed time in 2 days

marijnh

issue commentcodemirror/codemirror.next

Figure out a better way of computing text navigation

This is done now (roughly in c73cef2eed15d99121...832af72aee6a75f09). Computing cursor motion is entirely detached from the DOM selection, and side-effect free. The editor is aware of bidi structure again, which does produce more risk of having bugs or disagreeing with the browser's bidi implementation, but also helps do things like by-word motion in a much more correct way.

As a bonus, we also gained better support for cursor associativity (the thing where the cursor can be on either side of a soft line wrap).

marijnh

comment created time in 2 days

issue closedcodemirror/codemirror.next

lang-graphql

I'm not sure what goes into creating this module and I looked at the grammar spec for existing languages in this repo but, I'd like one for GraphQL. I'm currently working on a lightweight alternative to GraphiQL.

Anyhoo, I performed a search for "graphql grammar" and found this: https://github.com/antlr/grammars-v4/blob/master/graphql/GraphQL.g4

Maybe it'll be useful?

closed time in 2 days

NetOperatorWibby

issue commentcodemirror/codemirror.next

lang-graphql

My plan is to only work on really big languages, and hope the community steps up for more minor things (since experience has shown that maintaining a hundred languages that I don't know is not work that I enjoy). So I'm going to close this, but feel free to ask for advice when you decide to write a Lezer GraphQL grammar and publish it as a CodeMirror 6 language package.

NetOperatorWibby

comment created time in 2 days

issue commentcodemirror/codemirror.next

Implement more commands

Some of this done in da87836c97d11 and 315b8d7d3e5d8e

marijnh

comment created time in 2 days

issue closedcodemirror/codemirror.next

Demo page showing error

OS: macOS Catalina Node version: v13.14.0

I have cloned the repo and did the following steps.

  1. npm install
  2. npm run dev

Upon opening localhost:8090 I see unauthorized error. image

I see following error on npm run dev.

Starting compilation in watch mode...
search/src/cursor.ts(3,52): error TS2774: This condition will always return true since the function is always defined. Did you mean to call it instead?

special-chars/src/special-chars.ts(94,22): error TS2774: This condition will always return true since the function is always defined. Did you mean to call it instead?

closed time in 2 days

vindu25

issue commentcodemirror/codemirror.next

Demo page showing error

The error page apparently comes from Spring, so I'm going to assume it has nothing to do with CodeMirror.

vindu25

comment created time in 2 days

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha 9392d4f301c92f35413553bc20d6a71d6eb88e5b

Enable folding of JS arrays and objects

view details

Marijn Haverbeke

commit sha 832af72aee6a75f092e778d776a565916f6edc2d

Make the fold addon unfold ranges when the cursor moves into them

view details

push time in 2 days

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha fb69b07dc8b59dbdf346fbc14de910d5189c236c

Avoid some cases of invisible-cursor syndrome on Firefox Issue #111

view details

push time in 2 days

issue commentcodemirror/website

code { margin: 0 2px } in site.css breaks the alignment of the 1st line in pre > code

Thanks for noticing that! The extra space around inline code is intentional. I've fixed the issue by overriding the style inside pre elements.

Crystal-RainSlide

comment created time in 2 days

push eventcodemirror/website

Marijn Haverbeke

commit sha 80ea275168e2761eb382c5605bcb1d09b3873aba

Prevent inline code margin from affecting code blocks Closes #4

view details

push time in 2 days

issue closedcodemirror/website

code { margin: 0 2px } in site.css breaks the alignment of the 1st line in pre > code

The code:

code { margin: 0 2px }

in:

https://github.com/codemirror/website/blob/master/site/style/site.css#L285

will also give a 2px margin to the start or the first and the end of the last line of pre > codes, or the code blocks.


Another line of the code:

pre > code { margin: 0 }

will fix it, but I suggest to remove the margin, as it is not very essensial, <code> won't kill the width of the blank characters.

closed time in 2 days

Crystal-RainSlide

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha 3d74f76b394fa2f496fb497be0b400b3a4451857

Fix a bug in double-click handling

view details

Marijn Haverbeke

commit sha f0d7adfa3ffba7df5fe3b0e486cbcbdb97cdbe94

Make mouse selection assign the correct assoc to the resulting cursor

view details

Marijn Haverbeke

commit sha 24c82e22ffb33de5e084241329f4915c24bdbd76

Add a view.lineWrapping getter FEATURE: The view class now has a `lineWrapping` property that indicates whether line wrapping is enabled for the editor.

view details

Marijn Haverbeke

commit sha 920528770ac3d41503405e0325afc784bea5efb2

Add a lineWrapping extension FEATURE: `EditorView.lineWrapping` now holds an extension that enables line wrapping.

view details

Marijn Haverbeke

commit sha 4d8ad80881477c5643142c4e2abf5b778cab99b4

Make sure the DOM cursor is in the right place when on a line wrap point

view details

push time in 2 days

push eventcodemirror/CodeMirror

benhormann

commit sha b42ee0965e7ab931c775af886286a3a34a34705d

[vim] Fix vim-mode-change event being signalled twice

view details

push time in 2 days

pull request commentcodemirror/CodeMirror

[vim] Fix vim-mode-change event signalled twice

Thanks!

benhormann

comment created time in 2 days

PR merged codemirror/CodeMirror

[vim] Fix vim-mode-change event signalled twice

Fix for #6296, and tests.

+36 -1

3 comments

2 changed files

benhormann

pr closed time in 2 days

push eventProseMirror/prosemirror-tables

Marijn Haverbeke

commit sha ca39575f9742e72c954f04bbc3756d12b1f4f001

Don't crash in edgeCell when posAtCoords returns null

view details

push time in 2 days

PR merged ProseMirror/prosemirror-tables

Reviewers
Don't crash in edgeCell when posAtCoords returns null

The current code assumes it will never do that, but that doesn't appear to be a valid assumption—a customer ran into a crash when the returned object is dereferenced.

+3 -1

1 comment

1 changed file

marijnh

pr closed time in 2 days

pull request commentProseMirror/prosemirror-tables

Don't crash in edgeCell when posAtCoords returns null

I'm just going to go ahead and merge this, then.

marijnh

comment created time in 2 days

pull request commentcodemirror/CodeMirror

[vim] Fix vim-mode-change event signalled twice

As long as that isn't a regression caused by this PR, I'm okay with merging as-is.

benhormann

comment created time in 3 days

issue closedcodemirror/CodeMirror

Incomplete definitely typed factory function

The "place" arugment to CodeMirror(place..) is typed as either an HTMLElement or callback function, but does not allow null, even though the code permits it.

I am actually porting a chunk of the ProseMirror "embed CodeMirror" sample using TS, and ran up against it with this line of code:

    this.cm = new CodeMirror(null, {
      value: this.node.textContent,
      lineNumbers: true,
      extraKeys: this.codeMirrorKeymap()
    })

I'd gladly PR it, but I don't really know how/who owns the process.

closed time in 3 days

ChrisLincoln

issue commentcodemirror/CodeMirror

Incomplete definitely typed factory function

I don't have anything to do with the definitelytyped types for CodeMirror—you could try submitting a pull request there, or check who wrote them with git blame and communicate with them.

ChrisLincoln

comment created time in 3 days

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha e904dcadeab1faecbb78a1430865f11b32c7796a

Drop unnecessary function

view details

Marijn Haverbeke

commit sha 2548bf17e3dc51950f92f18e8aef82cd82df57c7

Make moveToLineBoundary aware of collapsed text

view details

Marijn Haverbeke

commit sha da87836c97d112316778de505cf946b988a6a74d

Implement by-page motion and by-group deletion FEATURE: New commands `movePageUp/Down`, `extendPageUp/Down`, `deleteGroupForward/Backward`.

view details

push time in 3 days

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha 3d8d88e43c6fb1849675a210ef5c7e8e289b6384

Fix bug in deletion commands

view details

Marijn Haverbeke

commit sha 7b05d0cebc37b3e9495d664c705084a1ee90f65b

Make moveByChar capable of moving across newlines and bidi boundaries (When using the `by` argument.)

view details

push time in 3 days

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha b974f4f1a3c396d2f2b90e4ae2e181a3f3edbc78

Represent goal columns in a less hacky way

view details

push time in 3 days

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha 5c03a4cac07a6360cf4b35b4426eeaea5f4dee13

Clean up cursor motion interface FEATURE: The new `EditorView` methods `moveByChar`, `moveByGroup`, and `moveToLineBoundary` can be used to compute cursor motion (in a bidi-aware way).

view details

Marijn Haverbeke

commit sha a58447355d12965ad5d14e4809f01fb9c70af40d

Implement moveVertically FEATURE: The view method `moveVertically` can now be used to compute vertical cursor motion.

view details

Marijn Haverbeke

commit sha 89a90551e6cb0d9f07a38098791f442789cbb10d

Remove remaining use of findPos in deletion command FEATURE: `Line` objects now have a `findClusterBreak` method for more convenient by-cluster motion.

view details

Marijn Haverbeke

commit sha f69406f86394bd646f3d812ed0d759e4a71cdebc

Port cursor motion tests to new methods

view details

Marijn Haverbeke

commit sha de92da2c36ddeed8a29d6055e62680ddf84b935c

Drop the old movePos method BREAKING: `EditorView.movePos` has been removed. Use the new cursor motion methods instead.

view details

push time in 3 days

issue commentmarijnh/Eloquent-JavaScript

Russian translation 2nd_edition

There used to be a complete Russian translation of the 2nd edition at https://karmazzin.gitbooks.io/eloquentjavascript_ru/content/ . But right now gitbooks.io seems to be entirely down. Not sure how long that has been the case.

dluschan

comment created time in 3 days

issue commentcodemirror/CodeMirror

Support WebWorkers (with importScripts) in loadmode

It seems like it might be easier to ignore loadmode and wire something up yourself. In the end, the only relevant thing it does is determine the mode's url, which is pretty trivial (and, given #6294, apparently something you want to do differently anyway), and load a mode's dependencies, which you might also use the UMD header for (by setting up a require or define function in your web worker).

tolmasky

comment created time in 3 days

issue commentcodemirror/CodeMirror

Support WebWorkers (with importScripts) in loadmode

What is the goal of loading modes in a web worker, though? You won't be able to run them in an editor (unless I'm missing something).

tolmasky

comment created time in 4 days

Pull request review commentcodemirror/CodeMirror

Fix: autocomplete suggestion on _ $ and # for ODBC

       token.string = token.string.slice(0, cur.ch - token.start);     } -    if (token.string.match(/^[.`"\w@]\w*$/)) {+     if (token.string.match(/^[.`"\w@]+(\$?#?\w*)*/g)) {

You have an extra space in front of the if, misaligning the indentation.

The regexp looks scary like this (nested repeat operators can easily create exponential running time). Why not just replace the \w with [\w$#]?

ZeeshanNoor

comment created time in 4 days

pull request commentacornjs/acorn

Add type definitions for acorn.mjs

Agreed, I really don't want to have two copies of the same file in the repository.

TimvdLippe

comment created time in 4 days

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha 527aa144b3b2b205249011ed8034e925543022fa

Start on adding a bidi algorithm to the view package

view details

Marijn Haverbeke

commit sha 99c1b0455260aa1be17adcaf38624cfbd38282c3

Collapse some passes in bidi algorithm

view details

Marijn Haverbeke

commit sha 340d4efb14ef1108289ff6488a241a97933aca01

Allow access to line orders from the editor view FEATURE: The editor view now has a `bidiSpans` method to retrieve the text order for a given line.

view details

Marijn Haverbeke

commit sha 03c9c1ad1eaf20bbb84c698e399a6e7b9ba8a501

Add a more robust glyph cluster segmenter FEATURE: The text package now exports `nextClusterBreak` and `prevClusterBreak`, which can be used to find grapheme cluster breaks in a string. BREAKING: The text package no longer exports `isExtendingChar`. Use the new cluster break functions instead.

view details

Marijn Haverbeke

commit sha a2131d9a8e4c2b8587bd59237c573faab4d10ba4

Fix regression in JS indentation

view details

Marijn Haverbeke

commit sha 86e62354b6964a22e1fce3871d883486a4374691

Make the bidi algorithm return rtl-context orders from right to left

view details

Marijn Haverbeke

commit sha 5de53a9537b7ac81a08dc359f431cdaa82c293cd

Implement visual motion through bidi text

view details

Marijn Haverbeke

commit sha 75dc990228919a47acadec1002cde88c2afe5a82

Use an enum for text direction BREAKING: Text direction is now represented as an enum (`Direction` from the view package) rather than a string.

view details

Marijn Haverbeke

commit sha eb9b18735792b3bb4c67979d092a7f7b3c7a529d

Make cursor selections include associativity and bidi level information BREAKING: Selection ranges should be created with `EditorSelection.range` and `EditorSelection.cursor` now, rather than directly calling the constructor.

view details

Marijn Haverbeke

commit sha 8d533d6f1d2163e166916da6dcce3489bc17e3dc

Make moveVisually take and return SelectionRanges

view details

Marijn Haverbeke

commit sha 9f6aade294fa0af51e3d2a434dc03284ee9fb6d9

Drop precise arg to SelectionRange.eq

view details

Marijn Haverbeke

commit sha 76d2a594a34e2c98f6754a9b6ddf108b73b91232

Start exposing the new cursor motion implementation through view methods

view details

Marijn Haverbeke

commit sha 9f9c25c1f96c2a154b9ce2b825bc2ae171aa569b

On Firefox, set Selection.caretBidiLevel when appropriate

view details

Marijn Haverbeke

commit sha cc86399fe767b4531150025a9c25d7627f564adc

Fix a bug in the bidi algorithm

view details

Marijn Haverbeke

commit sha 05e2d1342b74137cf46927031d99e1fd1d6fa549

Move char category logic to state, make extensible

view details

Marijn Haverbeke

commit sha 10d81ca6f54a5bfda0fbde07395383cdd5023558

Implement by-word horizontal motion

view details

Marijn Haverbeke

commit sha f04fc1fd174e2be39eec85b2ad57afb4b83ad4ac

Move char/word extending commands to new cursor logic BREAKING: The by-group selection motion commands like `moveWordLeft` have been renamed to contain 'group' rather than 'word' (`moveGroupLeft`).

view details

Marijn Haverbeke

commit sha 38cb03d2e4bb88dfbb577acc88b030e348643f32

Start on line-boundary motion Not too happy about the interface yet

view details

push time in 4 days

issue commentProseMirror/prosemirror

Replacing slice by itself throws TransformError: Invalid content for node

Does doc.check() on the initial document go through without error? If it does, then replacing a range with its own slice should indeed work. Can you set up a minimal self-contained script that allows me to reproduce the issue?

thomasgafner

comment created time in 4 days

issue commentProseMirror/prosemirror

Console error when double-clicking on an uneditable view

Sorry, I messed up the issue link—see https://github.com/ProseMirror/prosemirror-view/commit/87c65926a97e3ee2b29531d6afa715cad998d8aa

kevinzang

comment created time in 5 days

push eventcodemirror/CodeMirror

Siddhartha Gunti

commit sha a66f466e33fd274785b043ce308e745a9c6d08dc

[real-world uses] Add Adaface PairPro Adding Adaface PairPro (remote pair programming tool with code editor, compiler and video conference) for interviews. Added in alphabetical order.

view details

push time in 5 days

PR merged codemirror/CodeMirror

Adding Adaface PairPro

Adding Adaface PairPro (remote pair programming tool with code editor, compiler and video conference) for interviews. Added in alphabetical order.

+1 -0

0 comment

1 changed file

siddug

pr closed time in 5 days

issue commentcodemirror/CodeMirror

Gendered emoji render as two characters

I try to write my own backspace command

(You'll want to do the same for horizontal arrow motion.)

james-howard

comment created time in 5 days

pull request commentcodemirror/CodeMirror

Oracle suggestion fix

You reformatted the entire files. If you want to submit a change, please only change the relevant lines, and leave the rest of the file intact.

ZeeshanNoor

comment created time in 5 days

issue commentProseMirror/prosemirror

Console error when double-clicking on an uneditable view

@azaslonov I couldn't reproduce this, but going by the stack trace, attached patch might help.

kevinzang

comment created time in 5 days

push eventProseMirror/prosemirror-view

Marijn Haverbeke

commit sha 87c65926a97e3ee2b29531d6afa715cad998d8aa

Protect against the DOM selection being outside the editor in selectionFromDOM FIX: Fix a crash when the editor tries to read a DOM selection outside of itself. Issue prosemirror/prosemirror#828

view details

push time in 5 days

issue closedcodemirror/CodeMirror

shell-session language mode (syntax highlight) support please

Something like the following screenshot from prismjs:

Screenshot-6

If the stdout can be a different color (more gray) from the arguments at the command line will be great.

Thanks a lot.

closed time in 5 days

sgon00

issue commentcodemirror/CodeMirror

shell-session language mode (syntax highlight) support please

We're not adding new modes to the main distribution except in rare circumstances. If you want this, you'll have to implement it yourself and distribute it separately.

sgon00

comment created time in 5 days

issue commentcodemirror/CodeMirror

Gendered emoji render as two characters

I haven't looked.

I guess we could do a crude approximation, just assuming that zero-width joiners always group multiple characters into a glyph. It'll look a bit weird when your font doesn't support the ligature, but might still be better than the current behavior. I'll experiment with that in CodeMirror 6.

Attached patch removes special handling of zero-width joiners, to at least not actively sabotage the rendering of joined emoji.

james-howard

comment created time in 5 days

push eventcodemirror/CodeMirror

Marijn Haverbeke

commit sha 2571b4ad08e007c246d73bdd973892bf5dd7b02e

Don't render zero-width joiners as a special character Since it'll often mess up emoji rendering Issue #4488

view details

push time in 5 days

push eventmarijnh/Eloquent-JavaScript

Marijn Haverbeke

commit sha 00cc6ce5c0f16e0fdb4d73f0b9b3a19b3700f00e

Mark one errata as fixed in the 4th reprint

view details

push time in 5 days

push eventmarijnh/Eloquent-JavaScript

Marijn Haverbeke

commit sha 08f0f2a898f08a172ed78264c3dc2869054c20ad

Add parens after new expression in Chapter 11 For consistency

view details

push time in 5 days

issue commentcodemirror/CodeMirror

Gendered emoji render as two characters

Is there a chance that this can be solved?

I don't know. Let me know when you find a robust and performant way to figure out which characters are going to be joined into a single glyph (which is font-dependent).

james-howard

comment created time in 6 days

created tagProseMirror/prosemirror-model

tag1.10.0

ProseMirror's document model

created time in 6 days

push eventProseMirror/prosemirror-model

Marijn Haverbeke

commit sha 05968ab02aa1ea69f4f9152939ed4562d9d0038a

Mark version 1.10.0

view details

push time in 6 days

PR closed codemirror/CodeMirror

Add support for native manual resizing.

This PR attempts to add support for optional native manual resizing of editor windows as requested in #850. Feedback appreciated.

+107 -4

3 comments

7 changed files

scottfalkingham

pr closed time in 6 days

pull request commentcodemirror/CodeMirror

Add support for native manual resizing.

I don't think I want this in the core library. It should be possible to implement it in external code, and that has the advantage that I won't be expected to maintain it in the future.

scottfalkingham

comment created time in 6 days

issue commentcodemirror/codemirror.next

Editor content clipped when html/body height has value

Confirmed that this also happens in Firefox Linux. Will look into it more closely when I have time.

alex-ketch

comment created time in 6 days

issue commentcodemirror/codemirror.next

Demo page showing error

I don't think that error is coming from my dev webserver—could it be that you have something else running on port 8090?

vindu25

comment created time in 6 days

issue commentProseMirror/prosemirror-markdown

Empty paragraph is added before custom node

I'm probably not going to debug this, but if you do and find a specific issue in this code, feel free to create a more precise bug report or pull request.

Trevald

comment created time in 6 days

push eventProseMirror/prosemirror-model

Marijn Haverbeke

commit sha 2a5ea6f2da8fd76df3e397df3583fc148d717572

Disable list normalization in parser for schemas where lists may contain themselves FIX: Avoid fixing directly nested list nodes during DOM parsing when it looks like the schema allows those. See https://discuss.prosemirror.net/t/problem-with-domparser-when-parsing-nested-list/2782

view details

push time in 6 days

issue commentProseMirror/prosemirror

Triple click then mouse move doesn't select paragraphs

ProseMirror is overriding triple click behavior because the browser often does the wrong thing there (will only select up to a non-editable node when there's a widget in the paragraph, or stop at images). But it doesn't implement triple-click-drag.

It might be a good idea to try to do the fixing-up of triple clicks on the DOM selection level (make the DOM selection cover the whole textblock after a triple click, if it didn't already), rather than doing it on the ProseMirror level, since that might avoid disrupting the browser's native drag gestures.

mustafa0x

comment created time in 6 days

push eventmarijnh/Eloquent-JavaScript

Marijn Haverbeke

commit sha 7ce94f406895a01a4c7ddcb5f27cf5e56a091ab3

Fix incorrect chapter number in frontmatter

view details

push time in 7 days

issue commentcodemirror/CodeMirror

[julia mode] Typing .0 breaks jupyter cell

This doesn't appear to happen in the mode demo, so it rather sounds like Jupyter is still on an old, unfixed version of the mode.

crstnbr

comment created time in 10 days

issue closedacornjs/acorn

fork

closed time in 11 days

mkstarr

release codemirror/CodeMirror

5.54.0

released time in 11 days

created tagcodemirror/CodeMirror

tag5.54.0

In-browser code editor

created time in 11 days

push eventcodemirror/CodeMirror

Marijn Haverbeke

commit sha a5497d1c13f5742b6df963319e9abf30d510387a

Mark version 5.54.0

view details

push time in 11 days

CommitCommentEvent

created tagProseMirror/prosemirror-view

tag1.14.11

ProseMirror's view component

created time in 12 days

push eventProseMirror/prosemirror-view

Marijn Haverbeke

commit sha 4d196a94173e09155f11fd55d7afa4debb94c81f

Fix broken tests in capturekeys FIX: Fix bug in the way the editor handles Cmd-arrow presses on macOS.

view details

Marijn Haverbeke

commit sha 95ca79f8b6dbccbeb7cdcbcf94333a255f95c32a

Mark version 1.14.11

view details

push time in 12 days

issue commentcodemirror/CodeMirror

Difference between htmlembedded and htmlmixed

This is the bug tracker, it's not the right place for questions. Try the forum instead.

But in this case, just reading the mode descriptions (htmlmixed, htmlembedded) would probably have been enough to answer your question.

ultramustang

comment created time in 12 days

issue closedcodemirror/CodeMirror

Difference between htmlembedded and htmlmixed

I want to know the difference between the modes htmlembedded and htmlmixed. They are both HTML modes, but I don’t know which one to use. Please help!

closed time in 12 days

ultramustang

issue closedcodemirror/codemirror.next

Implement indentMore/indentLess-style commands

It appears that in the demo code, "Shift-Tab": indentSelection maps the Shift-Tab key combination to indent (and unindent?) the present selection. However, it doesn't seem to be doing its job.

To reproduce:

cd codemirror.next
npm run watch-demo
http-server
  • Go to http://localhost:8080/demo/
  • Select some indented text
  • Try Shift-tab
  • Observe that nothing happens

What I'm expecting to happen is that the selected lines be shifted left or right by one tab unit (in my case 2 spaces). I may have a misunderstanding of what indentSelection is supposed to do. Is it supposed to be like a miniature version of Prettier that only touches indentation? Or is it for adding and removing indentation levels?

My original goal with this was to implement Ctrl-[ and Ctrl-] for adding and removing levels of indentation. I'm having trouble figuring out how to add these.

Running Prettier over the selected text would make an excellent plugin as well. Perhaps the indentSelection could make a good starting point for that.

closed time in 12 days

curran

issue commentcodemirror/codemirror.next

Implement indentMore/indentLess-style commands

The commands have been implemented in 315b8d7d3e5d8e

curran

comment created time in 12 days

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha 812e474f62ba760f1db8bc073b0979731b66b890

Make it possible to configure indentation with tabs BREAKING: The `indentUnit` facet now takes a string, rather than a number, and allows a string of tabs to be specified. FEATURE: New `indentWithTabs` getter on the editor state, which indicates whether indentation should use tabs.

view details

Marijn Haverbeke

commit sha 315b8d7d3e5d8e5d0895a874f446d0f13da842ad

Add indentMore and indentLess commands FEATURE: The commands package now exports `indentMore` and `indentLess` commands, which unconditionally add/remove indentation on selected lines. FIX: Indentation-related commands will now use tabs to indent when appropriate.

view details

Marijn Haverbeke

commit sha 140675edaccbbc9af26b392388b720b4391b21df

Add tests for indentSelection and insertNewlineAndIndent Fix a few bugs, deduplicate some code

view details

Marijn Haverbeke

commit sha c73cef2eed15d99121f5982fdbf4abb33738fe90

Make deleteCharBackward delete full indentation units

view details

push time in 12 days

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha b9f943c1e51a5a5da6f99d5b41c97d5d6ff27cdf

Deduplicate implementations of countColumn

view details

Marijn Haverbeke

commit sha b1488bcdfe3e96941fdda37ee3ac8779354a6ac7

Fix bug in replace-all introduced in changeset overhaul

view details

Marijn Haverbeke

commit sha 6045b07d44a785b0d168133a5749db99a771adaf

Adjust mouse selection interface BREAKING: `EditorView.startMouseSelection` has been replaced with the `EditorView.mouseSelectionStyle` facet, which works somewhat differently.

view details

Marijn Haverbeke

commit sha 46aaa006126103285b04fccd9d87428207cf88e1

Add a rectangular selection extension FEATURE: Add a new package `rectangular-selection`, which implements rectangle selection on alt-drag. Closes #174

view details

push time in 13 days

issue closedcodemirror/codemirror.next

Implement rectangular selections as an extension

(The thing you get in CM5 when alt-selecting.)

closed time in 13 days

marijnh

issue commentProseMirror/prosemirror

Paste in IE broken while using focus locks

Thanks for the confirmation. I've released this as prosemirror-view 1.14.10

AlecTroemel

comment created time in 13 days

created tagProseMirror/prosemirror-view

tag1.14.10

ProseMirror's view component

created time in 13 days

push eventProseMirror/prosemirror-view

Marijn Haverbeke

commit sha 0c42fd10b516bce660776a3e5a8ad33df8f284ea

Mark version 1.14.10

view details

push time in 13 days

issue closedProseMirror/prosemirror

feat(prosemirror-keymap): Ability to specify `KeyboardEvent.code` instead of a character

Issue details

As described here: https://discuss.prosemirror.net/t/mod-keymap-binding-on-non-english-layout-in-windows/1975, in any (most?) language when you press ctrl+b, even in you're not on English layout, it will make text bold. It works in all of the apps that I use (MS Office/Google Docs/etc), no one has to switch to English. IMO, it would be nice to be able to specify KeyboardEvent.code or KeyboardEvent.keyCode instead of a character

A quote from MDN:

The KeyboardEvent.code property represents a physical key on the keyboard (as opposed to the character generated by pressing the key). In other words, this property returns a value that isn't altered by keyboard layout or the state of the modifier keys.

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code

A quote from the disuss thread:

For example, in a querz layout, z and y are switched

So users of querz layout expect Ctrl+Z to work when you press Ctrl+Y (in querz layout)? I just installed it and in MS OneNote (Win10) to undo, you need to press what previously was Ctrl+Y (button in the top row)

I think adding separate bindings for ctrl-и

Adding it for every language doesn't make much sense.

<!-- Please provide issue details here. -->

Steps to reproduce

Add a keymap, e.g.:

      keymap({
        'Mod-b': toggleMark(schema.marks.bold),
      }),

Switch language and press Ctrl+b and observe no effect.

<!-- Please provide necessary steps to reproduce the issue. For convenience, you can use this Glitch demo to start with.

https://glitch.com/edit/#!/remix/prosemirror-demo-basic -->

ProseMirror version

all

Affected platforms

<!-- Please provide specific version of affected browsers or platforms. -->

  • [x] Chrome
  • [x] Firefox
  • [x] Internet Explorer
  • [x] Other

closed time in 13 days

Dattaya

issue commentProseMirror/prosemirror

feat(prosemirror-keymap): Ability to specify `KeyboardEvent.code` instead of a character

Released this as prosemirror-keymap 1.1.4

Dattaya

comment created time in 13 days

more