profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/marijnh/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Marijn Haverbeke marijnh not interested in recruiter mail Berlin http://marijnhaverbeke.nl Independent open-source programmer person

acornjs/acorn 7194

A small, fast, JavaScript-based JavaScript parser

marijnh/Eloquent-JavaScript 2553

The sources for the Eloquent JavaScript book

codemirror/CodeMirror-v1 362

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

lezer-parser/lezer 329

Incremental parsing system

marijnh/Eloquent-JavaScript-1st-edition 323

The source for http://eloquentjavascript.net

akapav/js 174

JavaScript compiler for Common Lisp

lezer-parser/lezer-generator 52

Parser generator for the lezer incremental parser

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

adrianheine/ProsePad 23

ProsePad is a real-time collaborative text editor like Etherpad, but based on ProseMirror

issue commentcodemirror/codemirror.next

Getting line number based on widget

Please use the forum for questions—the issue tracker is for bugs.

I don't really understand the question anyway. So if you re-post, you could try to be a bit more clear what you mean.

Thanks for the replay. I have posted the question in forum.

suneethar

comment created time in an hour

issue openedcodemirror/codemirror.next

Getting line number based on widget

Hi,

Is it possible to set area like import area, function body area something like this inside editor and extra the code associated with only that particular area I have requirement where I have to extract specific area code and store it in json.

Thanks

created time in 5 hours

issue openedcodemirror/codemirror.next

Java language support with linter and autocomplete

Hi,

Does codemirror6 has inbuilt support for Java language with linter and validation.

Thanks and Regards, Suneetha

created time in 6 hours

PR opened codemirror/CodeMirror

Add initial port of abbott.vim v2.1 theme

<!-- NOTE: We are not accepting pull requests for new modes or addons. Please put such code in a separate repository, and release them as stand-alone npm packages. See for example the Elixir mode.

Also pull requests that rewrite big chunks of code or adjust code style to your own taste are generally not welcome. Make your changes in focused steps that fix or improve a specific thing. -->

I've ported the abbott.vim color scheme (version 2.1) to a CodeMirror theme. It's as faithful a port as I could reasonably make given that CodeMirror's syntax highlighting tokens don't perfectly map onto Vim's highlight groups.

I saw the note in the pull request template to not submit a PR for a new mode or addon. I wasn't sure if the same applied to themes, so if y'all aren't merging new themes upstream either, please just let me know. Thanks! :)

+274 -0

0 comment

2 changed files

pr created time in 8 hours

issue commentcodemirror/codemirror.next

iOS sometimes enter gets stuck

Can confirm happens on iOS.

lishid

comment created time in 16 hours

issue openedcodemirror/CodeMirror

Visual bug when reloading the website.

I am working on a small website where I use Codemirror quite a lot for almost all the textareas. I use jQuery to convert all textareas and implement Codemirror (using Angular 11 and importing both css/js from codemirror into angular.json):

HTML -> <textarea class="json_editor" rows="5"></textarea>

JS -> var textareas = document.querySelectorAll(".js_editor"); for (var i = 0; i < textareas.length; i++) { CodeMirror.fromTextArea(textareas[i], { lineWrapping: true, mode: "javascript", theme: "base16-dark", readOnly: true, lineNumbers: true }); }

The problem is that if I reload the site for the first time, Codemirror loads perfectly, but I reload again and the Codemirror components do not load.

Website URL: https://www.strap.ga/docs/nextjs

Is there any solution so that this bug does not happen? Thank you very much!

created time in a day

issue commentcodemirror/codemirror.next

Can't enter "ł" (Polish letter) using external keyboard on iOS

Heya @marijnh any idea when will this be added to a release? Using an app built on CodeMirror 6 as my daily driver, kinda impacting my workflow quite a lot.

balance-wtf

comment created time in a day

issue openedcodemirror/codemirror.next

iOS sometimes enter gets stuck

I suspect this is related to the auto-capitalization hacks happening when enter is being pressed.

https://user-images.githubusercontent.com/609710/117278082-6fa8e380-ae2e-11eb-8c3d-4f82ed642a91.mp4

https://user-images.githubusercontent.com/609710/117278771-0d041780-ae2f-11eb-8d74-7e42e1cfe3a9.mp4

created time in a day

issue openedcodemirror/CodeMirror

Crystal: Character without any spaces after % gets highlighted differently.

image

As it can be that digits and characters are highlighted differently depending or not whether there is space seperating them, another thing is that the issue is only with the % not with other operators.

Browser : Brave 1.23, Firefox 88

created time in a day

issue commentProseMirror/prosemirror

Incorrect (visual) cursor in Safari if atom node is last node in line

I noticed that the issue goes away if you set the contenteditable attribute of the atoms (mentions / dinos) to true instead of false.

Of course, setting contenteditable="true" leads to other issues, such as that it then becomes possible (in some cases) to place the cursor inside the atom and edit the text content of the mention. But perhaps something can be done in ProseMirror to prevent this from happening (e.g. by detecting when the cursor moves inside an atom).

philippkuehn

comment created time in a day

issue commentProseMirror/prosemirror

Incorrect (visual) iOS cursor if atom node is last node in line

Ah you are right! So maybe this will be easier to debug.

philippkuehn

comment created time in a day

issue commentProseMirror/prosemirror

Incorrect (visual) iOS cursor if atom node is last node in line

As mentioned in the referenced issue, this is not just an issue on iOS. It also happens in Safari 14.1 on desktop.

philippkuehn

comment created time in a day

issue openedProseMirror/prosemirror

Incorrect (visual) iOS cursor if atom node is last node in line

Issue details

First, sorry for creating a new iOS related issue! When using atom nodes it’s not possible to place the cursor after it when the node is the last node in a line. You can see that in the offical dinos example. When placing a dino at the end of a line, iOS renders the cursor at the start of a line. If I type something, the content will be placed after the dino (which is correct) but it feels weird because of the wrong (visual) cursor rendered by iOS.

Steps to reproduce

  • go to https://prosemirror.net/examples/dino/
  • insert dino at end of line
  • see incorrect cursor position

ProseMirror version

prosemirror-view: 1.18.4

Affected platforms

  • [ ] Chrome
  • [ ] Firefox
  • [ ] Internet Explorer
  • [x] iOS Safari

Screenshots / Screencast (Optional)

https://user-images.githubusercontent.com/2500670/117257187-e6a0a500-ae4b-11eb-8dff-ed9964aecf94.MP4

created time in a day

issue openedcodemirror/codemirror.next

Not able to set the cursor to the end of the string [mobile Safari]

Hey @marijnh,

I've faced an issue with the linter, then the string has a diagnostic annotation, I'm not able to click to set the cursor to the end when clicking to on the string.

cm-issue

Code:

import {EditorState, EditorView, basicSetup} from "@codemirror/basic-setup"
import {python} from "@codemirror/lang-python"
import {setDiagnostics } from "@codemirror/lint";

let state = EditorState.create({doc: `# This is a basic program on Python
print('Hello, World!')`, extensions: [
  basicSetup,
  python()
]})

;(window as any).view = new EditorView({state, parent: document.querySelector("#editor")!})

setTimeout(() => {
  (window as any).view.dispatch(setDiagnostics((window as any).view.state, [{
    from: 58,
    message: "W292 no newline at end of file",
    severity: "warning",
    to: 58
  }]));
}, 500);

created time in a day

issue commentcodemirror/codemirror.next

Autocompletion not triggered

Works great. Thanks 👍

AMerkuri

comment created time in 2 days

issue commentcodemirror/codemirror.next

Autocompletion not triggered

The problem in 0.18.1 that you need to have tag closed before you can have autocomplete for attributes.

AMerkuri

comment created time in 2 days

issue openedProseMirror/prosemirror

Can't select the last character of a paragraph

Issue details

Can't select the last character of a paragraph when inserting an inline atom node at the beginning of a paragraph before a space character.

Steps to reproduce

  1. Open the example "Dino in the document" https://prosemirror.net/examples/dino/
  2. Put a space at the beginning of any paragraph.
  3. Place the cursor in front of the space (at the beginning of the paragraph).
  4. Insert any "Dino"
  5. Select the last character of the paragraph.

ProseMirror version

Latest version.

Affected platforms

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

  • [x] Chrome
  • [ ] Firefox
  • [x] Opera
  • [x] Edge

Screenshots / Screencast (Optional)

cropper

created time in 2 days

issue openedProseMirror/prosemirror

[Firefox] Cursor does not represent where the changes happen

Issue details

The editor cursor does not represent where the changes happen on Firefox, e.g. cursor appears at one location, when an insertion happens, the insertion happens in a different location.

Steps to reproduce

  • Go to https://prosemirror.net/examples/dino/ using Firefox
  • Put 2 dinos next to each other
  • Insert a character between the 2 dinos
  • Notice that the cursor is on the right side of the character.
  • Press backspace

Expected result: the newly inserted character is removed Actual result: the dino on the right side of the cursor is removed.

ProseMirror version

  • I noticed this issue when upgrading from 1.9.12 to 1.15.4
  • And lastest version: 1.18.4

Affected platforms

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

Screenshots / Screencast

https://user-images.githubusercontent.com/10228558/117106528-5b7bcc80-adc3-11eb-8f3d-93cccd276950.mov

created time in 2 days

issue closedcodemirror/codemirror.next

How to use codemirror-mode-elixir

I'm trying to use codemirror-mode-elixir. Is there a documented way to integrate with existing tools in the ecosystem? I'm willing to fork this and change it if necessary, but I'm not sure where to start.

closed time in 3 days

xCloudzx

issue openedcodemirror/codemirror.next

[Commands] Cmd-ArrowLeft/ArrowRight should respect visualLine on macOS

When pressing Cmd-ArrowLeft/Cmd-ArrowRight on macOS or iPadOS, the cursor should jump to the beginning or end of the visual line, when EditorView.lineWrapping is used. Currently, the cursor jumps to the beginning of the actual line. When using the editor for writing prose (i.e. Markdown), this often means the beginning of a paragraph. I tested a few other applications, including a plain textarea and VS Code and all jumped to the start of the visual line instead.

However, when pressing Home or End, CodeMirror shows the expected behavior of pressing Cmd-ArrowLeft/Cmd-ArrowRight (see https://github.com/codemirror/commands/blob/82a53a4489778e0b19eca5d9e725ba1dc277ae12/src/commands.ts#L112).

created time in 3 days

issue commentcodemirror/codemirror.next

Tooltip has wrong position in absolute-positioned div

@marijnh Seems to work better for me now. Thanks! :-)

fabianmichael

comment created time in 3 days

issue commentacornjs/acorn

`async of` should be allowed in LHS of for-await

Yeah, for (async of []) is forbidden, the old behaviour is correct. for await (async of []) is allowed, currently acorn throws because async of is parsed as an arrow function.

JLHwung

comment created time in 3 days

issue commentacornjs/acorn

Line numbers

Thank you @marijnh

yalondpsi

comment created time in 3 days

issue openedacornjs/acorn

Line numbers

There is an option to get the node's line number he belongs to?

created time in 3 days

startedmarijnh/style-mod

started time in 3 days

issue commentcodemirror/codemirror.next

How to use codemirror-mode-elixir

Alright, I finally got around to doing it and I've published codemirror-lang-elixir. It seems to work well. I copied most of the configuration from the legacy-modes package.

xCloudzx

comment created time in 4 days

issue openedcodemirror/google-modes

[cc] const auto* const not highlighting well

const auto* const foo = GetFoo();

should highlight the consts as keywords but only the first one gets correctly highlighted

created time in 4 days

issue commentcodemirror/codemirror.next

Safari's Selection is broken in shadow roots

Oh no, I found one more issue.

If you use the cursor on the touchpad and scroll over the Edge of the Screen, and it scrolls in a Textfield the cursor gets lost and you can't type text unless you tap somewhere to type. This happens if you scroll horizontally and vertically. https://user-images.githubusercontent.com/15811973/116792576-d2624e00-aac1-11eb-90c2-73b8fc68a522.MOV

If you use the touchpad and to mark text above the Edge of the screen everything is working fine. https://user-images.githubusercontent.com/15811973/116792612-0e95ae80-aac2-11eb-9e62-ecd353b72e56.MOV

bramkragten

comment created time in 6 days

issue openedcodemirror/CodeMirror

CSS height behaviour is incorrect.

See this codepen:

https://codepen.io/chaosprint/pen/KKajbLN

<div id="editor"></div>
CodeMirror(document.getElementById('editor'), {
	lineNumbers: true
})
body {
	padding: 0;
	margin: 0;
}

.CodeMirror {
	border: 1px solid red;
	height: 90%;
	font-size: 20px;
}

/* #editor {
	border: 1px solid blue;
	height: 90%;
} */

The CSS part I comment out does not work either.

I know I can call setSize to solve it, or

.CodeMirror {
	height: 100vh;
}

can work. But to be responsive requires more work then.

The behaviour in the codepen is very against intuition, isn't it?

created time in 6 days