Questions tagged [codemirror-modes]

Overview

CodeMirror Modes typically consist of a single JavaScript file. This file defines, in the simplest case, a lexer (tokenizer) for your language—a function that takes a character stream as input, advances it past a token, and returns a style for that token. More advanced modes can also handle indentation for the language.

Useful Links

Related tags

61 questions
6
votes
2 answers

Live autocomplete in Codemirror

It seems that Codemirror plugin show-hint is activated by shortcut. I need to implement live autocomplete functionality, i.e. show hints after user entered first letters of keyword. Is there a way to do this with Codemirror?
Eugene Krakos
  • 159
  • 1
  • 8
6
votes
1 answer

CodeMirror markText is not working

I am using CodeMirror like this to show some XML response to User. HTML CODE JS CODE window.onload = function () { var editor =…
Gans
  • 129
  • 2
  • 11
5
votes
1 answer

Codemirror how to create a mode

So I just got into codemirror recently because I needed a text editor for my website, but that means I don't know much about the program. I got the editor working with the javascript mode, but I need to create some syntax for the editor, which I…
Markus
  • 297
  • 4
  • 19
4
votes
0 answers

How do i create a new codemirror mode?

So i recently finished my own functional programming language for a project and I want to create a codemirror mode for the language as it transcompiles to javascript. I have written a tokenizer for it but I can't understand the way codemirror…
Josh Weinstein
  • 2,788
  • 2
  • 21
  • 38
4
votes
1 answer

How to highlight multiple language source codes using codemirror on the same page?

I am writing a tutorial page where I need to highlight different source codes which are in different languages(HTML,CSS, Javascript, jQuery) Currently, it is highlighting one language if I mentioned the mode:"jQuery" I want to highlight some portion…
Prabhakar
  • 6,458
  • 2
  • 40
  • 51
3
votes
1 answer

Using Codemirror twice on the same page (HTML and CSS) results in only one highlighting mode being applied

I have two textfields, one with HTML code and the other one with CSS code, but the mode for the CodeMirror (HTML-mode) applies for the entire page, so the CSS code simply isn't highlighted. Link to Codemirrors CSS mode: Codemirror CSS Mode I…
3
votes
0 answers

How to define custom mode in ng2-codemirror?

I'd like to define my custom mode that extends one of available modes (e.g. javascript)? I've tried to use below code, but no effect. CodeMirror.defineMode("foo", function (config, parserConfig) { var fooOverlay = { token:…
mankers
  • 742
  • 10
  • 19
3
votes
1 answer

How to highlight substrings in CodeMirror based on substring positions

I'm trying to use CodeMirror (http://codemirror.net/) as a basic text editor with some extra functionalities. One of them is highlighting specific words or groups of words as specified by their positions in the original string. I have an external…
protozoo
  • 560
  • 6
  • 16
2
votes
0 answers

Way to "overlay" multiple tokens/rules/styles with CodeMirror simple mode?

A CodeMirror "simple mode" allows you to define a bunch of regex rules that capture chunks of text and apply styles to them. A regex rule can also be used to transition to another mode that has been defined. Here's a really simple example of…
user993683
2
votes
1 answer

Dynamic line counts in Codemirror gutter is empty every second time the key is pressed

I was tasked to build a note input area where i should show line count and character count in each line. I chose codemirror to do it. Everything works but the Line character count seems to be blanking out every second key press. I have attached…
suyesh
  • 530
  • 7
  • 23
2
votes
0 answers

Nested groups in CodeMirror

I'm trying to code a mode for Minecraft Styles http://minecraft.tools/en/color-code.php I want to do group nesting where everything that start with § is styled right to the end of the line I.E. §7 $1 \(§l§3$0\) would become //…
MRVDOG
  • 1,717
  • 2
  • 13
  • 20
2
votes
2 answers

Codemirror Autocomplete hidden behind bootstrap modal

I am having an issue with codemirror autocomplete in bootstrap modal, it gets hidden behind the modal. So it works but doesn't appear in top. So far i have tried using css modifications such as: .codeMirror-hints, .CodeMirror-hint,…
Alok
  • 808
  • 13
  • 40
2
votes
0 answers

React Codemirror + Browserify not rendering htmlmixed mode

I'm trying to use react-codemirror to display a chunk of html in a form, but for some reason I cannot get codemirror to behave. Before switching to react-codemirror, I was having the same issues with browserify + vanilla codemirror, so I'm almost…
banerjs
  • 538
  • 6
  • 14
2
votes
1 answer

How to apply a Codemirror mode in this React + Browserify environment

I'm developping an app based on this boilerplate: react-app-boilerplate I'm using the react-codemirror module I want to apply the javascript mode to codemirror but I get a 'CodeMirror is undefined' error when symply inserting the external script…
JohnT
  • 103
  • 2
  • 12
2
votes
2 answers

Where to get a list of all JavaFX CSS properties names?

I am trying to build a CodeMirror mode file in order to provide correct syntax highlighting and completion help for the JavaFX flavour of CSS, based on the original CSS mode. In JavaFX CSS, most properties are the same as in classic CSS, but some…
Pierre Henry
  • 16,658
  • 22
  • 85
  • 105
1
2 3 4 5