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

acornjs/acorn 5656

A small, fast, JavaScript-based JavaScript parser

marijnh/Eloquent-JavaScript 2335

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/heckle 346

JavaScript-based Jekyll clone

marijnh/Eloquent-JavaScript-1st-edition 317

The source for http://eloquentjavascript.net

akapav/js 168

JavaScript compiler for Common Lisp

lezer-parser/lezer 150

Incremental parsing system

marijnh/getdocs 143

Getdocs is not JSDoc

marijnh/browserkeymap 41

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

marijnh/distfs 39

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

push eventcodemirror/CodeMirror

mtaran-google

commit sha 1010810a581b1dd57fde947cc0b62495d7594c48

[verilog] Support folding by indentation

view details

push time in an hour

issue commentcodemirror/codemirror.next

lineNumbers extension breaks mouse scrolling / caret movement

Great, thanks for reporting back.

afri

comment created time in 4 hours

issue closedcodemirror/codemirror.next

lineNumbers extension breaks mouse scrolling / caret movement

For longish files (few hundred lines), mouse scrolling breaks when using the lineNumbers extension: After scrolling past the first ~100 lines or so, the view jumps right to the end of the file.

Also, moving the caret by clicking with the mouse causes the view to jump. The jumps get bigger towards the end of the file.

This is on MacOS, Chrome 78.

To reproduce, just paste some long text into the demo at https://codemirror.net/6/.

closed time in 4 hours

afri

issue closedcodemirror/codemirror.next

Selections spanning more than the viewport are broken

This worked at one time. Haven't investigated what broke it yet.

closed time in 5 hours

marijnh

issue commentcodemirror/codemirror.next

Selections spanning more than the viewport are broken

Seems to work again. I'm not sure why but I fixed a whole bunch of stuff that I accidentally broke in the big facet refactor, so probably one of those things also caused this.

marijnh

comment created time in 5 hours

issue commentcodemirror/codemirror.next

lineNumbers extension breaks mouse scrolling / caret movement

Can you still reproduce this with the current code? I cleaned up a whole bunch of things in the past days, so it may be that I fixed it without noticing, but now that the code can reliably load big documents again, I still can't reproduce this specific issue.

afri

comment created time in 5 hours

issue closedcodemirror/codemirror.next

Look for strategies to speed up drawing and updating (very) long lines

DOM updates in this version are no longer per-line, and I was expecting big gains from that, but it seems that browsers still take a lot of time computing a layout for a long line.

One possible optimization would be to detect which part of the line is after the viewport, and replace that with a placeholder empty space node. Without line wrapping, the same approach could be used for the part before the viewport. With wrapping, that's a lot harder, since we don't know where wrapping points would be without drawing the content (but maybe text snapping into a different place when you scroll up is a reasonable price to pay for having responsive editing on a megabyte-long line).

See also codemirror/codemirror#2090

closed time in 5 hours

marijnh

issue commentcodemirror/codemirror.next

Look for strategies to speed up drawing and updating (very) long lines

This should be a lot better now.

marijnh

comment created time in 5 hours

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha 7b9583a07ae9df093d30f4df577cc2980ed11e25

Introduce visibleRanges to make highlighting cheaper with collapsed code Closes #143

view details

Marijn Haverbeke

commit sha 1eec58eeebb7784de4be4410ee7a823fcc1ce915

Reuse decoration values in special-chars plugin

view details

push time in 5 hours

issue closedcodemirror/codemirror.next

Limiting work by only using the viewport isn't reliable

Since if you have a giant folded range in the middle of your viewport, simply running from the start of the viewport to its end, for example to highlight code, is still a lot of work.

closed time in 5 hours

marijnh

issue closedcodemirror/codemirror.next

Give up parsing when the input matches the grammar too poorly

If you, for example, paste a big blob of code in language A though your editor is using grammar B, the parsing gets a lot more expensive due to constantly trying to correct errors. The syntax extension should notice this and just disable parsing.

closed time in 5 hours

marijnh

issue commentcodemirror/codemirror.next

Give up parsing when the input matches the grammar too poorly

This has been implemented in the recent overhaul of the syntax parsing scheduler.

marijnh

comment created time in 5 hours

pull request commentProseMirror/prosemirror-view

fix wierd compositioning of multibyte language.

(If you can provide your diagnosis of the issue here, maybe we can find a solution that doesn't have this problem.)

rubang

comment created time in 5 hours

pull request commentProseMirror/prosemirror-view

fix wierd compositioning of multibyte language.

I just removed the flushingSoon flag.

Right, but that is necessary to 'batch' flushes together, by holding them up until the delay has elapsed.

rubang

comment created time in 5 hours

push eventcodemirror/CodeMirror

rvalavicius

commit sha 36f13482c58c81dc1669583696c10cebf5c53a2d

[sTeX mode] Ensured that tag does not clash with object prototype properties

view details

push time in 5 hours

PR merged codemirror/CodeMirror

sTeX: Ensured that tag does not clash with object prototype props

TeX user is free to declare macros with any name and in case of names such as constructor or hasOwnProperty etc., mode was picking prototype properties instead of default plugin.

+1 -1

0 comment

1 changed file

rvalavicius

pr closed time in 5 hours

push eventacornjs/acorn

susiwen8

commit sha fa3ad8cef0f39f5ae0cbd8be0bf65eb0a782133e

Further refine acorn-walk types

view details

push time in 6 hours

PR merged acornjs/acorn

Reviewers
Add function for walk type

I just found out findNodeAround and findNodeAfter should separate from findNodeat , because they don't have end

+9 -3

0 comment

1 changed file

susiwen8

pr closed time in 6 hours

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha 11c77e2d72da2a8c98d448775470c9b48ba67a46

Track max point size in range sets

view details

Marijn Haverbeke

commit sha cbd159bf224539aa41a2c12c247f62c1d83fd7cf

Use point size data to make rangeset iteration cheaper

view details

push time in 7 hours

pull request commentProseMirror/prosemirror-view

fix wierd compositioning of multibyte language.

That code to force a delay of the dom flush isn't there for the fun of it. It fixes issues like prosemirror/prosemirror#967, and as such should not be removed.

rubang

comment created time in 7 hours

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha c036e124f7f78f67d0ff6177cc69ac624544ed5e

First crude implementation of line gaps / long line hiding Issue #29

view details

Marijn Haverbeke

commit sha f7e2f91f53be0a4168221d4177ca7f15fa3193c3

Clean up line gap implementation Give up on accurate pixel measurements due to all the unpredictability that yields Issue #29

view details

Marijn Haverbeke

commit sha e53c92f57435bc46ee003651c446b37110ac177b

Store text direction in view state Expose it as EditorView.textDirection

view details

push time in 10 hours

push eventmarijnh/cetriolo

Marijn Haverbeke

commit sha fe5c02906c76d5808c4a78b09bb91506ac97cc51

Load font over https

view details

push time in 12 hours

issue closedcodemirror/codemirror.next

Crash in display update

I still haven't managed to isolate this but it appears to happen when pasting a big chunk of text. This is the backtrace:

Uncaught TypeError: Cannot read property 'length' of undefined
    at DocChildCursor.findPos (demo_built.js:2284)
    at DocView.updateChildren (demo_built.js:5266)
    at DocView.updateInner (demo_built.js:5237)
    at demo_built.js:5478
    at EditorView.withUpdating (demo_built.js:6870)
    at DocView.checkLayout (demo_built.js:5465)
    at demo_built.js:5216

closed time in a day

marijnh

issue commentcodemirror/codemirror.next

Crash in display update

This hasn't shown up lately, and most of the relevant code is different now than it was when the issue occurred, so I'm going to assume this is gone.

marijnh

comment created time in a day

issue closedcodemirror/codemirror.next

Issue with long files

The editor isn't rendering correctly the file after scrolling a bit. Here is a video to prove the issue: IMG_0589.TRIM.MOV.zip

closed time in a day

arguiot

issue commentcodemirror/codemirror.next

Issue with long files

Since the code has changed a lot in the meantime, and there never was a clear reproduction example, I'm going to close this until new info comes in.

arguiot

comment created time in a day

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha 32fd84a6e8ad2b5a879e4066fb423ac3015d1dca

Drop debug statement

view details

Marijn Haverbeke

commit sha 249a101e69a97ac9acb9bb41a1f19681a160a30f

Move touchesRange to the ChangeSet class

view details

Marijn Haverbeke

commit sha 27a81bafa61183d25a623aca9f25ec0b4ba4606f

Restore ignore option to rangeset iteration/comparison

view details

Marijn Haverbeke

commit sha 3692063b5a446b57e822d2d413bd0e2fdd21e705

Remove misguided change to GapWidget

view details

Marijn Haverbeke

commit sha 96a7579c1f640d45365bbfcf1f89c27c9c317500

Fix bug in range set diffing

view details

push time in a day

issue commentcodemirror/CodeMirror

Explode parentheses

This can be configured per language, but in most languages parentheses for function calls are commonly used in a style like...

let someLongVar = someLongFunction(
  arg, arg2)

... and there exploding would get in the way. So it's not enabled by default.

lepa22

comment created time in a day

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha 9dc1599c0866a95f2abcd5d382e319655967d0b3

Use a more consistent naming convention for constants

view details

Marijn Haverbeke

commit sha 5a3dac564fda71e07ff7c808c8f557e429c68a0d

Measure visible viewport width as well as height

view details

Marijn Haverbeke

commit sha 80032cb07f19667d5379753034eeb0df6fe98022

Ensure gap widgets can always be merged

view details

push time in 2 days

issue commentcodemirror/CodeMirror

Markdown: Quote after bullet point not properly highlighted

Bumping won't help much, since no one is actively maintaining the markdown mode. A solid PR might get reviewed.

jonas-sk

comment created time in 2 days

issue commentacornjs/acorn

Please consider rethinking the way how plugins access acorn

Have you seen https://github.com/acornjs/acorn/pull/870 ? Does it (assuming plugins all use it) solve your concern?

lukastaegert

comment created time in 2 days

pull request commentacornjs/acorn

add Nullish Coalescing

See https://github.com/estree/estree/pull/204

mysticatea

comment created time in 2 days

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha c7c42d0894ad5e2cc0015056333a3a7fb22339f1

Fix min-width tracking in doc view

view details

Marijn Haverbeke

commit sha 133bc513f73bf32021b1eb5500fe3be2f8fa24de

Fix the way gutter and panel provide scroll margins

view details

Marijn Haverbeke

commit sha c4b42e03c42747ed732fc6b6d3a289a612d47e19

Add basic tests for coordinate-position mapping

view details

push time in 3 days

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha 328b483cb1a72acf0f9eafe864097940aef538ec

Repair fixed gutters

view details

Marijn Haverbeke

commit sha aea0fef0be8d05774ccc5f82b6c0f87ab71d612d

Call destroy on dropped plugins

view details

Marijn Haverbeke

commit sha 9185591a44305b2d9d27d428913d2fcc4beb5b42

Do update tree when giving up a parse because of badness score

view details

push time in 4 days

created taglezer-parser/lezer-tree

tag0.8.1

Packed syntax tree data structure

created time in 4 days

push eventlezer-parser/lezer-tree

Marijn Haverbeke

commit sha 26fab621ef26a99b26bb183085447f5addc2c4a9

Fix bug in balancing code that would produce subtrees with wrong length FIX: Fix bug that would cause tree balancing of deep trees to produce corrupt output.

view details

Marijn Haverbeke

commit sha a9eb793c00b3fc888722a9c192de453344182cff

Mark version 0.8.1

view details

push time in 4 days

push eventacornjs/acorn

susiwen8

commit sha 1d5028637852c2834091739646e25dd6558ee7a8

Fix some errors in walk types * Remove duplicate function * end is optional in findNodeAt

view details

push time in 4 days

PR merged acornjs/acorn

Reviewers
Fix some error in walk type

Remove duplicate function and end is optional in findNodeAround and findNodeAfter

+1 -10

1 comment

1 changed file

susiwen8

pr closed time in 4 days

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha c240ff92cbe78b59790d7567c29edff30dce274d

Use support for diffing many range sets at once to clean up deco diffing

view details

Marijn Haverbeke

commit sha 26676663a7c5fbfcc22d033d08194bbe5aee2258

Change the way decorations are created To allow their values to be reused or passed to a range set builder

view details

Marijn Haverbeke

commit sha 2fd3c617a555a93c38b9f835cdcc75e6ae5042aa

Don't skip chunks with large point ranges when diffing range sets

view details

Marijn Haverbeke

commit sha 6f012d7f279bc806fbccf0e440ca6fc86b2d4d2a

Cache ChangeSet.changedRanges

view details

Marijn Haverbeke

commit sha 1e2a3d8ba6c9a460a0aa09a7e75530f389c27b9d

Separate heightmap-related and content-related decoration diffing

view details

Marijn Haverbeke

commit sha 002b229e7771f7704af4ae0f3d485e2f94d2f513

Simplify RangeSet.compare Drop from/to range, always compare the entire document.

view details

push time in 5 days

pull request commentacornjs/acorn

Fix: acorn-walk type work with acorn's

Ah, eslint doesn't even use acorn-walk, itself. So I guess you were linting TypeScript mode that depends on acorn-walk? Though your comman-line example has *.js, so that seems unlikely.

susiwen8

comment created time in 5 days

pull request commentacornjs/acorn

Fix: acorn-walk type work with acorn's

Possibly, if eslint crashes with a hard error when a type declaration of one of its dependencies imports a package that isn't installed. But that would be a pretty ridiculous thing to do, no?

susiwen8

comment created time in 5 days

pull request commentacornjs/acorn

Fix: acorn-walk type work with acorn's

I'm now getting...

Module '"/path/to/acorn/dist/acorn"' can only be default-imported using the 'esModuleInterop' flag

... from TypeScript when looking at this file. Also there's still a lot of unnecessary genericity related to NodeType.

Ah, forget it, I've cleaned it up myself in e9372c151f63fe2

susiwen8

comment created time in 5 days

PR merged acornjs/acorn

Reviewers
Fix: acorn-walk type work with acorn's

Close #906

+22 -22

4 comments

1 changed file

susiwen8

pr closed time in 5 days

issue closedacornjs/acorn

acorn-walk 7.1.0 type problem

Hello, I have upgrade acorn-walk to version 7.1.0, but I got this typescript error

Argument of type 'acorn.Node' is not assignable to parameter of type 'import("/****/node_modules/@types/estree/index").Node'. Type 'Node' is missing the following properties from type 'ExportSpecifier': exported, local

Because acorn.parse returnsacorn.Node.

Can someone help me with this?

closed time in 5 days

susiwen8

push eventacornjs/acorn

susiwen

commit sha 1d85e7ce982a979bb5411cd00fd9156eecf952a5

Fix: acorn-walk type work with acorn's

view details

susiwen8

commit sha de6edeb654cf665e732d822d95c97e2d2fc879bc

Remove NarrowNode from walk.d.ts

view details

Marijn Haverbeke

commit sha e9372c151f63fe254c7f5e7ffd7a820e34422208

Further clean up walker types

view details

Marijn Haverbeke

commit sha 97801f0b5835bc93739666b3494c9b49aeb5fc1d

Mark acorn-walk 7.1.1

view details

push time in 5 days

pull request commentacornjs/acorn

Fix: acorn-walk type work with acorn's

Yes.

susiwen8

comment created time in 5 days

issue commentcodemirror/CodeMirror

about modify indentUnit

Strange. I can't reproduce that in the ruby mode demo—if I change indentUnit there, further indentations seem to do the right thing.

RanX12

comment created time in 5 days

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha 8c695c901c0dfc914df69ab419bd5a9b5977abb4

Update doc comments for rangeset

view details

push time in 5 days

push eventcodemirror/codemirror.next

Marijn Haverbeke

commit sha c24d03b7e5405a6febf0358a39c76fcedef860d6

Rewrite rangeset package Uses in other modules not adjusted yet

view details

Marijn Haverbeke

commit sha 3bae2b8b682f68fcfa49e2a30da92b9c1c18611f

Make mapping the responsibility of the rangeset module

view details

Marijn Haverbeke

commit sha cb6cfdffda14d03cd1969668b0b8b2e70f0b5481

Move back to a single update method on range sets

view details

Marijn Haverbeke

commit sha 040024701cfdcfe7064c2b069cf778ebd578aa6f

Start porting other code to new rangeset interface Some tests are still failing.

view details

Marijn Haverbeke

commit sha aac6635ddf6f5dc0b767e5f8f500a799ef18dcda

Make the node based tests pass

view details

Marijn Haverbeke

commit sha 26ee171250737027ef18dcfe797420350e64627a

Make view tests pass with rangeset changes

view details

Marijn Haverbeke

commit sha 4cd4804254ab2080bb9ad91398015b4b8319e7aa

Add a test for range preservation around points

view details

push time in 5 days

issue commentcodemirror/CodeMirror

Compendium of Android keyboard input bugs (new lines, backspaces, phantom caret, duplicated lines, etc.) with videos

Thanks for documenting these. As you mention, they may not get fixed in 5.x, but I'll make sure to go over this list and see if these cases work in version 6.

josephrocca

comment created time in 6 days

issue commentmarijnh/mold

Syntax highlighting

Not really. I use HTML mode when editing these.

brechtcs

comment created time in 6 days

pull request commentacornjs/acorn

Fix: acorn-walk type work with acorn's

The node narrowing stops making any sense since acorn doesn't define detailed node shapes. So we'd need to figure out whether we want that and, if not, remove it.

susiwen8

comment created time in 6 days

issue commentcodemirror/CodeMirror

about modify indentUnit

But indentUnit is indented by 40 spaces

Again, I don't know what you mean by this (and unless you provide an example I'm going to give up asking)

RanX12

comment created time in 6 days

issue commentacornjs/acorn

acorn-walk 7.1.0 type problem

I won't have time to rewrite these in the near future, but if anyone wants to, a PR would be welcome.

susiwen8

comment created time in 6 days

issue commentcodemirror/CodeMirror

about modify indentUnit

What displayed indentation? indentUnit has no effect until you actually indent a line. And that line's actual indentation will depend both on the indentUnit setting and the context.

RanX12

comment created time in 6 days

push eventcodemirror/CodeMirror

Jay Contonio

commit sha 2f51b60003c17d55af03390b4ce49ee8600ddfc6

Fixing blockquote end check

view details

push time in 6 days

PR merged codemirror/CodeMirror

Reviewers
Fixes blockquote continuing without `>` in continueList

In CodeMirror, using markdown mode and the continueList addon, blockquotes are not getting reset when the last line contains >

Currently:

> I am a blockquote
> 
I am still marked as a blockquote and get markdown style

This fix:

> I am a blockquote
> 
^ this will get replaced like other lists, and I am no longer marked as a blockquote
+3 -1

0 comment

1 changed file

jcontonio

pr closed time in 6 days

issue commentcodemirror/CodeMirror

about modify indentUnit

What does it mean for "the indentUnit on the page" to be a certain thing? Do you mean the indentation you get at a specific point in your document? If so, could you be more specific about that?

RanX12

comment created time in 7 days

push eventcodemirror/CodeMirror

vamshi.revu

commit sha aa05cca0c5ece7a3ee171ed389a46c79d00fdb88

[tern addon] Allow appending the tooltip to the codemirror hint options container if exists The current implementation of tern.js is appending the tooltip to the body. When applied the codemirror context inside a shadow root, tooltips are falling out of the root component. This change would append the tooltip to the container of codemirror hint options if it has else it will default to document.body

view details

push time in 7 days

PR merged codemirror/CodeMirror

Reviewers
[tern addon] Allow appending the tooltip to the codemirror hint options container if exists

The current implementation of tern.js is appending the tooltip to the body.

When applied the codemirror context inside a shadow root, tooltips are falling out of the root component. This change would append the tooltip to the container of codemirror hint options if it has else it will default to document.body

+6 -5

0 comment

1 changed file

Vamshi-Revu

pr closed time in 7 days

issue commentacornjs/acorn

acorn-walk 7.1.0 type problem

No, I mean, did you intend for these to be used with another parser? Other types for Acorn? I assume you had a specific use case in mind when you created the type declaration.

susiwen8

comment created time in 7 days

issue commentacornjs/acorn

acorn-walk 7.1.0 type problem

@MrRefactoring Seems your types don't work well with the types distributed with the acorn package. Is that intentional?

susiwen8

comment created time in 7 days

issue closedacornjs/acorn

acorn-walk does not contains types on version 7.0

The types have been added to the dist folder on Github, but they are not available on npm.

How to reproduce

$ mkdir no-ts
$ cd no-ts
$ npm install acorn-walk
$ ls node_modules/acorn-walk/dist
walk.js walk.js.map walk.mjs walk.mjs.map

It is not present on the package.json either:

{
  "_from": "acorn-walk",
  "_id": "acorn-walk@7.0.0",
  "_inBundle": false,
  "_integrity": "sha512-7Bv1We7ZGuU79zZbb6rRqcpxo3OY+zrdtloZWoyD8fmGX+FeXRjE+iuGkZjSXLVovLzrsvMGMy0EkwA0E0umxg==",
  "_location": "/acorn-walk",
  "_phantomChildren": {},
  "_requested": {
    "type": "tag",
    "registry": true,
    "raw": "acorn-walk",
    "name": "acorn-walk",
    "escapedName": "acorn-walk",
    "rawSpec": "",
    "saveSpec": null,
    "fetchSpec": "latest"
  },
  "_requiredBy": [
    "#USER",
    "/"
  ],
  "_resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.0.0.tgz",
  "_shasum": "c8ba6f0f1aac4b0a9e32d1f0af12be769528f36b",
  "_spec": "acorn-walk",
  "_where": "/mnt/c/Users/alber/Documents/projects/threkk/acorn-walk-bug",
  "bugs": {
    "url": "https://github.com/acornjs/acorn/issues"
  },
  "bundleDependencies": false,
  "deprecated": false,
  "description": "ECMAScript (ESTree) AST walker",
  "engines": {
    "node": ">=0.4.0"
  },
  "homepage": "https://github.com/acornjs/acorn",
  "license": "MIT",
  "main": "dist/walk.js",
  "maintainers": [
    {
      "name": "Marijn Haverbeke",
      "email": "marijnh@gmail.com",
      "url": "https://marijnhaverbeke.nl"
    },
    {
      "name": "Ingvar Stepanyan",
      "email": "me@rreverser.com",
      "url": "https://rreverser.com/"
    },
    {
      "name": "Adrian Heine",
      "url": "http://adrianheine.de"
    }
  ],
  "module": "dist/walk.mjs",
  "name": "acorn-walk",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/acornjs/acorn.git"
  },
  "scripts": {
    "prepare": "cd ..; npm run build:walk"
  },
  "version": "7.0.0"
}

closed time in 8 days

threkk

issue commentacornjs/acorn

acorn-walk does not contains types on version 7.0

I've released acorn-walk 7.1.0 with the type definitions.

threkk

comment created time in 8 days

push eventacornjs/acorn

Marijn Haverbeke

commit sha 978df09ac6191019d510a31dd3dabc022c5ec084

Mark acorn-walk 7.1.0

view details

push time in 8 days

issue commentProseMirror/prosemirror

prosemirror-view scrolls on edit if editor is higher than view port height

I'm not seeing this when I, for example, past a bunch of stuff into the demo on https://prosemirror.net and then edit somewhere in the middle. Could you double-check the circumstances that trigger the issue?

MarMun

comment created time in 8 days

issue commentProseMirror/prosemirror

Cannot type Chinese directly after a link.

is it ok to typing Chinese directly after a void element, such as a variable placeholder, which has some text in it but it is not editable,

Browsers (especially Safari and Chrome) are really stupid about this, treating the uneditable text as part of the composed content and randomly copying parts of it into the editable content. You can usually work around this by setting the uneditable element to display: inline-block (though that will also often change its vertical position).

zhaoyao91

comment created time in 8 days

issue commentProseMirror/prosemirror

Cannot type Chinese directly after a link.

And by 'attached' I mean patch https://github.com/ProseMirror/prosemirror-view/commit/c2756d4fe49056135c6f77bb6d8c4a104fe17a09

zhaoyao91

comment created time in 8 days

issue commentProseMirror/prosemirror

Cannot type Chinese directly after a link.

Attached patch should fix this.

zhaoyao91

comment created time in 8 days

issue closedProseMirror/prosemirror

Cannot type Chinese directly after a link.

Issue details

If the first character of the Chinese typing is the same with the last charater of the link, this character will be occupied.

Steps to reproduce

Kapture 2020-02-10 at 13 08 57

ProseMirror version

https://prosemirror.net/examples/basic/

Just on the example website

Affected platforms

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

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

closed time in 8 days

zhaoyao91

created tagProseMirror/prosemirror-view

tag1.14.2

ProseMirror's view component

created time in 8 days

push eventProseMirror/prosemirror-view

Marijn Haverbeke

commit sha c2756d4fe49056135c6f77bb6d8c4a104fe17a09

Fix bug in composition-node-locating code FIX: Fix bug when starting a composition after a link, when the composition started with the character that ended the link. Closes #1029

view details

Marijn Haverbeke

commit sha 08a148c595204de0cd2fd7b44fdfb544ce086873

Avoid raising errors when an editor is destroyed right after receiving focus

view details

Marijn Haverbeke

commit sha 8d01f434715b6fd31e33661040ccbea4c236b991

Mark version 1.14.2

view details

push time in 8 days

issue closedcodemirror/CodeMirror

textarea content no longer restored when posting and navigating back (in chrome)

Previously, using CodeMirror in a textarea of a form, I would be able to have a workflow of something like this:

  • Edit code
  • Post form (navigating to a new page)
  • Navigate back

After navigating back, the text that was in the textarea that was posted would be populated still.

However, at some point in the recent past (in a chrome update I'd assume), this no longer works and instead the textarea is blank. I assume this is actually a bug/behavior change in chrome, but I'm curious if anyone knows a workaround for this?

closed time in 9 days

steveniemitz

issue commentcodemirror/CodeMirror

textarea content no longer restored when posting and navigating back (in chrome)

No idea—if you're using the save() method to put the editor content back into the textarea, I can't think of anything else that might help.

steveniemitz

comment created time in 9 days

push eventcodemirror/CodeMirror

Axel Lewenhaupt

commit sha dbd0782326ebea9e7d9b9796ff3643b5767becee

[Soy] Improve map, list, record and list comprehension highlighting * Add support for map, list and record types. * Add support for list, record and map literals. * Add support for list comprehension. * Better variable matching in list comprehension.

view details

push time in 9 days

PR merged codemirror/CodeMirror

[Soy] Improve map, list, record and list comprehension highlighting

Add support for map, list and records.

Example of code which is now supported: {@param name: [test: number]} {@param numbers: list<number>} {@param strToNumMap: map<string, number>} {let $list: [['a'], ['b']] /} {let $list2: [$a + 1 for $a in $name if $a >= 3] /} {let $record: record(test: 'a', foo: 'bar') /} {let $map: map('test': 'a', 4: 'bar') /}

+177 -32

0 comment

2 changed files

axellew

pr closed time in 9 days

issue closedmarijnh/Eloquent-JavaScript

Small bugs in platformer tutorial

I noticed a few bugs while going through the platformer tutorial Chatper 16. https://eloquentjavascript.net/16_game.html

1.) When creating the Coin class the use of Math.sin() is mentioned. However the create method omits this in its third paramter

return new Coin(basePos, basePos, Math.random() * Math.PI * 2);

2.) The simpleLevel plan can break if it is used in a editor that has autoformatting. In my case VSCode was adding additional spacing to some of the lines. I was able to fix this by trimming each row before mapping it.

let rows = plan.trim().split("\n").map(l => [...l.trim()]);

closed time in 9 days

lemiesz

issue commentmarijnh/Eloquent-JavaScript

Small bugs in platformer tutorial

The simpleLevel plan can break if it is used in a editor that has autoformatting. In my case VSCode was adding additional spacing to some of the lines.

I'd say that's an (embarassing) bug in VSCode, and not something my code can help. Proper autoformatting (example) would know to leave template strings alone.

lemiesz

comment created time in 9 days

issue commentacornjs/acorn

Cannot configure acorn binary to use acorn-jsx

Wouldn't be all that hard to define a specific export for this that plugins can/should provide and open PRs on the popular plugins. Still wouldn't solve the problem of configuring plugins though, but I think most of them are usually used without configuration.

santids

comment created time in 9 days

created tagProseMirror/prosemirror-view

tag1.14.1

ProseMirror's view component

created time in 11 days

push eventProseMirror/prosemirror-view

Marijn Haverbeke

commit sha 43fdcd419ca2702fbe23d21f1d57dd7495905cce

Mark version 1.14.1

view details

push time in 11 days

issue commentProseMirror/prosemirror

Pasting long text causes page to scroll

The scroll code wasn't taken the distance scrolled in the inner container into account when scrolling the body. Attached patch should help.

janiskelemen

comment created time in 11 days

push eventProseMirror/prosemirror-view

Marijn Haverbeke

commit sha 6aa6c88a9244ed45b534c2227d939aef61a36d9c

Subtract previously scrolled distance when scrolling multiple containers FIX: Fix issue where scrolling the cursor into view in a scrollable editor would sometimes inappropriately scroll an outer container as well. Closes prosemirror/prosemirror#1028

view details

push time in 11 days

issue closedProseMirror/prosemirror

Pasting long text causes page to scroll

Pasting a very long text into the editor will cause the page to scroll down.

https://codesandbox.io/s/52940pk6zx

ProseMirror version

"prosemirror-commands": "1.1.2",
"prosemirror-dropcursor": "1.3.2",
"prosemirror-gapcursor": "1.1.2",
"prosemirror-inputrules": "1.1.2",
"prosemirror-keymap": "1.1.3",
"prosemirror-model": "1.8.2",
"prosemirror-state": "1.3.2",
"prosemirror-view": "1.13.7",

closed time in 11 days

janiskelemen

issue commentcodemirror/codemirror.next

Extension injection at runtime

(Also, this stuff is now very different on the master branch compared to the last release / online docs.)

arguiot

comment created time in 11 days

issue commentcodemirror/codemirror.next

Extension injection at runtime

There's Transaction.reconfigure for this, but I'm still thinking about an easier interface, where you could split your configuration into 'fields' and replace a single field without affecting all the others.

arguiot

comment created time in 11 days

issue commentacornjs/acorn

Cannot configure acorn binary to use acorn-jsx

I don't think all plugins expose the same interface (since 6.0.0), so autoloading them by package name might be difficult.

santids

comment created time in 11 days

Pull request review commentcodemirror/CodeMirror

[Soy] Improve map, list, record and list comprehension highlighting

       this.scope = scope;     } +    function expression(stream, state) {+      let match;+      if (stream.match(/[[]/)) {+        state.soyState.push("list-literal");+        state.lookupVariables = false;+        return null;+      } else if (stream.match(/map/)) {+        state.soyState.push("map-literal");+        return "keyword";+      } else if (stream.match(/record/)) {+        state.soyState.push("record-literal");+        return "keyword";+      } else if (stream.match(/([\w]+)(?=\()/)) {+        return "variable callee";+      } else if (match = stream.match(/^["']/)) {+        state.soyState.push("string");+        state.quoteKind = match;

This issue already existed before this patch, but it seems that the code that actually uses state.quoteKind compares it to a string, which only works because of implicit array-to-string conversion. Might be cleaner to change this to = match[0]

axellew

comment created time in 11 days

Pull request review commentcodemirror/CodeMirror

[Soy] Improve map, list, record and list comprehension highlighting

       this.scope = scope;     } +    function expression(stream, state) {+      let match;+      if (stream.match(/[[]/)) {+        state.soyState.push("list-literal");+        state.lookupVariables = false;+        return null;+      } else if (stream.match(/map/)) {

I suspect you'll need at least a \b at the end of this regular expression, to avoid matching any word that starts with "map". (Same for other word regexps.)

axellew

comment created time in 11 days

pull request commentProseMirror/prosemirror-view

Implement ignoreMutation for Widget Decorations

I think the widget options are a better place for this than the DOM. Attached patch introduces an ignoreSelection option to widgets.

jljorgenson18

comment created time in 11 days

created tagProseMirror/prosemirror-view

tag1.14.0

ProseMirror's view component

created time in 11 days

push eventProseMirror/prosemirror-view

Marijn Haverbeke

commit sha 8a0abc4020875b4587f1ad3759a4705b7a531ab2

Add ignoreSelection option to widget decorations FEATURE: Widget decorations can now take an `ignoreSelection` option, that causes the editor to leave selections inside them alone. Issue #68

view details

Marijn Haverbeke

commit sha cd2e624375d095f8b65ddbe109f492db3f4e47ec

Set handled selection after ignoring selection change

view details

Marijn Haverbeke

commit sha 6d54bd1df06c7e51bc88c79e813027a127b54954

Mark version 1.14.0

view details

push time in 11 days

issue commentcodemirror/CodeMirror

Line numbers disappear when scrolling left using CodeMirror.scrollTo at the left-most edge

Seems scrollTo isn't handling negative x coordinates well. Attached patch clips them.

mliao95

comment created time in 11 days

push eventcodemirror/CodeMirror

Marijn Haverbeke

commit sha 72988bf3fc4682165b149f691d3465bf140af750

Clip negative scroll-to coordinates Closes #6139

view details

push time in 11 days

issue closedcodemirror/CodeMirror

Line numbers disappear when scrolling left using CodeMirror.scrollTo at the left-most edge

I am having trouble saving and sending a jsbin of the issue, but here is a GIF with the code and example that I am seeing: https://imgur.com/a/rLqFCIT

Is this expected or a bug?

closed time in 11 days

mliao95

push eventProseMirror/prosemirror-view

Marijn Haverbeke

commit sha 90f03cce18c097208d504e15acb3a2472b6a0c4e

Sync the DOM selection on focus if necessary FIX: Fix an issue where moving focus to the editor with the keyboard or the DOM `focus` method would leave the DOM and state selections inconsistent. See https://discuss.prosemirror.net/t/pm-internal-selection-looks-out-of-sync-under-certain-condition/2515

view details

push time in 11 days

push eventProseMirror/prosemirror-view

Marijn Haverbeke

commit sha 94a72460c984bc6e8a6140751c7a95ee4ecab825

Fix bug in selection-is-at-edge check

view details

push time in 11 days

pull request commentProseMirror/prosemirror-view

Implement ignoreMutation for Widget Decorations

Okay, I see the problem now I think—the selection in the widget gets reset immediately by ProseMirror syncing its selection state with the DOM selection. But this will happen on any transaction anyway—when you create a selection inside the widget and, for example, a collaborative editing step comes in, your selection will be reset. Is giving the widget a tabindex, so that it becomes focusable on its own and doesn't share focus with the editor, something you can do? Because that seems like a more robust solution (when the editor doesn't have focus, it won't mess with the DOM selection).

jljorgenson18

comment created time in 11 days

more