Merge pull request #139 from tophf/codemirror-5.5.0

Codemirror 5.5.0
This commit is contained in:
Jason Barnabe 2015-08-02 21:46:58 -05:00
commit b4eaac4ef9
55 changed files with 386 additions and 1983 deletions

View File

@ -1,8 +0,0 @@
*.txt text
*.js text
*.html text
*.md text
*.json text
*.yml text
*.css text
*.svg text

View File

@ -1,8 +0,0 @@
/node_modules
/npm-debug.log
/test*.html
.tern-*
*~
*.swp
.idea
*.iml

View File

@ -1,3 +0,0 @@
language: node_js
node_js:
- 0.10

View File

@ -1,454 +0,0 @@
List of CodeMirror contributors. Updated before every release.
4r2r
Aaron Brooks
Abdelouahab
Abe Fettig
Adam Ahmed
Adam King
adanlobato
Adán Lobato
Adrian Aichner
aeroson
Ahmad Amireh
Ahmad M. Zawawi
ahoward
Akeksandr Motsjonov
Alberto González Palomo
Alberto Pose
Albert Xing
Alexander Pavlov
Alexander Schepanovski
Alexander Shvets
Alexander Solovyov
Alexandre Bique
alexey-k
Alex Piggott
Aliaksei Chapyzhenka
Amin Shali
Amsul
amuntean
Amy
Ananya Sen
anaran
AndersMad
Anders Nawroth
Anderson Mesquita
Andrea G
Andreas Reischuck
Andre von Houck
Andrey Fedorov
Andrey Klyuchnikov
Andrey Lushnikov
Andy Joslin
Andy Kimball
Andy Li
angelozerr
angelo.zerr@gmail.com
Ankit
Ankit Ahuja
Ansel Santosa
Anthony Grimes
Anton Kovalyov
areos
as3boyan
AtomicPages LLC
Atul Bhouraskar
Aurelian Oancea
Bastian Müller
Bem Jones-Bey
benbro
Beni Cherniavsky-Paskin
Benjamin DeCoste
Ben Keen
Bernhard Sirlinger
Bert Chang
Billy Moon
binny
B Krishna Chaitanya
Blaine G
blukat29
boomyjee
borawjm
Brandon Frohs
Brandon Wamboldt
Brett Zamir
Brian Grinstead
Brian Sletten
Bruce Mitchener
Chandra Sekhar Pydi
Charles Skelton
Cheah Chu Yeow
Chris Coyier
Chris Granger
Chris Houseknecht
Chris Lohfink
Chris Morgan
Christian Oyarzun
Christian Petrov
Christopher Brown
Christopher Mitchell
Christopher Pfohl
ciaranj
CodeAnimal
coderaiser
ComFreek
Curtis Gagliardi
dagsta
daines
Dale Jung
Dan Bentley
Dan Heberden
Daniel, Dao Quang Minh
Daniele Di Sarli
Daniel Faust
Daniel Huigens
Daniel KJ
Daniel Neel
Daniel Parnell
Danny Yoo
darealshinji
Darius Roberts
Dave Myers
David Barnett
David Mignot
David Pathakjee
David Vázquez
deebugger
Deep Thought
Devon Carew
dignifiedquire
Dimage Sapelkin
Dmitry Kiselyov
domagoj412
Dominator008
Domizio Demichelis
Doug Wikle
Drew Bratcher
Drew Hintz
Drew Khoury
Dror BG
duralog
eborden
edsharp
ekhaled
Enam Mijbah Noor
Eric Allam
eustas
Fabien O'Carroll
Fabio Zendhi Nagao
Faiza Alsaied
Fauntleroy
fbuchinger
feizhang365
Felipe Lalanne
Felix Raab
Filip Noetzel
flack
ForbesLindesay
Forbes Lindesay
Ford_Lawnmower
Forrest Oliphant
Frank Wiegand
Gabriel Gheorghian
Gabriel Horner
Gabriel Nahmias
galambalazs
Gautam Mehta
gekkoe
Gerard Braad
Gergely Hegykozi
Giovanni Calò
Glenn Jorde
Glenn Ruehle
Golevka
Gordon Smith
Grant Skinner
greengiant
Gregory Koberger
Guillaume Massé
Guillaume Massé
Gustavo Rodrigues
Hakan Tunc
Hans Engel
Hardest
Hasan Karahan
Herculano Campos
Hiroyuki Makino
hitsthings
Hocdoc
Ian Beck
Ian Dickinson
Ian Wehrman
Ian Wetherbee
Ice White
ICHIKAWA, Yuji
ilvalle
Ingo Richter
Irakli Gozalishvili
Ivan Kurnosov
Ivoah
Jacob Lee
Jakob Miland
Jakub Vrana
Jakub Vrána
James Campos
James Thorne
Jamie Hill
Jan Jongboom
jankeromnes
Jan Keromnes
Jan Odvarko
Jan T. Sott
Jared Forsyth
Jason
Jason Barnabe
Jason Grout
Jason Johnston
Jason San Jose
Jason Siefken
Jaydeep Solanki
Jean Boussier
jeffkenton
Jeff Pickhardt
jem (graphite)
Jeremy Parmenter
Jochen Berger
Johan Ask
John Connor
John Lees-Miller
John Snelson
John Van Der Loo
Jonas Döbertin
Jonathan Malmaud
jongalloway
Jon Malmaud
Jon Sangster
Joost-Wim Boekesteijn
Joseph Pecoraro
Joshua Newman
Josh Watzman
jots
jsoojeon
ju1ius
Juan Benavides Romero
Jucovschi Constantin
Juho Vuori
Justin Hileman
jwallers@gmail.com
kaniga
Ken Newman
Ken Rockot
Kevin Earls
Kevin Sawicki
Kevin Ushey
Klaus Silveira
Koh Zi Han, Cliff
komakino
Konstantin Lopuhin
koops
ks-ifware
kubelsmieci
KwanEsq
Lanfei
Lanny
Laszlo Vidacs
leaf corcoran
Leonid Khachaturov
Leon Sorokin
Leonya Khachaturov
Liam Newman
Libo Cannici
LloydMilligan
LM
lochel
Lorenzo Stoakes
Luciano Longo
Luke Stagner
lynschinzer
Maksim Lin
Maksym Taran
Malay Majithia
Manuel Rego Casasnovas
Marat Dreizin
Marcel Gerber
Marco Aurélio
Marco Munizaga
Marcus Bointon
Marek Rudnicki
Marijn Haverbeke
Mário Gonçalves
Mario Pietsch
Mark Lentczner
Marko Bonaci
Martin Balek
Martín Gaitán
Martin Hasoň
Martin Hunt
Mason Malone
Mateusz Paprocki
Mathias Bynens
mats cronqvist
Matthew Beale
Matthias Bussonnier
Matthias BUSSONNIER
Matt McDonald
Matt Pass
Matt Sacks
mauricio
Maximilian Hils
Maxim Kraev
Max Kirsch
Max Xiantu
mbarkhau
Metatheos
Micah Dubinko
Michael Grey
Michael Lehenbauer
Michael Zhou
Mighty Guava
Miguel Castillo
mihailik
Mike
Mike Brevoort
Mike Diaz
Mike Ivanov
Mike Kadin
MinRK
Miraculix87
misfo
mloginov
Moritz Schwörer
mps
ms
mtaran-google
Narciso Jaramillo
Nathan Williams
ndr
nerbert
nextrevision
ngn
nguillaumin
Ng Zhi An
Nicholas Bollweg
Nicholas Bollweg (Nick)
Nick Kreeger
Nick Small
Niels van Groningen
nightwing
Nikita Beloglazov
Nikita Vasilyev
Nikolay Kostov
nilp0inter
Nisarg Jhaveri
nlwillia
Norman Rzepka
pablo
Page
Panupong Pasupat
paris
Paris
Patil Arpith
Patrick Stoica
Patrick Strawderman
Paul Garvin
Paul Ivanov
Pavel Feldman
Pavel Strashkin
Paweł Bartkiewicz
peteguhl
Peter Flynn
peterkroon
Peter Kroon
prasanthj
Prasanth J
Radek Piórkowski
Rahul
Randall Mason
Randy Burden
Randy Edmunds
Rasmus Erik Voel Jensen
ray ratchup
Ray Ratchup
Richard van der Meer
Richard Z.H. Wang
Robert Crossfield
Roberto Abdelkader Martínez Pérez
robertop23
Robert Plummer
Ruslan Osmanov
Ryan Prior
sabaca
Samuel Ainsworth
sandeepshetty
Sander AKA Redsandro
santec
Sascha Peilicke
satchmorun
sathyamoorthi
SCLINIC\jdecker
Scott Aikin
Scott Goodhew
Sebastian Zaha
shaund
shaun gilchrist
Shawn A
sheopory
Shiv Deepak
Shmuel Englard
Shubham Jain
silverwind
snasa
soliton4
sonson
spastorelli
srajanpaliwal
Stanislav Oaserele
Stas Kobzar
Stefan Borsje
Steffen Beyer
Steve O'Hara
stoskov
Taha Jahangir
Takuji Shimokawa
Tarmil
tel
tfjgeorge
Thaddee Tyl
TheHowl
think
Thomas Dvornik
Thomas Schmid
Tim Alby
Tim Baumann
Timothy Farrell
Timothy Hatcher
TobiasBg
Tomas-A
Tomas Varaneckas
Tom Erik Støwer
Tom MacWright
Tony Jian
Travis Heppe
Triangle717
twifkak
Vestimir Markov
vf
Vincent Woo
Volker Mische
wenli
Wesley Wiser
Will Binns-Smith
William Jamieson
William Stein
Willy
Wojtek Ptak
Xavier Mendez
Yassin N. Hassan
YNH Webdev
Yunchi Luo
Yuvi Panda
Zachary Dremann
Zhang Hao
zziuni
魏鹏刚

View File

@ -1,76 +0,0 @@
# How to contribute
- [Getting help](#getting-help-)
- [Submitting bug reports](#submitting-bug-reports-)
- [Contributing code](#contributing-code-)
## Getting help
Community discussion, questions, and informal bug reporting is done on the
[discuss.CodeMirror forum](http://discuss.codemirror.net).
## Submitting bug reports
The preferred way to report bugs is to use the
[GitHub issue tracker](http://github.com/codemirror/CodeMirror/issues). Before
reporting a bug, read these pointers.
**Note:** The issue tracker is for *bugs*, not requests for help. Questions
should be asked on the
[discuss.CodeMirror forum](http://discuss.codemirror.net) instead.
### Reporting bugs effectively
- CodeMirror is maintained by volunteers. They don't owe you anything, so be
polite. Reports with an indignant or belligerent tone tend to be moved to the
bottom of the pile.
- Include information about **the browser in which the problem occurred**. Even
if you tested several browsers, and the problem occurred in all of them,
mention this fact in the bug report. Also include browser version numbers and
the operating system that you're on.
- Mention which release of CodeMirror you're using. Preferably, try also with
the current development snapshot, to ensure the problem has not already been
fixed.
- Mention very precisely what went wrong. "X is broken" is not a good bug
report. What did you expect to happen? What happened instead? Describe the
exact steps a maintainer has to take to make the problem occur. We can not
fix something that we can not observe.
- If the problem can not be reproduced in any of the demos included in the
CodeMirror distribution, please provide an HTML document that demonstrates
the problem. The best way to do this is to go to
[jsbin.com](http://jsbin.com/ihunin/edit), enter it there, press save, and
include the resulting link in your bug report.
## Contributing code
- Make sure you have a [GitHub Account](https://github.com/signup/free)
- Fork [CodeMirror](https://github.com/codemirror/CodeMirror/)
([how to fork a repo](https://help.github.com/articles/fork-a-repo))
- Make your changes
- If your changes are easy to test or likely to regress, add tests.
Tests for the core go into `test/test.js`, some modes have their own
test suite under `mode/XXX/test.js`. Feel free to add new test
suites to modes that don't have one yet (be sure to link the new
tests into `test/index.html`).
- Follow the general code style of the rest of the project (see
below). Run `bin/lint` to verify that the linter is happy.
- Make sure all tests pass. Visit `test/index.html` in your browser to
run them.
- Submit a pull request
([how to create a pull request](https://help.github.com/articles/fork-a-repo))
### Coding standards
- 2 spaces per indentation level, no tabs.
- Include semicolons after statements.
- Note that the linter (`bin/lint`) which is run after each commit
complains about unused variables and functions. Prefix their names
with an underscore to muffle it.
- CodeMirror does *not* follow JSHint or JSLint prescribed style.
Patches that try to 'fix' code to pass one of these linters will be
unceremoniously discarded.

View File

@ -1,4 +1,4 @@
Copyright (C) 2014 by Marijn Haverbeke <marijnh@gmail.com> and others Copyright (C) 2015 by Marijn Haverbeke <marijnh@gmail.com> and others
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,12 +0,0 @@
# CodeMirror
[![Build Status](https://travis-ci.org/codemirror/CodeMirror.svg)](https://travis-ci.org/codemirror/CodeMirror)
[![NPM version](https://img.shields.io/npm/v/codemirror.svg)](https://www.npmjs.org/package/codemirror)
[Funding status: ![maintainer happiness](https://marijnhaverbeke.nl/fund/status_s.png?again)](https://marijnhaverbeke.nl/fund/)
CodeMirror is a JavaScript component that provides a code editor in
the browser. When a mode is available for the language you are coding
in, it will color your code, and optionally help with indentation.
The project page is http://codemirror.net
The manual is at http://codemirror.net/doc/manual.html
The contributing guidelines are in [CONTRIBUTING.md](https://github.com/codemirror/CodeMirror/blob/master/CONTRIBUTING.md)

View File

@ -61,6 +61,7 @@
this.tick = null; this.tick = null;
this.cm.off("cursorActivity", this.activityFunc); this.cm.off("cursorActivity", this.activityFunc);
if (this.widget && this.data) CodeMirror.signal(this.data, "close");
if (this.widget) this.widget.close(); if (this.widget) this.widget.close();
CodeMirror.signal(this.cm, "endCompletion", this.cm); CodeMirror.signal(this.cm, "endCompletion", this.cm);
}, },
@ -98,7 +99,6 @@
update: function(first) { update: function(first) {
if (this.tick == null) return; if (this.tick == null) return;
if (this.data) CodeMirror.signal(this.data, "update");
if (!this.options.hint.async) { if (!this.options.hint.async) {
this.finishUpdate(this.options.hint(this.cm, this.options), first); this.finishUpdate(this.options.hint(this.cm, this.options), first);
} else { } else {
@ -110,13 +110,19 @@
}, },
finishUpdate: function(data, first) { finishUpdate: function(data, first) {
if (this.data) CodeMirror.signal(this.data, "update");
if (data && this.data && CodeMirror.cmpPos(data.from, this.data.from)) data = null;
this.data = data; this.data = data;
var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle); var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);
if (this.widget) this.widget.close(); if (this.widget) this.widget.close();
if (data && data.list.length) { if (data && data.list.length) {
if (picked && data.list.length == 1) this.pick(data, 0); if (picked && data.list.length == 1) {
else this.widget = new Widget(this, data); this.pick(data, 0);
} else {
this.widget = new Widget(this, data);
CodeMirror.signal(data, "shown");
}
} }
}, },
@ -346,18 +352,20 @@
CodeMirror.registerHelper("hint", "fromList", function(cm, options) { CodeMirror.registerHelper("hint", "fromList", function(cm, options) {
var cur = cm.getCursor(), token = cm.getTokenAt(cur); var cur = cm.getCursor(), token = cm.getTokenAt(cur);
var to = CodeMirror.Pos(cur.line, token.end);
if (token.string && /\w/.test(token.string[token.string.length - 1])) {
var term = token.string, from = CodeMirror.Pos(cur.line, token.start);
} else {
var term = "", from = to;
}
var found = []; var found = [];
for (var i = 0; i < options.words.length; i++) { for (var i = 0; i < options.words.length; i++) {
var word = options.words[i]; var word = options.words[i];
if (word.slice(0, token.string.length) == token.string) if (word.slice(0, term.length) == term)
found.push(word); found.push(word);
} }
if (found.length) return { if (found.length) return {list: found, from: from, to: to};
list: found,
from: CodeMirror.Pos(cur.line, token.start),
to: CodeMirror.Pos(cur.line, token.end)
};
}); });
CodeMirror.commands.autocomplete = CodeMirror.showHint; CodeMirror.commands.autocomplete = CodeMirror.showHint;

View File

@ -63,11 +63,9 @@
this.onMouseOver = function(e) { onMouseOver(cm, e); }; this.onMouseOver = function(e) { onMouseOver(cm, e); };
} }
function parseOptions(cm, options) { function parseOptions(_cm, options) {
if (options instanceof Function) return {getAnnotations: options}; if (options instanceof Function) return {getAnnotations: options};
if (!options || options === true) options = {}; if (!options || options === true) options = {};
if (!options.getAnnotations) options.getAnnotations = cm.getHelper(CodeMirror.Pos(0, 0), "lint");
if (!options.getAnnotations) throw new Error("Required option 'getAnnotations' missing (lint addon)");
return options; return options;
} }
@ -120,10 +118,12 @@
function startLinting(cm) { function startLinting(cm) {
var state = cm.state.lint, options = state.options; var state = cm.state.lint, options = state.options;
var passOptions = options.options || options; // Support deprecated passing of `options` property in options var passOptions = options.options || options; // Support deprecated passing of `options` property in options
if (options.async || options.getAnnotations.async) var getAnnotations = options.getAnnotations || cm.getHelper(CodeMirror.Pos(0, 0), "lint");
options.getAnnotations(cm.getValue(), updateLinting, passOptions, cm); if (!getAnnotations) return;
if (options.async || getAnnotations.async)
getAnnotations(cm.getValue(), updateLinting, passOptions, cm);
else else
updateLinting(cm, options.getAnnotations(cm.getValue(), passOptions, cm)); updateLinting(cm, getAnnotations(cm.getValue(), passOptions, cm));
} }
function updateLinting(cm, annotationsNotSorted) { function updateLinting(cm, annotationsNotSorted) {
@ -187,7 +187,8 @@
CodeMirror.defineOption("lint", false, function(cm, val, old) { CodeMirror.defineOption("lint", false, function(cm, val, old) {
if (old && old != CodeMirror.Init) { if (old && old != CodeMirror.Init) {
clearMarks(cm); clearMarks(cm);
cm.off("change", onChange); if (!state.options.lintOnChange !== false)
cm.off("change", onChange);
CodeMirror.off(cm.getWrapperElement(), "mouseover", cm.state.lint.onMouseOver); CodeMirror.off(cm.getWrapperElement(), "mouseover", cm.state.lint.onMouseOver);
clearTimeout(cm.state.lint.timeout); clearTimeout(cm.state.lint.timeout);
delete cm.state.lint; delete cm.state.lint;
@ -197,11 +198,16 @@
var gutters = cm.getOption("gutters"), hasLintGutter = false; var gutters = cm.getOption("gutters"), hasLintGutter = false;
for (var i = 0; i < gutters.length; ++i) if (gutters[i] == GUTTER_ID) hasLintGutter = true; for (var i = 0; i < gutters.length; ++i) if (gutters[i] == GUTTER_ID) hasLintGutter = true;
var state = cm.state.lint = new LintState(cm, parseOptions(cm, val), hasLintGutter); var state = cm.state.lint = new LintState(cm, parseOptions(cm, val), hasLintGutter);
cm.on("change", onChange); if (!state.options.lintOnChange !== false)
cm.on("change", onChange);
if (state.options.tooltips != false) if (state.options.tooltips != false)
CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver); CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver);
startLinting(cm); state.timeout = setTimeout(function(){startLinting(cm);}, state.options.delay || 500);
} }
}); });
CodeMirror.defineExtension("performLint", function() {
if (this.state.lint) startLinting(this);
});
}); });

View File

@ -18,6 +18,7 @@
mod(CodeMirror); mod(CodeMirror);
})(function(CodeMirror) { })(function(CodeMirror) {
"use strict"; "use strict";
function searchOverlay(query, caseInsensitive) { function searchOverlay(query, caseInsensitive) {
if (typeof query == "string") if (typeof query == "string")
query = new RegExp(query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), caseInsensitive ? "gi" : "g"); query = new RegExp(query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), caseInsensitive ? "gi" : "g");
@ -42,24 +43,39 @@
this.posFrom = this.posTo = this.lastQuery = this.query = null; this.posFrom = this.posTo = this.lastQuery = this.query = null;
this.overlay = null; this.overlay = null;
} }
function getSearchState(cm) { function getSearchState(cm) {
return cm.state.search || (cm.state.search = new SearchState()); return cm.state.search || (cm.state.search = new SearchState());
} }
function queryCaseInsensitive(query) { function queryCaseInsensitive(query) {
return typeof query == "string" && query == query.toLowerCase(); return typeof query == "string" && query == query.toLowerCase();
} }
function getSearchCursor(cm, query, pos) { function getSearchCursor(cm, query, pos) {
// Heuristic: if the query string is all lowercase, do a case insensitive search. // Heuristic: if the query string is all lowercase, do a case insensitive search.
return cm.getSearchCursor(query, pos, queryCaseInsensitive(query)); return cm.getSearchCursor(query, pos, queryCaseInsensitive(query));
} }
function persistentDialog(cm, text, deflt, f) {
cm.openDialog(text, f, {
value: deflt,
selectValueOnOpen: true,
closeOnEnter: false,
onClose: function() { clearSearch(cm); }
});
}
function dialog(cm, text, shortText, deflt, f) { function dialog(cm, text, shortText, deflt, f) {
if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true}); if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true});
else f(prompt(shortText, deflt)); else f(prompt(shortText, deflt));
} }
function confirmDialog(cm, text, shortText, fs) { function confirmDialog(cm, text, shortText, fs) {
if (cm.openConfirm) cm.openConfirm(text, fs); if (cm.openConfirm) cm.openConfirm(text, fs);
else if (confirm(shortText)) fs[0](); else if (confirm(shortText)) fs[0]();
} }
function parseQuery(query) { function parseQuery(query) {
var isRE = query.match(/^\/(.*)\/([a-z]*)$/); var isRE = query.match(/^\/(.*)\/([a-z]*)$/);
if (isRE) { if (isRE) {
@ -70,28 +86,44 @@
query = /x^/; query = /x^/;
return query; return query;
} }
var queryDialog = var queryDialog =
'Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>'; 'Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>';
function doSearch(cm, rev) {
function startSearch(cm, state, query) {
state.queryText = query;
state.query = parseQuery(query);
cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query));
state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query));
cm.addOverlay(state.overlay);
if (cm.showMatchesOnScrollbar) {
if (state.annotate) { state.annotate.clear(); state.annotate = null; }
state.annotate = cm.showMatchesOnScrollbar(state.query, queryCaseInsensitive(state.query));
}
}
function doSearch(cm, rev, persistent) {
var state = getSearchState(cm); var state = getSearchState(cm);
if (state.query) return findNext(cm, rev); if (state.query) return findNext(cm, rev);
var q = cm.getSelection() || state.lastQuery; var q = cm.getSelection() || state.lastQuery;
dialog(cm, queryDialog, "Search for:", q, function(query) { if (persistent && cm.openDialog) {
cm.operation(function() { persistentDialog(cm, queryDialog, q, function(query, event) {
if (!query || state.query) return; CodeMirror.e_stop(event);
state.query = parseQuery(query); if (!query) return;
cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query)); if (query != state.queryText) startSearch(cm, state, query);
state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query)); findNext(cm, event.shiftKey);
cm.addOverlay(state.overlay);
if (cm.showMatchesOnScrollbar) {
if (state.annotate) { state.annotate.clear(); state.annotate = null; }
state.annotate = cm.showMatchesOnScrollbar(state.query, queryCaseInsensitive(state.query));
}
state.posFrom = state.posTo = cm.getCursor();
findNext(cm, rev);
}); });
}); } else {
dialog(cm, queryDialog, "Search for:", q, function(query) {
if (query && !state.query) cm.operation(function() {
startSearch(cm, state, query);
state.posFrom = state.posTo = cm.getCursor();
findNext(cm, rev);
});
});
}
} }
function findNext(cm, rev) {cm.operation(function() { function findNext(cm, rev) {cm.operation(function() {
var state = getSearchState(cm); var state = getSearchState(cm);
var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo); var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo);
@ -100,14 +132,15 @@
if (!cursor.find(rev)) return; if (!cursor.find(rev)) return;
} }
cm.setSelection(cursor.from(), cursor.to()); cm.setSelection(cursor.from(), cursor.to());
cm.scrollIntoView({from: cursor.from(), to: cursor.to()}); cm.scrollIntoView({from: cursor.from(), to: cursor.to()}, 20);
state.posFrom = cursor.from(); state.posTo = cursor.to(); state.posFrom = cursor.from(); state.posTo = cursor.to();
});} });}
function clearSearch(cm) {cm.operation(function() { function clearSearch(cm) {cm.operation(function() {
var state = getSearchState(cm); var state = getSearchState(cm);
state.lastQuery = state.query; state.lastQuery = state.query;
if (!state.query) return; if (!state.query) return;
state.query = null; state.query = state.queryText = null;
cm.removeOverlay(state.overlay); cm.removeOverlay(state.overlay);
if (state.annotate) { state.annotate.clear(); state.annotate = null; } if (state.annotate) { state.annotate.clear(); state.annotate = null; }
});} });}
@ -116,6 +149,7 @@
'Replace: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>'; 'Replace: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>';
var replacementQueryDialog = 'With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>'; var replacementQueryDialog = 'With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>';
var doReplaceConfirm = "Replace? <button>Yes</button> <button>No</button> <button>Stop</button>"; var doReplaceConfirm = "Replace? <button>Yes</button> <button>No</button> <button>Stop</button>";
function replace(cm, all) { function replace(cm, all) {
if (cm.getOption("readOnly")) return; if (cm.getOption("readOnly")) return;
var query = cm.getSelection() || getSearchState(cm).lastQuery; var query = cm.getSelection() || getSearchState(cm).lastQuery;
@ -159,6 +193,7 @@
} }
CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);}; CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);};
CodeMirror.commands.findPersistent = function(cm) {clearSearch(cm); doSearch(cm, false, true);};
CodeMirror.commands.findNext = doSearch; CodeMirror.commands.findNext = doSearch;
CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);}; CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);};
CodeMirror.commands.clearSearch = clearSearch; CodeMirror.commands.clearSearch = clearSearch;

View File

@ -177,9 +177,9 @@
}); });
CodeMirror.defineExtension("selectMatches", function(query, caseFold) { CodeMirror.defineExtension("selectMatches", function(query, caseFold) {
var ranges = [], next; var ranges = [];
var cur = this.getSearchCursor(query, this.getCursor("from"), caseFold); var cur = this.getSearchCursor(query, this.getCursor("from"), caseFold);
while (next = cur.findNext()) { while (cur.findNext()) {
if (CodeMirror.cmpPos(cur.to(), this.getCursor("to")) > 0) break; if (CodeMirror.cmpPos(cur.to(), this.getCursor("to")) > 0) break;
ranges.push({anchor: cur.from(), head: cur.to()}); ranges.push({anchor: cur.from(), head: cur.to()});
} }

View File

@ -1,6 +0,0 @@
# Combine existing list of authors with everyone known in git, sort, add header.
tail --lines=+3 AUTHORS > AUTHORS.tmp
git log --format='%aN' >> AUTHORS.tmp
echo -e "List of CodeMirror contributors. Updated before every release.\n" > AUTHORS
sort -u AUTHORS.tmp >> AUTHORS
rm -f AUTHORS.tmp

View File

@ -1,92 +0,0 @@
#!/usr/bin/env node
// Compression helper for CodeMirror
//
// Example:
//
// bin/compress codemirror runmode javascript xml
//
// Will take lib/codemirror.js, addon/runmode/runmode.js,
// mode/javascript/javascript.js, and mode/xml/xml.js, run them though
// the online minifier at http://marijnhaverbeke.nl/uglifyjs, and spit
// out the result.
//
// bin/compress codemirror --local /path/to/bin/UglifyJS
//
// Will use a local minifier instead of the online default one.
//
// Script files are specified without .js ending. Prefixing them with
// their full (local) path is optional. So you may say lib/codemirror
// or mode/xml/xml to be more precise. In fact, even the .js suffix
// may be speficied, if wanted.
"use strict";
var fs = require("fs");
function help(ok) {
console.log("usage: " + process.argv[1] + " [--local /path/to/uglifyjs] files...");
process.exit(ok ? 0 : 1);
}
var local = null, args = [], extraArgs = null, files = [], blob = "";
for (var i = 2; i < process.argv.length; ++i) {
var arg = process.argv[i];
if (arg == "--local" && i + 1 < process.argv.length) {
var parts = process.argv[++i].split(/\s+/);
local = parts[0];
extraArgs = parts.slice(1);
if (!extraArgs.length) extraArgs = ["-c", "-m"];
} else if (arg == "--help") {
help(true);
} else if (arg[0] != "-") {
files.push({name: arg, re: new RegExp("(?:\\/|^)" + arg + (/\.js$/.test(arg) ? "$" : "\\.js$"))});
} else help(false);
}
function walk(dir) {
fs.readdirSync(dir).forEach(function(fname) {
if (/^[_\.]/.test(fname)) return;
var file = dir + fname;
if (fs.statSync(file).isDirectory()) return walk(file + "/");
if (files.some(function(spec, i) {
var match = spec.re.test(file);
if (match) files.splice(i, 1);
return match;
})) {
if (local) args.push(file);
else blob += fs.readFileSync(file, "utf8");
}
});
}
walk("lib/");
walk("addon/");
walk("mode/");
if (!local && !blob) help(false);
if (files.length) {
console.log("Some speficied files were not found: " +
files.map(function(a){return a.name;}).join(", "));
process.exit(1);
}
if (local) {
require("child_process").spawn(local, args.concat(extraArgs), {stdio: ["ignore", process.stdout, process.stderr]});
} else {
var data = new Buffer("js_code=" + require("querystring").escape(blob), "utf8");
var req = require("http").request({
host: "marijnhaverbeke.nl",
port: 80,
method: "POST",
path: "/uglifyjs",
headers: {"content-type": "application/x-www-form-urlencoded",
"content-length": data.length}
});
req.on("response", function(resp) {
resp.on("data", function (chunk) { process.stdout.write(chunk); });
});
req.end(data);
}

View File

@ -1,3 +0,0 @@
#!/usr/bin/env node
process.exit(require("../test/lint").ok ? 0 : 1);

View File

@ -1,46 +0,0 @@
#!/usr/bin/env node
var fs = require("fs"), child = require("child_process");
var number, bumpOnly;
for (var i = 2; i < process.argv.length; i++) {
if (process.argv[i] == "-bump") bumpOnly = true;
else if (/^\d+\.\d+\.\d+$/.test(process.argv[i])) number = process.argv[i];
else { console.log("Bogus command line arg: " + process.argv[i]); process.exit(1); }
}
if (!number) { console.log("Must give a version"); process.exit(1); }
function rewrite(file, f) {
fs.writeFileSync(file, f(fs.readFileSync(file, "utf8")), "utf8");
}
rewrite("lib/codemirror.js", function(lib) {
return lib.replace(/CodeMirror\.version = "\d+\.\d+\.\d+"/,
"CodeMirror.version = \"" + number + "\"");
});
function rewriteJSON(pack) {
return pack.replace(/"version":"\d+\.\d+\.\d+"/, "\"version\":\"" + number + "\"");
}
rewrite("package.json", rewriteJSON);
rewrite("bower.json", rewriteJSON);
rewrite("doc/manual.html", function(manual) {
return manual.replace(/>version \d+\.\d+\.\d+<\/span>/, ">version " + number + "</span>");
});
if (bumpOnly) process.exit(0);
child.exec("bash bin/authors.sh", function(){});
var simple = number.slice(0, number.lastIndexOf("."));
rewrite("doc/compress.html", function(cmp) {
return cmp.replace(/<option value="http:\/\/codemirror.net\/">HEAD<\/option>/,
"<option value=\"http://codemirror.net/\">HEAD</option>\n <option value=\"http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=" + number + ";f=\">" + simple + "</option>");
});
rewrite("index.html", function(index) {
return index.replace(/\.zip">\d+\.\d+<\/a>/,
".zip\">" + simple + "</a>");
});

View File

@ -1,51 +0,0 @@
#!/usr/bin/env node
// Simple command-line code highlighting tool. Reads code from stdin,
// spits html to stdout. For example:
//
// echo 'function foo(a) { return a; }' | bin/source-highlight -s javascript
// bin/source-highlight -s
var fs = require("fs");
var CodeMirror = require("../addon/runmode/runmode.node.js");
require("../mode/meta.js");
var sPos = process.argv.indexOf("-s");
if (sPos == -1 || sPos == process.argv.length - 1) {
console.error("Usage: source-highlight -s language");
process.exit(1);
}
var lang = process.argv[sPos + 1].toLowerCase(), modeName = lang;
CodeMirror.modeInfo.forEach(function(info) {
if (info.mime == lang) {
modeName = info.mode;
} else if (info.name.toLowerCase() == lang) {
modeName = info.mode;
lang = info.mime;
}
});
if (!CodeMirror.modes[modeName])
require("../mode/" + modeName + "/" + modeName + ".js");
function esc(str) {
return str.replace(/[<&]/g, function(ch) { return ch == "&" ? "&amp;" : "&lt;"; });
}
var code = fs.readFileSync("/dev/stdin", "utf8");
var curStyle = null, accum = "";
function flush() {
if (curStyle) process.stdout.write("<span class=\"" + curStyle.replace(/(^|\s+)/g, "$1cm-") + "\">" + esc(accum) + "</span>");
else process.stdout.write(esc(accum));
}
CodeMirror.runMode(code, lang, function(text, style) {
if (style != curStyle) {
flush();
curStyle = style; accum = text;
} else {
accum += text;
}
});
flush();

View File

@ -1,18 +0,0 @@
{
"name": "codemirror",
"version":"5.2.1",
"main": ["lib/codemirror.js", "lib/codemirror.css"],
"ignore": [
"**/.*",
"node_modules",
"components",
"bin",
"demo",
"doc",
"test",
"index.html",
"package.json",
"mode/*/*test.js",
"mode/*/*.html"
]
}

View File

@ -1,196 +0,0 @@
<!doctype html>
<title>CodeMirror</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="lib/codemirror.css">
<link rel=stylesheet href="doc/docs.css">
<script src="lib/codemirror.js"></script>
<script src="mode/xml/xml.js"></script>
<script src="mode/javascript/javascript.js"></script>
<script src="mode/css/css.js"></script>
<script src="mode/htmlmixed/htmlmixed.js"></script>
<script src="addon/edit/matchbrackets.js"></script>
<script src="doc/activebookmark.js"></script>
<style>
.CodeMirror { height: auto; border: 1px solid #ddd; }
.CodeMirror-scroll { max-height: 200px; }
.CodeMirror pre { padding-left: 7px; line-height: 1.25; }
</style>
<div id=nav>
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="doc/logo.png"></a>
<ul>
<li><a class=active data-default="true" href="#description">Home</a>
<li><a href="doc/manual.html">Manual</a>
<li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul>
<ul>
<li><a href="#features">Features</a>
<li><a href="#community">Community</a>
<li><a href="#browsersupport">Browser support</a>
</ul>
</div>
<article>
<section id=description class=first>
<p><strong>CodeMirror</strong> is a versatile text editor
implemented in JavaScript for the browser. It is specialized for
editing code, and comes with a number of <a href="mode/index.html">language modes</a> and <a href="doc/manual.html#addons">addons</a>
that implement more advanced editing functionality.</p>
<p>A rich <a href="doc/manual.html#api">programming API</a> and a
CSS <a href="doc/manual.html#styling">theming</a> system are
available for customizing CodeMirror to fit your application, and
extending it with new functionality.</p>
</section>
<section id=demo>
<h2>This is CodeMirror</h2>
<form style="position: relative; margin-top: .5em;"><textarea id=demotext>
<!-- Create a simple CodeMirror instance -->
<link rel="stylesheet" href="lib/codemirror.css">
<script src="lib/codemirror.js"></script>
<script>
var editor = CodeMirror.fromTextArea(myTextarea, {
lineNumbers: true
});
</script></textarea>
<select id="demolist" onchange="document.location = this.options[this.selectedIndex].value;">
<option value="#">Other demos...</option>
<option value="demo/complete.html">Autocompletion</option>
<option value="demo/folding.html">Code folding</option>
<option value="demo/theme.html">Themes</option>
<option value="mode/htmlmixed/index.html">Mixed language modes</option>
<option value="demo/bidi.html">Bi-directional text</option>
<option value="demo/variableheight.html">Variable font sizes</option>
<option value="demo/search.html">Search interface</option>
<option value="demo/vim.html">Vim bindings</option>
<option value="demo/emacs.html">Emacs bindings</option>
<option value="demo/sublime.html">Sublime Text bindings</option>
<option value="demo/tern.html">Tern integration</option>
<option value="demo/merge.html">Merge/diff interface</option>
<option value="demo/fullscreen.html">Full-screen editor</option>
<option value="demo/simplescrollbars.html">Custom scrollbars</option>
</select></form>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("demotext"), {
lineNumbers: true,
mode: "text/html",
matchBrackets: true
});
</script>
<div class=actions>
<div class=actionspicture>
<img src="doc/yinyang.png" class=yinyang>
<div class="actionlink download">
<a href="http://codemirror.net/codemirror.zip">DOWNLOAD</a>
</div>
<div class="actionlink fund">
<a href="https://marijnhaverbeke.nl/fund/">FUND</a>
</div>
</div>
<div class=actionsleft>
Get the current version: <a href="http://codemirror.net/codemirror.zip">5.2</a>.<br>
You can see the <a href="https://github.com/codemirror/codemirror" title="Github repository">code</a> or<br>
read the <a href="doc/releases.html">release notes</a>.<br>
There is a <a href="doc/compress.html">minification helper</a>.
</div>
<div class=actionsright>
Software needs maintenance,<br>
maintainers need to subsist.<br>
Current funding status = <img src="https://marijnhaverbeke.nl/fund/status_s.png" title="Current maintainer happiness" style="vertical-align: middle; height: 16px; width: 16px"><br>
You can help <a href="https://marijnhaverbeke.nl/fund/" title="Set up a monthly contribution">per month</a> or
<a title="Donate with Paypal" href="javascript:document.getElementById('paypal').submit();">once</a>.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="paypal">
<input type="hidden" name="cmd" value="_s-xclick"/>
<input type="hidden" name="hosted_button_id" value="3FVHS5FGUY7CC"/>
</form>
</div>
</div>
</section>
<section id=features>
<h2>Features</h2>
<ul>
<li>Support for <a href="mode/index.html">over 100 languages</a> out of the box
<li>A powerful, <a href="mode/htmlmixed/index.html">composable</a> language mode <a href="doc/manual.html#modeapi">system</a>
<li><a href="doc/manual.html#addon_show-hint">Autocompletion</a> (<a href="demo/xmlcomplete.html">XML</a>)
<li><a href="doc/manual.html#addon_foldcode">Code folding</a>
<li><a href="doc/manual.html#option_extraKeys">Configurable</a> keybindings
<li><a href="demo/vim.html">Vim</a>, <a href="demo/emacs.html">Emacs</a>, and <a href="demo/sublime.html">Sublime Text</a> bindings
<li><a href="doc/manual.html#addon_search">Search and replace</a> interface
<li><a href="doc/manual.html#addon_matchbrackets">Bracket</a> and <a href="doc/manual.html#addon_matchtags">tag</a> matching
<li>Support for <a href="demo/buffers.html">split views</a>
<li><a href="doc/manual.html#addon_lint">Linter integration</a>
<li><a href="demo/variableheight.html">Mixing font sizes and styles</a>
<li><a href="demo/theme.html">Various themes</a>
<li>Able to <a href="demo/resize.html">resize to fit content</a>
<li><a href="doc/manual.html#mark_replacedWith">Inline</a> and <a href="doc/manual.html#addLineWidget">block</a> widgets
<li>Programmable <a href="demo/marker.html">gutters</a>
<li>Making ranges of text <a href="doc/manual.html#markText">styled, read-only, or atomic</a>
<li><a href="demo/bidi.html">Bi-directional text</a> support
<li>Many other <a href="doc/manual.html#api">methods</a> and <a href="doc/manual.html#addons">addons</a>...
</ul>
</section>
<section id=community>
<h2>Community</h2>
<p>CodeMirror is an open-source project shared under
an <a href="LICENSE">MIT license</a>. It is the editor used in the
dev tools for
both <a href="https://hacks.mozilla.org/2013/11/firefox-developer-tools-episode-27-edit-as-html-codemirror-more/">Firefox</a>
and <a href="https://developers.google.com/chrome-developer-tools/">Chrome</a>, <a href="http://www.lighttable.com/">Light
Table</a>, <a href="http://brackets.io/">Adobe
Brackets</a>, <a href="http://blog.bitbucket.org/2013/05/14/edit-your-code-in-the-cloud-with-bitbucket/">Bitbucket</a>,
and <a href="doc/realworld.html">many other projects</a>.</p>
<p>Development and bug tracking happens
on <a href="https://github.com/codemirror/CodeMirror/">github</a>
(<a href="http://marijnhaverbeke.nl/git/codemirror">alternate git
repository</a>).
Please <a href="http://codemirror.net/doc/reporting.html">read these
pointers</a> before submitting a bug. Use pull requests to submit
patches. All contributions must be released under the same MIT
license that CodeMirror uses.</p>
<p>Discussion around the project is done on
a <a href="http://discuss.codemirror.net">discussion forum</a>.
There is also
the <a href="http://groups.google.com/group/codemirror-announce">codemirror-announce</a>
list, which is only used for major announcements (such as new
versions). If needed, you can
contact <a href="mailto:marijnh@gmail.com">the maintainer</a>
directly.</p>
<p>A list of CodeMirror-related software that is not part of the
main distribution is maintained
on <a href="https://github.com/codemirror/CodeMirror/wiki/CodeMirror-addons">our
wiki</a>. Feel free to add your project.</p>
</section>
<section id=browsersupport>
<h2>Browser support</h2>
<p>The <em>desktop</em> versions of the following browsers,
in <em>standards mode</em> (HTML5 <code>&lt;!doctype html></code>
recommended) are supported:</p>
<table style="margin-bottom: 1em">
<tr><th>Firefox</th><td>version 4 and up</td></tr>
<tr><th>Chrome</th><td>any version</td></tr>
<tr><th>Safari</th><td>version 5.2 and up</td></tr>
<tr><th style="padding-right: 1em;">Internet Explorer</th><td>version 8 and up</td></tr>
<tr><th>Opera</th><td>version 9 and up</td></tr>
</table>
<p>Support for modern mobile browsers is experimental. Recent
versions of the iOS browser and Chrome on Android should work
pretty well.</p>
</section>
</article>

View File

@ -377,7 +377,7 @@
getInput(cm, "Goto line", function(str) { getInput(cm, "Goto line", function(str) {
var num; var num;
if (str && !isNaN(num = Number(str)) && num == num|0 && num > 0) if (str && !isNaN(num = Number(str)) && num == (num|0) && num > 0)
cm.setCursor(num - 1); cm.setCursor(num - 1);
}); });
}, },

View File

@ -55,7 +55,9 @@
cmds[map["Alt-Left"] = "goSubwordLeft"] = function(cm) { moveSubword(cm, -1); }; cmds[map["Alt-Left"] = "goSubwordLeft"] = function(cm) { moveSubword(cm, -1); };
cmds[map["Alt-Right"] = "goSubwordRight"] = function(cm) { moveSubword(cm, 1); }; cmds[map["Alt-Right"] = "goSubwordRight"] = function(cm) { moveSubword(cm, 1); };
cmds[map[ctrl + "Up"] = "scrollLineUp"] = function(cm) { var scrollLineCombo = mac ? "Ctrl-Alt-" : "Ctrl-";
cmds[map[scrollLineCombo + "Up"] = "scrollLineUp"] = function(cm) {
var info = cm.getScrollInfo(); var info = cm.getScrollInfo();
if (!cm.somethingSelected()) { if (!cm.somethingSelected()) {
var visibleBottomLine = cm.lineAtHeight(info.top + info.clientHeight, "local"); var visibleBottomLine = cm.lineAtHeight(info.top + info.clientHeight, "local");
@ -64,7 +66,7 @@
} }
cm.scrollTo(null, info.top - cm.defaultTextHeight()); cm.scrollTo(null, info.top - cm.defaultTextHeight());
}; };
cmds[map[ctrl + "Down"] = "scrollLineDown"] = function(cm) { cmds[map[scrollLineCombo + "Down"] = "scrollLineDown"] = function(cm) {
var info = cm.getScrollInfo(); var info = cm.getScrollInfo();
if (!cm.somethingSelected()) { if (!cm.somethingSelected()) {
var visibleTopLine = cm.lineAtHeight(info.top, "local")+1; var visibleTopLine = cm.lineAtHeight(info.top, "local")+1;

View File

@ -692,7 +692,9 @@
getOption: getOption, getOption: getOption,
defineOption: defineOption, defineOption: defineOption,
defineEx: function(name, prefix, func){ defineEx: function(name, prefix, func){
if (name.indexOf(prefix) !== 0) { if (!prefix) {
prefix = name;
} else if (name.indexOf(prefix) !== 0) {
throw new Error('(Vim.defineEx) "'+prefix+'" is not a prefix of "'+name+'", command not registered'); throw new Error('(Vim.defineEx) "'+prefix+'" is not a prefix of "'+name+'", command not registered');
} }
exCommands[name]=func; exCommands[name]=func;
@ -849,6 +851,8 @@
mapCommand: mapCommand, mapCommand: mapCommand,
_mapCommand: _mapCommand, _mapCommand: _mapCommand,
defineRegister: defineRegister,
exitVisualMode: exitVisualMode, exitVisualMode: exitVisualMode,
exitInsertMode: exitInsertMode exitInsertMode: exitInsertMode
}; };
@ -938,6 +942,25 @@
} }
}; };
/**
* Defines an external register.
*
* The name should be a single character that will be used to reference the register.
* The register should support setText, pushText, clear, and toString(). See Register
* for a reference implementation.
*/
function defineRegister(name, register) {
var registers = vimGlobalState.registerController.registers[name];
if (!name || name.length != 1) {
throw Error('Register name must be 1 character');
}
if (registers[name]) {
throw Error('Register already defined ' + name);
}
registers[name] = register;
validRegisters.push(name);
}
/* /*
* vim registers allow you to keep many independent copy and paste buffers. * vim registers allow you to keep many independent copy and paste buffers.
* See http://usevim.com/2012/04/13/registers/ for an introduction. * See http://usevim.com/2012/04/13/registers/ for an introduction.
@ -3638,13 +3661,17 @@
// Translates the replace part of a search and replace from ex (vim) syntax into // Translates the replace part of a search and replace from ex (vim) syntax into
// javascript form. Similar to translateRegex, but additionally fixes back references // javascript form. Similar to translateRegex, but additionally fixes back references
// (translates '\[0..9]' to '$[0..9]') and follows different rules for escaping '$'. // (translates '\[0..9]' to '$[0..9]') and follows different rules for escaping '$'.
var charUnescapes = {'\\n': '\n', '\\r': '\r', '\\t': '\t'};
function translateRegexReplace(str) { function translateRegexReplace(str) {
var escapeNextChar = false; var escapeNextChar = false;
var out = []; var out = [];
for (var i = -1; i < str.length; i++) { for (var i = -1; i < str.length; i++) {
var c = str.charAt(i) || ''; var c = str.charAt(i) || '';
var n = str.charAt(i+1) || ''; var n = str.charAt(i+1) || '';
if (escapeNextChar) { if (charUnescapes[c + n]) {
out.push(charUnescapes[c+n]);
i++;
} else if (escapeNextChar) {
// At any point in the loop, escapeNextChar is true if the previous // At any point in the loop, escapeNextChar is true if the previous
// character was a '\' and was not escaped. // character was a '\' and was not escaped.
out.push(c); out.push(c);
@ -3672,6 +3699,7 @@
} }
// Unescape \ and / in the replace part, for PCRE mode. // Unescape \ and / in the replace part, for PCRE mode.
var unescapes = {'\\/': '/', '\\\\': '\\', '\\n': '\n', '\\r': '\r', '\\t': '\t'};
function unescapeRegexReplace(str) { function unescapeRegexReplace(str) {
var stream = new CodeMirror.StringStream(str); var stream = new CodeMirror.StringStream(str);
var output = []; var output = [];
@ -3680,13 +3708,15 @@
while (stream.peek() && stream.peek() != '\\') { while (stream.peek() && stream.peek() != '\\') {
output.push(stream.next()); output.push(stream.next());
} }
if (stream.match('\\/', true)) { var matched = false;
// \/ => / for (var matcher in unescapes) {
output.push('/'); if (stream.match(matcher, true)) {
} else if (stream.match('\\\\', true)) { matched = true;
// \\ => \ output.push(unescapes[matcher]);
output.push('\\'); break;
} else { }
}
if (!matched) {
// Don't change anything // Don't change anything
output.push(stream.next()); output.push(stream.next());
} }
@ -4278,7 +4308,7 @@
if (decimal + hex + octal > 1) { return 'Invalid arguments'; } if (decimal + hex + octal > 1) { return 'Invalid arguments'; }
number = decimal && 'decimal' || hex && 'hex' || octal && 'octal'; number = decimal && 'decimal' || hex && 'hex' || octal && 'octal';
} }
if (args.eatSpace() && args.match(/\/.*\//)) { 'patterns not supported'; } if (args.match(/\/.*\//)) { return 'patterns not supported'; }
} }
} }
var err = parseArgs(); var err = parseArgs();
@ -4461,6 +4491,9 @@
var query = state.getQuery(); var query = state.getQuery();
var lineStart = (params.line !== undefined) ? params.line : cm.getCursor().line; var lineStart = (params.line !== undefined) ? params.line : cm.getCursor().line;
var lineEnd = params.lineEnd || lineStart; var lineEnd = params.lineEnd || lineStart;
if (lineStart == cm.firstLine() && lineEnd == cm.lastLine()) {
lineEnd = Infinity;
}
if (count) { if (count) {
lineStart = lineEnd; lineStart = lineEnd;
lineEnd = lineStart + count - 1; lineEnd = lineStart + count - 1;
@ -4579,10 +4612,9 @@
searchCursor.replace(newText); searchCursor.replace(newText);
} }
function next() { function next() {
var found;
// The below only loops to skip over multiple occurrences on the same // The below only loops to skip over multiple occurrences on the same
// line when 'global' is not true. // line when 'global' is not true.
while(found = searchCursor.findNext() && while(searchCursor.findNext() &&
isInRange(searchCursor.from(), lineStart, lineEnd)) { isInRange(searchCursor.from(), lineStart, lineEnd)) {
if (!global && lastPos && searchCursor.from().line == lastPos.line) { if (!global && lastPos && searchCursor.from().line == lastPos.line) {
continue; continue;
@ -4715,7 +4747,7 @@
} }
function _mapCommand(command) { function _mapCommand(command) {
defaultKeymap.push(command); defaultKeymap.unshift(command);
} }
function mapCommand(keys, type, name, args, extra) { function mapCommand(keys, type, name, args, extra) {
@ -4757,6 +4789,14 @@
function executeMacroRegister(cm, vim, macroModeState, registerName) { function executeMacroRegister(cm, vim, macroModeState, registerName) {
var register = vimGlobalState.registerController.getRegister(registerName); var register = vimGlobalState.registerController.getRegister(registerName);
if (registerName == ':') {
// Read-only register containing last Ex command.
if (register.keyBuffer[0]) {
exCommandDispatcher.processCommand(cm, register.keyBuffer[0]);
}
macroModeState.isPlaying = false;
return;
}
var keyBuffer = register.keyBuffer; var keyBuffer = register.keyBuffer;
var imc = 0; var imc = 0;
macroModeState.isPlaying = true; macroModeState.isPlaying = true;
@ -4796,7 +4836,7 @@
if (macroModeState.isPlaying) { return; } if (macroModeState.isPlaying) { return; }
var registerName = macroModeState.latestRegister; var registerName = macroModeState.latestRegister;
var register = vimGlobalState.registerController.getRegister(registerName); var register = vimGlobalState.registerController.getRegister(registerName);
if (register) { if (register && register.pushInsertModeChanges) {
register.pushInsertModeChanges(macroModeState.lastInsertModeChanges); register.pushInsertModeChanges(macroModeState.lastInsertModeChanges);
} }
} }
@ -4805,7 +4845,7 @@
if (macroModeState.isPlaying) { return; } if (macroModeState.isPlaying) { return; }
var registerName = macroModeState.latestRegister; var registerName = macroModeState.latestRegister;
var register = vimGlobalState.registerController.getRegister(registerName); var register = vimGlobalState.registerController.getRegister(registerName);
if (register) { if (register && register.pushSearchQuery) {
register.pushSearchQuery(query); register.pushSearchQuery(query);
} }
} }

View File

@ -63,21 +63,22 @@
-webkit-animation: blink 1.06s steps(1) infinite; -webkit-animation: blink 1.06s steps(1) infinite;
-moz-animation: blink 1.06s steps(1) infinite; -moz-animation: blink 1.06s steps(1) infinite;
animation: blink 1.06s steps(1) infinite; animation: blink 1.06s steps(1) infinite;
background-color: #7e7;
} }
@-moz-keyframes blink { @-moz-keyframes blink {
0% { background: #7e7; } 0% {}
50% { background: none; } 50% { background-color: transparent; }
100% { background: #7e7; } 100% {}
} }
@-webkit-keyframes blink { @-webkit-keyframes blink {
0% { background: #7e7; } 0% {}
50% { background: none; } 50% { background-color: transparent; }
100% { background: #7e7; } 100% {}
} }
@keyframes blink { @keyframes blink {
0% { background: #7e7; } 0% {}
50% { background: none; } 50% { background-color: transparent; }
100% { background: #7e7; } 100% {}
} }
/* Can style cursor different in overwrite (non-insert) mode */ /* Can style cursor different in overwrite (non-insert) mode */
@ -92,6 +93,15 @@ div.CodeMirror-overwrite div.CodeMirror-cursor {}
/* DEFAULT THEME */ /* DEFAULT THEME */
.cm-s-default .cm-header {color: blue;}
.cm-s-default .cm-quote {color: #090;}
.cm-negative {color: #d44;}
.cm-positive {color: #292;}
.cm-header, .cm-strong {font-weight: bold;}
.cm-em {font-style: italic;}
.cm-link {text-decoration: underline;}
.cm-strikethrough {text-decoration: line-through;}
.cm-s-default .cm-keyword {color: #708;} .cm-s-default .cm-keyword {color: #708;}
.cm-s-default .cm-atom {color: #219;} .cm-s-default .cm-atom {color: #219;}
.cm-s-default .cm-number {color: #164;} .cm-s-default .cm-number {color: #164;}
@ -111,18 +121,9 @@ div.CodeMirror-overwrite div.CodeMirror-cursor {}
.cm-s-default .cm-bracket {color: #997;} .cm-s-default .cm-bracket {color: #997;}
.cm-s-default .cm-tag {color: #170;} .cm-s-default .cm-tag {color: #170;}
.cm-s-default .cm-attribute {color: #00c;} .cm-s-default .cm-attribute {color: #00c;}
.cm-s-default .cm-header {color: blue;}
.cm-s-default .cm-quote {color: #090;}
.cm-s-default .cm-hr {color: #999;} .cm-s-default .cm-hr {color: #999;}
.cm-s-default .cm-link {color: #00c;} .cm-s-default .cm-link {color: #00c;}
.cm-negative {color: #d44;}
.cm-positive {color: #292;}
.cm-header, .cm-strong {font-weight: bold;}
.cm-em {font-style: italic;}
.cm-link {text-decoration: underline;}
.cm-strikethrough {text-decoration: line-through;}
.cm-s-default .cm-error {color: #f00;} .cm-s-default .cm-error {color: #f00;}
.cm-invalidchar {color: #f00;} .cm-invalidchar {color: #f00;}
@ -202,7 +203,13 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
.CodeMirror-gutter-wrapper { .CodeMirror-gutter-wrapper {
position: absolute; position: absolute;
z-index: 4; z-index: 4;
height: 100%; background: none !important;
border: none !important;
}
.CodeMirror-gutter-background {
position: absolute;
top: 0; bottom: 0;
z-index: 4;
} }
.CodeMirror-gutter-elt { .CodeMirror-gutter-elt {
position: absolute; position: absolute;
@ -297,8 +304,8 @@ div.CodeMirror-cursors {
.CodeMirror-selected { background: #d9d9d9; } .CodeMirror-selected { background: #d9d9d9; }
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
.CodeMirror-crosshair { cursor: crosshair; } .CodeMirror-crosshair { cursor: crosshair; }
.CodeMirror ::selection { background: #d7d4f0; } .CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
.CodeMirror ::-moz-selection { background: #d7d4f0; } .CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }
.cm-searching { .cm-searching {
background: #ffa; background: #ffa;

View File

@ -65,7 +65,7 @@
setGuttersForLineNumbers(options); setGuttersForLineNumbers(options);
var doc = options.value; var doc = options.value;
if (typeof doc == "string") doc = new Doc(doc, options.mode); if (typeof doc == "string") doc = new Doc(doc, options.mode, null, options.lineSeparator);
this.doc = doc; this.doc = doc;
var input = new CodeMirror.inputStyles[options.inputStyle](this); var input = new CodeMirror.inputStyles[options.inputStyle](this);
@ -318,7 +318,7 @@
} }
} }
gutters.style.display = i ? "" : "none"; gutters.style.display = i ? "" : "none";
updateGutterSpace(cm); setTimeout(updateGutterSpace.bind(null, cm), 0);
} }
function updateGutterSpace(cm) { function updateGutterSpace(cm) {
@ -714,7 +714,7 @@
// width and height. // width and height.
removeChildren(display.cursorDiv); removeChildren(display.cursorDiv);
removeChildren(display.selectionDiv); removeChildren(display.selectionDiv);
display.gutters.style.height = 0; display.gutters.style.height = display.sizer.style.minHeight = 0;
if (different) { if (different) {
display.lastWrapHeight = update.wrapperHeight; display.lastWrapHeight = update.wrapperHeight;
@ -728,12 +728,9 @@
} }
function postUpdateDisplay(cm, update) { function postUpdateDisplay(cm, update) {
var force = update.force, viewport = update.viewport; var viewport = update.viewport;
for (var first = true;; first = false) { for (var first = true;; first = false) {
if (first && cm.options.lineWrapping && update.oldDisplayWidth != displayWidth(cm)) { if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {
force = true;
} else {
force = false;
// Clip forced viewport to actual scrollable area. // Clip forced viewport to actual scrollable area.
if (viewport && viewport.top != null) if (viewport && viewport.top != null)
viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)};
@ -958,12 +955,22 @@
lineView.node.removeChild(lineView.gutter); lineView.node.removeChild(lineView.gutter);
lineView.gutter = null; lineView.gutter = null;
} }
if (lineView.gutterBackground) {
lineView.node.removeChild(lineView.gutterBackground);
lineView.gutterBackground = null;
}
if (lineView.line.gutterClass) {
var wrap = ensureLineWrapped(lineView);
lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass,
"left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) +
"px; width: " + dims.gutterTotalWidth + "px");
wrap.insertBefore(lineView.gutterBackground, lineView.text);
}
var markers = lineView.line.gutterMarkers; var markers = lineView.line.gutterMarkers;
if (cm.options.lineNumbers || markers) { if (cm.options.lineNumbers || markers) {
var wrap = ensureLineWrapped(lineView); var wrap = ensureLineWrapped(lineView);
var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", "left: " + var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", "left: " +
(cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px");
"px; width: " + dims.gutterTotalWidth + "px");
cm.display.input.setUneditable(gutterWrap); cm.display.input.setUneditable(gutterWrap);
wrap.insertBefore(gutterWrap, lineView.text); wrap.insertBefore(gutterWrap, lineView.text);
if (lineView.line.gutterClass) if (lineView.line.gutterClass)
@ -1084,13 +1091,19 @@
cm.display.shift = false; cm.display.shift = false;
if (!sel) sel = doc.sel; if (!sel) sel = doc.sel;
var textLines = splitLines(inserted), multiPaste = null; var paste = cm.state.pasteIncoming || origin == "paste";
var textLines = doc.splitLines(inserted), multiPaste = null;
// When pasing N lines into N selections, insert one line per selection // When pasing N lines into N selections, insert one line per selection
if (cm.state.pasteIncoming && sel.ranges.length > 1) { if (paste && sel.ranges.length > 1) {
if (lastCopied && lastCopied.join("\n") == inserted) if (lastCopied && lastCopied.join("\n") == inserted) {
multiPaste = sel.ranges.length % lastCopied.length == 0 && map(lastCopied, splitLines); if (sel.ranges.length % lastCopied.length == 0) {
else if (textLines.length == sel.ranges.length) multiPaste = [];
for (var i = 0; i < lastCopied.length; i++)
multiPaste.push(doc.splitLines(lastCopied[i]));
}
} else if (textLines.length == sel.ranges.length) {
multiPaste = map(textLines, function(l) { return [l]; }); multiPaste = map(textLines, function(l) { return [l]; });
}
} }
// Normal behavior is to insert the new text into every selection // Normal behavior is to insert the new text into every selection
@ -1100,40 +1113,58 @@
if (range.empty()) { if (range.empty()) {
if (deleted && deleted > 0) // Handle deletion if (deleted && deleted > 0) // Handle deletion
from = Pos(from.line, from.ch - deleted); from = Pos(from.line, from.ch - deleted);
else if (cm.state.overwrite && !cm.state.pasteIncoming) // Handle overwrite else if (cm.state.overwrite && !paste) // Handle overwrite
to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length));
} }
var updateInput = cm.curOp.updateInput; var updateInput = cm.curOp.updateInput;
var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines, var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines,
origin: origin || (cm.state.pasteIncoming ? "paste" : cm.state.cutIncoming ? "cut" : "+input")}; origin: origin || (paste ? "paste" : cm.state.cutIncoming ? "cut" : "+input")};
makeChange(cm.doc, changeEvent); makeChange(cm.doc, changeEvent);
signalLater(cm, "inputRead", cm, changeEvent); signalLater(cm, "inputRead", cm, changeEvent);
// When an 'electric' character is inserted, immediately trigger a reindent
if (inserted && !cm.state.pasteIncoming && cm.options.electricChars &&
cm.options.smartIndent && range.head.ch < 100 &&
(!i || sel.ranges[i - 1].head.line != range.head.line)) {
var mode = cm.getModeAt(range.head);
var end = changeEnd(changeEvent);
var indented = false;
if (mode.electricChars) {
for (var j = 0; j < mode.electricChars.length; j++)
if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {
indented = indentLine(cm, end.line, "smart");
break;
}
} else if (mode.electricInput) {
if (mode.electricInput.test(getLine(doc, end.line).text.slice(0, end.ch)))
indented = indentLine(cm, end.line, "smart");
}
if (indented) signalLater(cm, "electricInput", cm, end.line);
}
} }
if (inserted && !paste)
triggerElectric(cm, inserted);
ensureCursorVisible(cm); ensureCursorVisible(cm);
cm.curOp.updateInput = updateInput; cm.curOp.updateInput = updateInput;
cm.curOp.typing = true; cm.curOp.typing = true;
cm.state.pasteIncoming = cm.state.cutIncoming = false; cm.state.pasteIncoming = cm.state.cutIncoming = false;
} }
function handlePaste(e, cm) {
var pasted = e.clipboardData && e.clipboardData.getData("text/plain");
if (pasted) {
e.preventDefault();
if (!isReadOnly(cm) && !cm.options.disableInput)
runInOp(cm, function() { applyTextInput(cm, pasted, 0, null, "paste"); });
return true;
}
}
function triggerElectric(cm, inserted) {
// When an 'electric' character is inserted, immediately trigger a reindent
if (!cm.options.electricChars || !cm.options.smartIndent) return;
var sel = cm.doc.sel;
for (var i = sel.ranges.length - 1; i >= 0; i--) {
var range = sel.ranges[i];
if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) continue;
var mode = cm.getModeAt(range.head);
var indented = false;
if (mode.electricChars) {
for (var j = 0; j < mode.electricChars.length; j++)
if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {
indented = indentLine(cm, range.head.line, "smart");
break;
}
} else if (mode.electricInput) {
if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))
indented = indentLine(cm, range.head.line, "smart");
}
if (indented) signalLater(cm, "electricInput", cm, range.head.line);
}
}
function copyableRanges(cm) { function copyableRanges(cm) {
var text = [], ranges = []; var text = [], ranges = [];
for (var i = 0; i < cm.doc.sel.ranges.length; i++) { for (var i = 0; i < cm.doc.sel.ranges.length; i++) {
@ -1206,21 +1237,9 @@
input.poll(); input.poll();
}); });
on(te, "paste", function() { on(te, "paste", function(e) {
// Workaround for webkit bug https://bugs.webkit.org/show_bug.cgi?id=90206 if (handlePaste(e, cm)) return true;
// Add a char to the end of textarea before paste occur so that
// selection doesn't span to the end of textarea.
if (webkit && !cm.state.fakedLastChar && !(new Date - cm.state.lastMiddleDown < 200)) {
var start = te.selectionStart, end = te.selectionEnd;
te.value += "$";
// The selection end needs to be set before the start, otherwise there
// can be an intermediate non-empty selection between the two, which
// can override the middle-click paste buffer on linux and cause the
// wrong thing to get pasted.
te.selectionEnd = end;
te.selectionStart = start;
cm.state.fakedLastChar = true;
}
cm.state.pasteIncoming = true; cm.state.pasteIncoming = true;
input.fastPoll(); input.fastPoll();
}); });
@ -1384,14 +1403,11 @@
// possible when it is clear that nothing happened. hasSelection // possible when it is clear that nothing happened. hasSelection
// will be the case when there is a lot of text in the textarea, // will be the case when there is a lot of text in the textarea,
// in which case reading its value would be expensive. // in which case reading its value would be expensive.
if (!cm.state.focused || (hasSelection(input) && !prevInput) || if (this.contextMenuPending || !cm.state.focused ||
(hasSelection(input) && !prevInput && !this.composing) ||
isReadOnly(cm) || cm.options.disableInput || cm.state.keySeq) isReadOnly(cm) || cm.options.disableInput || cm.state.keySeq)
return false; return false;
// See paste handler for more on the fakedLastChar kludge
if (cm.state.pasteIncoming && cm.state.fakedLastChar) {
input.value = input.value.substring(0, input.value.length - 1);
cm.state.fakedLastChar = false;
}
var text = input.value; var text = input.value;
// If nothing changed, bail. // If nothing changed, bail.
if (text == prevInput && !cm.somethingSelected()) return false; if (text == prevInput && !cm.somethingSelected()) return false;
@ -1537,13 +1553,7 @@
div.contentEditable = "true"; div.contentEditable = "true";
disableBrowserMagic(div); disableBrowserMagic(div);
on(div, "paste", function(e) { on(div, "paste", function(e) { handlePaste(e, cm); })
var pasted = e.clipboardData && e.clipboardData.getData("text/plain");
if (pasted) {
e.preventDefault();
cm.replaceSelection(pasted, null, "paste");
}
});
on(div, "compositionstart", function(e) { on(div, "compositionstart", function(e) {
var data = e.data; var data = e.data;
@ -1756,13 +1766,13 @@
var toIndex = findViewIndex(cm, to.line); var toIndex = findViewIndex(cm, to.line);
if (toIndex == display.view.length - 1) { if (toIndex == display.view.length - 1) {
var toLine = display.viewTo - 1; var toLine = display.viewTo - 1;
var toNode = display.view[toIndex].node; var toNode = display.lineDiv.lastChild;
} else { } else {
var toLine = lineNo(display.view[toIndex + 1].line) - 1; var toLine = lineNo(display.view[toIndex + 1].line) - 1;
var toNode = display.view[toIndex + 1].node.previousSibling; var toNode = display.view[toIndex + 1].node.previousSibling;
} }
var newText = splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine)); var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));
var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length)); var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));
while (newText.length > 1 && oldText.length > 1) { while (newText.length > 1 && oldText.length > 1) {
if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; } if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }
@ -1836,7 +1846,7 @@
var partPos = getBidiPartAt(order, pos.ch); var partPos = getBidiPartAt(order, pos.ch);
side = partPos % 2 ? "right" : "left"; side = partPos % 2 ? "right" : "left";
} }
var result = nodeAndOffsetInLineMap(info.map, pos.ch, "left"); var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);
result.offset = result.collapse == "right" ? result.end : result.start; result.offset = result.collapse == "right" ? result.end : result.start;
return result; return result;
} }
@ -1918,7 +1928,7 @@
} }
function domTextBetween(cm, from, to, fromLine, toLine) { function domTextBetween(cm, from, to, fromLine, toLine) {
var text = "", closing = false; var text = "", closing = false, lineSep = cm.doc.lineSeparator();
function recognizeMarker(id) { return function(marker) { return marker.id == id; }; } function recognizeMarker(id) { return function(marker) { return marker.id == id; }; }
function walk(node) { function walk(node) {
if (node.nodeType == 1) { if (node.nodeType == 1) {
@ -1932,7 +1942,7 @@
if (markerID) { if (markerID) {
var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID)); var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));
if (found.length && (range = found[0].find())) if (found.length && (range = found[0].find()))
text += getBetween(cm.doc, range.from, range.to).join("\n"); text += getBetween(cm.doc, range.from, range.to).join(lineSep);
return; return;
} }
if (node.getAttribute("contenteditable") == "false") return; if (node.getAttribute("contenteditable") == "false") return;
@ -1944,7 +1954,7 @@
var val = node.nodeValue; var val = node.nodeValue;
if (!val) return; if (!val) return;
if (closing) { if (closing) {
text += "\n"; text += lineSep;
closing = false; closing = false;
} }
text += val; text += val;
@ -2551,10 +2561,12 @@
function prepareMeasureForLine(cm, line) { function prepareMeasureForLine(cm, line) {
var lineN = lineNo(line); var lineN = lineNo(line);
var view = findViewForLine(cm, lineN); var view = findViewForLine(cm, lineN);
if (view && !view.text) if (view && !view.text) {
view = null; view = null;
else if (view && view.changes) } else if (view && view.changes) {
updateLineForChanges(cm, view, lineN, getDimensions(cm)); updateLineForChanges(cm, view, lineN, getDimensions(cm));
cm.curOp.forceUpdate = true;
}
if (!view) if (!view)
view = updateExternalMeasurement(cm, line); view = updateExternalMeasurement(cm, line);
@ -2967,12 +2979,12 @@
var callbacks = group.delayedCallbacks, i = 0; var callbacks = group.delayedCallbacks, i = 0;
do { do {
for (; i < callbacks.length; i++) for (; i < callbacks.length; i++)
callbacks[i](); callbacks[i].call(null);
for (var j = 0; j < group.ops.length; j++) { for (var j = 0; j < group.ops.length; j++) {
var op = group.ops[j]; var op = group.ops[j];
if (op.cursorActivityHandlers) if (op.cursorActivityHandlers)
while (op.cursorActivityCalled < op.cursorActivityHandlers.length) while (op.cursorActivityCalled < op.cursorActivityHandlers.length)
op.cursorActivityHandlers[op.cursorActivityCalled++](op.cm); op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm);
} }
} while (i < callbacks.length); } while (i < callbacks.length);
} }
@ -3562,7 +3574,8 @@
var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained; var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained;
if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) &&
type == "single" && (contained = sel.contains(start)) > -1 && type == "single" && (contained = sel.contains(start)) > -1 &&
!sel.ranges[contained].empty()) (cmp((contained = sel.ranges[contained]).from(), start) < 0 || start.xRel > 0) &&
(cmp(contained.to(), start) > 0 || start.xRel < 0))
leftButtonStartDrag(cm, e, start, modifier); leftButtonStartDrag(cm, e, start, modifier);
else else
leftButtonSelect(cm, e, start, type, modifier); leftButtonSelect(cm, e, start, type, modifier);
@ -3790,7 +3803,9 @@
text[i] = reader.result; text[i] = reader.result;
if (++read == n) { if (++read == n) {
pos = clipPos(cm.doc, pos); pos = clipPos(cm.doc, pos);
var change = {from: pos, to: pos, text: splitLines(text.join("\n")), origin: "paste"}; var change = {from: pos, to: pos,
text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),
origin: "paste"};
makeChange(cm.doc, change); makeChange(cm.doc, change);
setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change))); setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)));
} }
@ -4473,7 +4488,7 @@
function replaceRange(doc, code, from, to, origin) { function replaceRange(doc, code, from, to, origin) {
if (!to) to = from; if (!to) to = from;
if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp; } if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp; }
if (typeof code == "string") code = splitLines(code); if (typeof code == "string") code = doc.splitLines(code);
makeChange(doc, {from: from, to: to, text: code, origin: origin}); makeChange(doc, {from: from, to: to, text: code, origin: origin});
} }
@ -5050,9 +5065,11 @@
execCommand: function(cmd) { execCommand: function(cmd) {
if (commands.hasOwnProperty(cmd)) if (commands.hasOwnProperty(cmd))
return commands[cmd](this); return commands[cmd].call(null, this);
}, },
triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),
findPosH: function(from, amount, unit, visually) { findPosH: function(from, amount, unit, visually) {
var dir = 1; var dir = 1;
if (amount < 0) { dir = -1; amount = -amount; } if (amount < 0) { dir = -1; amount = -amount; }
@ -5266,6 +5283,22 @@
clearCaches(cm); clearCaches(cm);
regChange(cm); regChange(cm);
}, true); }, true);
option("lineSeparator", null, function(cm, val) {
cm.doc.lineSep = val;
if (!val) return;
var newBreaks = [], lineNo = cm.doc.first;
cm.doc.iter(function(line) {
for (var pos = 0;;) {
var found = line.text.indexOf(val, pos);
if (found == -1) break;
pos = found + val.length;
newBreaks.push(Pos(lineNo, found));
}
lineNo++;
});
for (var i = newBreaks.length - 1; i >= 0; i--)
replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length))
});
option("specialChars", /[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g, function(cm, val, old) { option("specialChars", /[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g, function(cm, val, old) {
cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g");
if (old != CodeMirror.Init) cm.refresh(); if (old != CodeMirror.Init) cm.refresh();
@ -5616,7 +5649,8 @@
} else if (cur.line > cm.doc.first) { } else if (cur.line > cm.doc.first) {
var prev = getLine(cm.doc, cur.line - 1).text; var prev = getLine(cm.doc, cur.line - 1).text;
if (prev) if (prev)
cm.replaceRange(line.charAt(0) + "\n" + prev.charAt(prev.length - 1), cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +
prev.charAt(prev.length - 1),
Pos(cur.line - 1, prev.length - 1), Pos(cur.line, 1), "+transpose"); Pos(cur.line - 1, prev.length - 1), Pos(cur.line, 1), "+transpose");
} }
} }
@ -5630,7 +5664,7 @@
var len = cm.listSelections().length; var len = cm.listSelections().length;
for (var i = 0; i < len; i++) { for (var i = 0; i < len; i++) {
var range = cm.listSelections()[i]; var range = cm.listSelections()[i];
cm.replaceRange("\n", range.anchor, range.head, "+input"); cm.replaceRange(cm.doc.lineSeparator(), range.anchor, range.head, "+input");
cm.indentLine(range.from().line + 1, null, true); cm.indentLine(range.from().line + 1, null, true);
ensureCursorVisible(cm); ensureCursorVisible(cm);
} }
@ -6794,7 +6828,7 @@
// is needed on Webkit to be able to get line-level bounding // is needed on Webkit to be able to get line-level bounding
// rectangles for it (in measureChar). // rectangles for it (in measureChar).
var content = elt("span", null, null, webkit ? "padding-right: .1px" : null); var content = elt("span", null, null, webkit ? "padding-right: .1px" : null);
var builder = {pre: elt("pre", [content]), content: content, var builder = {pre: elt("pre", [content], "CodeMirror-line"), content: content,
col: 0, pos: 0, cm: cm, col: 0, pos: 0, cm: cm,
splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")}; splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")};
lineView.measure = {}; lineView.measure = {};
@ -6884,6 +6918,10 @@
txt.setAttribute("role", "presentation"); txt.setAttribute("role", "presentation");
txt.setAttribute("cm-text", "\t"); txt.setAttribute("cm-text", "\t");
builder.col += tabWidth; builder.col += tabWidth;
} else if (m[0] == "\r" || m[0] == "\n") {
var txt = content.appendChild(elt("span", m[0] == "\r" ? "␍" : "␤", "cm-invalidchar"));
txt.setAttribute("cm-text", m[0]);
builder.col += 1;
} else { } else {
var txt = builder.cm.options.specialCharPlaceholder(m[0]); var txt = builder.cm.options.specialCharPlaceholder(m[0]);
txt.setAttribute("cm-text", m[0]); txt.setAttribute("cm-text", m[0]);
@ -7229,8 +7267,8 @@
}; };
var nextDocId = 0; var nextDocId = 0;
var Doc = CodeMirror.Doc = function(text, mode, firstLine) { var Doc = CodeMirror.Doc = function(text, mode, firstLine, lineSep) {
if (!(this instanceof Doc)) return new Doc(text, mode, firstLine); if (!(this instanceof Doc)) return new Doc(text, mode, firstLine, lineSep);
if (firstLine == null) firstLine = 0; if (firstLine == null) firstLine = 0;
BranchChunk.call(this, [new LeafChunk([new Line("", null)])]); BranchChunk.call(this, [new LeafChunk([new Line("", null)])]);
@ -7244,8 +7282,9 @@
this.history = new History(null); this.history = new History(null);
this.id = ++nextDocId; this.id = ++nextDocId;
this.modeOption = mode; this.modeOption = mode;
this.lineSep = lineSep;
if (typeof text == "string") text = splitLines(text); if (typeof text == "string") text = this.splitLines(text);
updateDoc(this, {from: start, to: start, text: text}); updateDoc(this, {from: start, to: start, text: text});
setSelection(this, simpleSelection(start), sel_dontScroll); setSelection(this, simpleSelection(start), sel_dontScroll);
}; };
@ -7275,12 +7314,12 @@
getValue: function(lineSep) { getValue: function(lineSep) {
var lines = getLines(this, this.first, this.first + this.size); var lines = getLines(this, this.first, this.first + this.size);
if (lineSep === false) return lines; if (lineSep === false) return lines;
return lines.join(lineSep || "\n"); return lines.join(lineSep || this.lineSeparator());
}, },
setValue: docMethodOp(function(code) { setValue: docMethodOp(function(code) {
var top = Pos(this.first, 0), last = this.first + this.size - 1; var top = Pos(this.first, 0), last = this.first + this.size - 1;
makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length), makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),
text: splitLines(code), origin: "setValue", full: true}, true); text: this.splitLines(code), origin: "setValue", full: true}, true);
setSelection(this, simpleSelection(top)); setSelection(this, simpleSelection(top));
}), }),
replaceRange: function(code, from, to, origin) { replaceRange: function(code, from, to, origin) {
@ -7291,7 +7330,7 @@
getRange: function(from, to, lineSep) { getRange: function(from, to, lineSep) {
var lines = getBetween(this, clipPos(this, from), clipPos(this, to)); var lines = getBetween(this, clipPos(this, from), clipPos(this, to));
if (lineSep === false) return lines; if (lineSep === false) return lines;
return lines.join(lineSep || "\n"); return lines.join(lineSep || this.lineSeparator());
}, },
getLine: function(line) {var l = this.getLineHandle(line); return l && l.text;}, getLine: function(line) {var l = this.getLineHandle(line); return l && l.text;},
@ -7357,13 +7396,13 @@
lines = lines ? lines.concat(sel) : sel; lines = lines ? lines.concat(sel) : sel;
} }
if (lineSep === false) return lines; if (lineSep === false) return lines;
else return lines.join(lineSep || "\n"); else return lines.join(lineSep || this.lineSeparator());
}, },
getSelections: function(lineSep) { getSelections: function(lineSep) {
var parts = [], ranges = this.sel.ranges; var parts = [], ranges = this.sel.ranges;
for (var i = 0; i < ranges.length; i++) { for (var i = 0; i < ranges.length; i++) {
var sel = getBetween(this, ranges[i].from(), ranges[i].to()); var sel = getBetween(this, ranges[i].from(), ranges[i].to());
if (lineSep !== false) sel = sel.join(lineSep || "\n"); if (lineSep !== false) sel = sel.join(lineSep || this.lineSeparator());
parts[i] = sel; parts[i] = sel;
} }
return parts; return parts;
@ -7378,7 +7417,7 @@
var changes = [], sel = this.sel; var changes = [], sel = this.sel;
for (var i = 0; i < sel.ranges.length; i++) { for (var i = 0; i < sel.ranges.length; i++) {
var range = sel.ranges[i]; var range = sel.ranges[i];
changes[i] = {from: range.from(), to: range.to(), text: splitLines(code[i]), origin: origin}; changes[i] = {from: range.from(), to: range.to(), text: this.splitLines(code[i]), origin: origin};
} }
var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse); var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse);
for (var i = changes.length - 1; i >= 0; i--) for (var i = changes.length - 1; i >= 0; i--)
@ -7528,7 +7567,8 @@
}, },
copy: function(copyHistory) { copy: function(copyHistory) {
var doc = new Doc(getLines(this, this.first, this.first + this.size), this.modeOption, this.first); var doc = new Doc(getLines(this, this.first, this.first + this.size),
this.modeOption, this.first, this.lineSep);
doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft; doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;
doc.sel = this.sel; doc.sel = this.sel;
doc.extend = false; doc.extend = false;
@ -7544,7 +7584,7 @@
var from = this.first, to = this.first + this.size; var from = this.first, to = this.first + this.size;
if (options.from != null && options.from > from) from = options.from; if (options.from != null && options.from > from) from = options.from;
if (options.to != null && options.to < to) to = options.to; if (options.to != null && options.to < to) to = options.to;
var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from); var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep);
if (options.sharedHist) copy.history = this.history; if (options.sharedHist) copy.history = this.history;
(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist}); (this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});
copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]; copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];
@ -7573,14 +7613,20 @@
iterLinkedDocs: function(f) {linkedDocs(this, f);}, iterLinkedDocs: function(f) {linkedDocs(this, f);},
getMode: function() {return this.mode;}, getMode: function() {return this.mode;},
getEditor: function() {return this.cm;} getEditor: function() {return this.cm;},
splitLines: function(str) {
if (this.lineSep) return str.split(this.lineSep);
return splitLinesAuto(str);
},
lineSeparator: function() { return this.lineSep || "\n"; }
}); });
// Public alias. // Public alias.
Doc.prototype.eachLine = Doc.prototype.iter; Doc.prototype.eachLine = Doc.prototype.iter;
// Set up methods on CodeMirror's prototype to redirect to the editor's document. // Set up methods on CodeMirror's prototype to redirect to the editor's document.
var dontDelegate = "iter insert remove copy getEditor".split(" "); var dontDelegate = "iter insert remove copy getEditor constructor".split(" ");
for (var prop in Doc.prototype) if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) for (var prop in Doc.prototype) if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)
CodeMirror.prototype[prop] = (function(method) { CodeMirror.prototype[prop] = (function(method) {
return function() {return method.apply(this.doc, arguments);}; return function() {return method.apply(this.doc, arguments);};
@ -8272,7 +8318,12 @@
} while (child = child.parentNode); } while (child = child.parentNode);
}; };
function activeElt() { return document.activeElement; } function activeElt() {
var activeElement = document.activeElement;
while (activeElement && activeElement.root && activeElement.root.activeElement)
activeElement = activeElement.root.activeElement;
return activeElement;
}
// Older versions of IE throws unspecified error when touching // Older versions of IE throws unspecified error when touching
// document.activeElement in some cases (during loading, in iframe) // document.activeElement in some cases (during loading, in iframe)
if (ie && ie_version < 11) activeElt = function() { if (ie && ie_version < 11) activeElt = function() {
@ -8374,7 +8425,7 @@
// See if "".split is the broken IE version, if so, provide an // See if "".split is the broken IE version, if so, provide an
// alternative way to split lines. // alternative way to split lines.
var splitLines = CodeMirror.splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) { var splitLinesAuto = CodeMirror.splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) {
var pos = 0, result = [], l = string.length; var pos = 0, result = [], l = string.length;
while (pos <= l) { while (pos <= l) {
var nl = string.indexOf("\n", pos); var nl = string.indexOf("\n", pos);
@ -8732,7 +8783,7 @@
// THE END // THE END
CodeMirror.version = "5.2.1"; CodeMirror.version = "5.5.1";
return CodeMirror; return CodeMirror;
}); });

View File

@ -273,6 +273,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
override = "string-2"; override = "string-2";
else if (valueKeywords.hasOwnProperty(word)) else if (valueKeywords.hasOwnProperty(word))
override = "atom"; override = "atom";
else if (colorKeywords.hasOwnProperty(word))
override = "keyword";
else else
override = "error"; override = "error";
} }
@ -329,7 +331,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
if (type == "}") return popContext(state); if (type == "}") return popContext(state);
if (type == "{" || type == ";") return popAndPass(type, stream, state); if (type == "{" || type == ";") return popAndPass(type, stream, state);
if (type == "word") override = "variable"; if (type == "word") override = "variable";
else if (type != "variable") override = "error"; else if (type != "variable" && type != "(" && type != ")") override = "error";
return "interpolation"; return "interpolation";
}; };
@ -653,16 +655,6 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
return ["comment", "comment"]; return ["comment", "comment"];
} }
function tokenSGMLComment(stream, state) {
if (stream.skipTo("-->")) {
stream.match("-->");
state.tokenize = null;
} else {
stream.skipToEnd();
}
return ["comment", "comment"];
}
CodeMirror.defineMIME("text/css", { CodeMirror.defineMIME("text/css", {
documentTypes: documentTypes, documentTypes: documentTypes,
mediaTypes: mediaTypes, mediaTypes: mediaTypes,
@ -674,11 +666,6 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
colorKeywords: colorKeywords, colorKeywords: colorKeywords,
valueKeywords: valueKeywords, valueKeywords: valueKeywords,
tokenHooks: { tokenHooks: {
"<": function(stream, state) {
if (!stream.match("!--")) return false;
state.tokenize = tokenSGMLComment;
return tokenSGMLComment(stream, state);
},
"/": function(stream, state) { "/": function(stream, state) {
if (!stream.eat("*")) return false; if (!stream.eat("*")) return false;
state.tokenize = tokenCComment; state.tokenize = tokenCComment;

View File

@ -1,75 +0,0 @@
<!doctype html>
<title>CodeMirror: CSS mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">
<link rel="stylesheet" href="../../lib/codemirror.css">
<link rel="stylesheet" href="../../addon/hint/show-hint.css">
<script src="../../lib/codemirror.js"></script>
<script src="css.js"></script>
<script src="../../addon/hint/show-hint.js"></script>
<script src="../../addon/hint/css-hint.js"></script>
<style>.CodeMirror {background: #f8f8f8;}</style>
<div id=nav>
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<ul>
<li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul>
<ul>
<li><a href="../index.html">Language modes</a>
<li><a class=active href="#">CSS</a>
</ul>
</div>
<article>
<h2>CSS mode</h2>
<form><textarea id="code" name="code">
/* Some example CSS */
@import url("something.css");
body {
margin: 0;
padding: 3em 6em;
font-family: tahoma, arial, sans-serif;
color: #000;
}
#navigation a {
font-weight: bold;
text-decoration: none !important;
}
h1 {
font-size: 2.5em;
}
h2 {
font-size: 1.7em;
}
h1:before, h2:before {
content: "::";
}
code {
font-family: courier, monospace;
font-size: 80%;
color: #418A8A;
}
</textarea></form>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
extraKeys: {"Ctrl-Space": "autocomplete"},
});
</script>
<p><strong>MIME types defined:</strong> <code>text/css</code>, <code>text/x-scss</code> (<a href="scss.html">demo</a>), <code>text/x-less</code> (<a href="less.html">demo</a>).</p>
<p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#css_*">normal</a>, <a href="../../test/index.html#verbose,css_*">verbose</a>.</p>
</article>

View File

@ -1,152 +0,0 @@
<!doctype html>
<title>CodeMirror: LESS mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">
<link rel="stylesheet" href="../../lib/codemirror.css">
<script src="../../lib/codemirror.js"></script>
<script src="../../addon/edit/matchbrackets.js"></script>
<script src="css.js"></script>
<style>.CodeMirror {border: 1px solid #ddd; line-height: 1.2;}</style>
<div id=nav>
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<ul>
<li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul>
<ul>
<li><a href="../index.html">Language modes</a>
<li><a class=active href="#">LESS</a>
</ul>
</div>
<article>
<h2>LESS mode</h2>
<form><textarea id="code" name="code">@media screen and (device-aspect-ratio: 16/9) { … }
@media screen and (device-aspect-ratio: 1280/720) { … }
@media screen and (device-aspect-ratio: 2560/1440) { … }
html:lang(fr-be)
tr:nth-child(2n+1) /* represents every odd row of an HTML table */
img:nth-of-type(2n+1) { float: right; }
img:nth-of-type(2n) { float: left; }
body > h2:not(:first-of-type):not(:last-of-type)
html|*:not(:link):not(:visited)
*|*:not(:hover)
p::first-line { text-transform: uppercase }
@namespace foo url(http://www.example.com);
foo|h1 { color: blue } /* first rule */
span[hello="Ocean"][goodbye="Land"]
E[foo]{
padding:65px;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
-webkit-appearance: none; // Inner-padding issues in Chrome OSX, Safari 5
}
button::-moz-focus-inner,
input::-moz-focus-inner { // Inner padding and border oddities in FF3/4
padding: 0;
border: 0;
}
.btn {
// reset here as of 2.0.3 due to Recess property order
border-color: #ccc;
border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);
}
fieldset span button, fieldset span input[type="file"] {
font-size:12px;
font-family:Arial, Helvetica, sans-serif;
}
.rounded-corners (@radius: 5px) {
border-radius: @radius;
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
}
@import url("something.css");
@light-blue: hsl(190, 50%, 65%);
#menu {
position: absolute;
width: 100%;
z-index: 3;
clear: both;
display: block;
background-color: @blue;
height: 42px;
border-top: 2px solid lighten(@alpha-blue, 20%);
border-bottom: 2px solid darken(@alpha-blue, 25%);
.box-shadow(0, 1px, 8px, 0.6);
-moz-box-shadow: 0 0 0 #000; // Because firefox sucks.
&.docked {
background-color: hsla(210, 60%, 40%, 0.4);
}
&:hover {
background-color: @blue;
}
#dropdown {
margin: 0 0 0 117px;
padding: 0;
padding-top: 5px;
display: none;
width: 190px;
border-top: 2px solid @medium;
color: @highlight;
border: 2px solid darken(@medium, 25%);
border-left-color: darken(@medium, 15%);
border-right-color: darken(@medium, 15%);
border-top-width: 0;
background-color: darken(@medium, 10%);
ul {
padding: 0px;
}
li {
font-size: 14px;
display: block;
text-align: left;
padding: 0;
border: 0;
a {
display: block;
padding: 0px 15px;
text-decoration: none;
color: white;
&:hover {
background-color: darken(@medium, 15%);
text-decoration: none;
}
}
}
.border-radius(5px, bottom);
.box-shadow(0, 6px, 8px, 0.5);
}
}
</textarea></form>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers : true,
matchBrackets : true,
mode: "text/x-less"
});
</script>
<p>The LESS mode is a sub-mode of the <a href="index.html">CSS mode</a> (defined in <code>css.js</code>).</p>
<p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#less_*">normal</a>, <a href="../../test/index.html#verbose,less_*">verbose</a>.</p>
</article>

View File

@ -1,54 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function() {
"use strict";
var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-less");
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "less"); }
MT("variable",
"[variable-2 @base]: [atom #f04615];",
"[qualifier .class] {",
" [property width]: [variable percentage]([number 0.5]); [comment // returns `50%`]",
" [property color]: [variable saturate]([variable-2 @base], [number 5%]);",
"}");
MT("amp",
"[qualifier .child], [qualifier .sibling] {",
" [qualifier .parent] [atom &] {",
" [property color]: [keyword black];",
" }",
" [atom &] + [atom &] {",
" [property color]: [keyword red];",
" }",
"}");
MT("mixin",
"[qualifier .mixin] ([variable dark]; [variable-2 @color]) {",
" [property color]: [variable darken]([variable-2 @color], [number 10%]);",
"}",
"[qualifier .mixin] ([variable light]; [variable-2 @color]) {",
" [property color]: [variable lighten]([variable-2 @color], [number 10%]);",
"}",
"[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {",
" [property display]: [atom block];",
"}",
"[variable-2 @switch]: [variable light];",
"[qualifier .class] {",
" [qualifier .mixin]([variable-2 @switch]; [atom #888]);",
"}");
MT("nest",
"[qualifier .one] {",
" [def @media] ([property width]: [number 400px]) {",
" [property font-size]: [number 1.2em];",
" [def @media] [attribute print] [keyword and] [property color] {",
" [property color]: [keyword blue];",
" }",
" }",
"}");
MT("interpolation", ".@{[variable foo]} { [property font-weight]: [atom bold]; }");
})();

View File

@ -1,157 +0,0 @@
<!doctype html>
<title>CodeMirror: SCSS mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">
<link rel="stylesheet" href="../../lib/codemirror.css">
<script src="../../lib/codemirror.js"></script>
<script src="css.js"></script>
<style>.CodeMirror {background: #f8f8f8;}</style>
<div id=nav>
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<ul>
<li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul>
<ul>
<li><a href="../index.html">Language modes</a>
<li><a class=active href="#">SCSS</a>
</ul>
</div>
<article>
<h2>SCSS mode</h2>
<form><textarea id="code" name="code">
/* Some example SCSS */
@import "compass/css3";
$variable: #333;
$blue: #3bbfce;
$margin: 16px;
.content-navigation {
#nested {
background-color: black;
}
border-color: $blue;
color:
darken($blue, 9%);
}
.border {
padding: $margin / 2;
margin: $margin / 2;
border-color: $blue;
}
@mixin table-base {
th {
text-align: center;
font-weight: bold;
}
td, th {padding: 2px}
}
table.hl {
margin: 2em 0;
td.ln {
text-align: right;
}
}
li {
font: {
family: serif;
weight: bold;
size: 1.2em;
}
}
@mixin left($dist) {
float: left;
margin-left: $dist;
}
#data {
@include left(10px);
@include table-base;
}
.source {
@include flow-into(target);
border: 10px solid green;
margin: 20px;
width: 200px; }
.new-container {
@include flow-from(target);
border: 10px solid red;
margin: 20px;
width: 200px; }
body {
margin: 0;
padding: 3em 6em;
font-family: tahoma, arial, sans-serif;
color: #000;
}
@mixin yellow() {
background: yellow;
}
.big {
font-size: 14px;
}
.nested {
@include border-radius(3px);
@extend .big;
p {
background: whitesmoke;
a {
color: red;
}
}
}
#navigation a {
font-weight: bold;
text-decoration: none !important;
}
h1 {
font-size: 2.5em;
}
h2 {
font-size: 1.7em;
}
h1:before, h2:before {
content: "::";
}
code {
font-family: courier, monospace;
font-size: 80%;
color: #418A8A;
}
</textarea></form>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
matchBrackets: true,
mode: "text/x-scss"
});
</script>
<p>The SCSS mode is a sub-mode of the <a href="index.html">CSS mode</a> (defined in <code>css.js</code>).</p>
<p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#scss_*">normal</a>, <a href="../../test/index.html#verbose,scss_*">verbose</a>.</p>
</article>

View File

@ -1,110 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function() {
var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-scss");
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "scss"); }
MT('url_with_quotation',
"[tag foo] { [property background]:[atom url]([string test.jpg]) }");
MT('url_with_double_quotes',
"[tag foo] { [property background]:[atom url]([string \"test.jpg\"]) }");
MT('url_with_single_quotes',
"[tag foo] { [property background]:[atom url]([string \'test.jpg\']) }");
MT('string',
"[def @import] [string \"compass/css3\"]");
MT('important_keyword',
"[tag foo] { [property background]:[atom url]([string \'test.jpg\']) [keyword !important] }");
MT('variable',
"[variable-2 $blue]:[atom #333]");
MT('variable_as_attribute',
"[tag foo] { [property color]:[variable-2 $blue] }");
MT('numbers',
"[tag foo] { [property padding]:[number 10px] [number 10] [number 10em] [number 8in] }");
MT('number_percentage',
"[tag foo] { [property width]:[number 80%] }");
MT('selector',
"[builtin #hello][qualifier .world]{}");
MT('singleline_comment',
"[comment // this is a comment]");
MT('multiline_comment',
"[comment /*foobar*/]");
MT('attribute_with_hyphen',
"[tag foo] { [property font-size]:[number 10px] }");
MT('string_after_attribute',
"[tag foo] { [property content]:[string \"::\"] }");
MT('directives',
"[def @include] [qualifier .mixin]");
MT('basic_structure',
"[tag p] { [property background]:[keyword red]; }");
MT('nested_structure',
"[tag p] { [tag a] { [property color]:[keyword red]; } }");
MT('mixin',
"[def @mixin] [tag table-base] {}");
MT('number_without_semicolon',
"[tag p] {[property width]:[number 12]}",
"[tag a] {[property color]:[keyword red];}");
MT('atom_in_nested_block',
"[tag p] { [tag a] { [property color]:[atom #000]; } }");
MT('interpolation_in_property',
"[tag foo] { #{[variable-2 $hello]}:[number 2]; }");
MT('interpolation_in_selector',
"[tag foo]#{[variable-2 $hello]} { [property color]:[atom #000]; }");
MT('interpolation_error',
"[tag foo]#{[variable foo]} { [property color]:[atom #000]; }");
MT("divide_operator",
"[tag foo] { [property width]:[number 4] [operator /] [number 2] }");
MT('nested_structure_with_id_selector',
"[tag p] { [builtin #hello] { [property color]:[keyword red]; } }");
MT('indent_mixin',
"[def @mixin] [tag container] (",
" [variable-2 $a]: [number 10],",
" [variable-2 $b]: [number 10])",
"{}");
MT('indent_nested',
"[tag foo] {",
" [tag bar] {",
" }",
"}");
MT('indent_parentheses',
"[tag foo] {",
" [property color]: [variable darken]([variable-2 $blue],",
" [number 9%]);",
"}");
MT('indent_vardef',
"[variable-2 $name]:",
" [string 'val'];",
"[tag tag] {",
" [tag inner] {",
" [property margin]: [number 3px];",
" }",
"}");
})();

View File

@ -1,195 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function() {
var mode = CodeMirror.getMode({indentUnit: 2}, "css");
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
// Error, because "foobarhello" is neither a known type or property, but
// property was expected (after "and"), and it should be in parenthese.
MT("atMediaUnknownType",
"[def @media] [attribute screen] [keyword and] [error foobarhello] { }");
// Soft error, because "foobarhello" is not a known property or type.
MT("atMediaUnknownProperty",
"[def @media] [attribute screen] [keyword and] ([error foobarhello]) { }");
// Make sure nesting works with media queries
MT("atMediaMaxWidthNested",
"[def @media] [attribute screen] [keyword and] ([property max-width]: [number 25px]) { [tag foo] { } }");
MT("tagSelector",
"[tag foo] { }");
MT("classSelector",
"[qualifier .foo-bar_hello] { }");
MT("idSelector",
"[builtin #foo] { [error #foo] }");
MT("tagSelectorUnclosed",
"[tag foo] { [property margin]: [number 0] } [tag bar] { }");
MT("tagStringNoQuotes",
"[tag foo] { [property font-family]: [variable hello] [variable world]; }");
MT("tagStringDouble",
"[tag foo] { [property font-family]: [string \"hello world\"]; }");
MT("tagStringSingle",
"[tag foo] { [property font-family]: [string 'hello world']; }");
MT("tagColorKeyword",
"[tag foo] {",
" [property color]: [keyword black];",
" [property color]: [keyword navy];",
" [property color]: [keyword yellow];",
"}");
MT("tagColorHex3",
"[tag foo] { [property background]: [atom #fff]; }");
MT("tagColorHex6",
"[tag foo] { [property background]: [atom #ffffff]; }");
MT("tagColorHex4",
"[tag foo] { [property background]: [atom&error #ffff]; }");
MT("tagColorHexInvalid",
"[tag foo] { [property background]: [atom&error #ffg]; }");
MT("tagNegativeNumber",
"[tag foo] { [property margin]: [number -5px]; }");
MT("tagPositiveNumber",
"[tag foo] { [property padding]: [number 5px]; }");
MT("tagVendor",
"[tag foo] { [meta -foo-][property box-sizing]: [meta -foo-][atom border-box]; }");
MT("tagBogusProperty",
"[tag foo] { [property&error barhelloworld]: [number 0]; }");
MT("tagTwoProperties",
"[tag foo] { [property margin]: [number 0]; [property padding]: [number 0]; }");
MT("tagTwoPropertiesURL",
"[tag foo] { [property background]: [atom url]([string //example.com/foo.png]); [property padding]: [number 0]; }");
MT("commentSGML",
"[comment <!--comment-->]");
MT("commentSGML2",
"[comment <!--comment]",
"[comment -->] [tag div] {}");
MT("indent_tagSelector",
"[tag strong], [tag em] {",
" [property background]: [atom rgba](",
" [number 255], [number 255], [number 0], [number .2]",
" );",
"}");
MT("indent_atMedia",
"[def @media] {",
" [tag foo] {",
" [property color]:",
" [keyword yellow];",
" }",
"}");
MT("indent_comma",
"[tag foo] {",
" [property font-family]: [variable verdana],",
" [atom sans-serif];",
"}");
MT("indent_parentheses",
"[tag foo]:[variable-3 before] {",
" [property background]: [atom url](",
"[string blahblah]",
"[string etc]",
"[string ]) [keyword !important];",
"}");
MT("font_face",
"[def @font-face] {",
" [property font-family]: [string 'myfont'];",
" [error nonsense]: [string 'abc'];",
" [property src]: [atom url]([string http://blah]),",
" [atom url]([string http://foo]);",
"}");
MT("empty_url",
"[def @import] [tag url]() [tag screen];");
MT("parens",
"[qualifier .foo] {",
" [property background-image]: [variable fade]([atom #000], [number 20%]);",
" [property border-image]: [atom linear-gradient](",
" [atom to] [atom bottom],",
" [variable fade]([atom #000], [number 20%]) [number 0%],",
" [variable fade]([atom #000], [number 20%]) [number 100%]",
" );",
"}");
MT("css_variable",
":[variable-3 root] {",
" [variable-2 --main-color]: [atom #06c];",
"}",
"[tag h1][builtin #foo] {",
" [property color]: [atom var]([variable-2 --main-color]);",
"}");
MT("supports",
"[def @supports] ([keyword not] (([property text-align-last]: [atom justify]) [keyword or] ([meta -moz-][property text-align-last]: [atom justify])) {",
" [property text-align-last]: [atom justify];",
"}");
MT("document",
"[def @document] [tag url]([string http://blah]),",
" [tag url-prefix]([string https://]),",
" [tag domain]([string blah.com]),",
" [tag regexp]([string \".*blah.+\"]) {",
" [builtin #id] {",
" [property background-color]: [keyword white];",
" }",
" [tag foo] {",
" [property font-family]: [variable Verdana], [atom sans-serif];",
" }",
" }");
MT("document_url",
"[def @document] [tag url]([string http://blah]) { [qualifier .class] { } }");
MT("document_urlPrefix",
"[def @document] [tag url-prefix]([string https://]) { [builtin #id] { } }");
MT("document_domain",
"[def @document] [tag domain]([string blah.com]) { [tag foo] { } }");
MT("document_regexp",
"[def @document] [tag regexp]([string \".*blah.+\"]) { [builtin #id] { } }");
MT("counter-style",
"[def @counter-style] [variable binary] {",
" [property system]: [atom numeric];",
" [property symbols]: [number 0] [number 1];",
" [property suffix]: [string \".\"];",
" [property range]: [atom infinite];",
" [property speak-as]: [atom numeric];",
"}");
MT("counter-style-additive-symbols",
"[def @counter-style] [variable simple-roman] {",
" [property system]: [atom additive];",
" [property additive-symbols]: [number 10] [variable X], [number 5] [variable V], [number 1] [variable I];",
" [property range]: [number 1] [number 49];",
"}");
MT("counter-style-use",
"[tag ol][qualifier .roman] { [property list-style]: [variable simple-roman]; }");
MT("counter-style-symbols",
"[tag ol] { [property list-style]: [atom symbols]([atom cyclic] [string \"*\"] [string \"\\2020\"] [string \"\\2021\"] [string \"\\A7\"]); }");
})();

View File

@ -1,21 +0,0 @@
{
"name": "codemirror",
"version":"5.2.1",
"main": "lib/codemirror.js",
"description": "In-browser code editing made bearable",
"licenses": [{"type": "MIT",
"url": "http://codemirror.net/LICENSE"}],
"directories": {"lib": "./lib"},
"scripts": {"test": "node ./test/run.js"},
"devDependencies": {"node-static": "0.6.0",
"phantomjs": "1.9.2-5",
"blint": ">=0.1.1"},
"bugs": "http://github.com/codemirror/CodeMirror/issues",
"keywords": ["JavaScript", "CodeMirror", "Editor"],
"homepage": "http://codemirror.net",
"maintainers":[{"name": "Marijn Haverbeke",
"email": "marijnh@gmail.com",
"web": "http://marijnhaverbeke.nl"}],
"repository": {"type": "git",
"url": "https://github.com/codemirror/CodeMirror.git"}
}

View File

@ -10,8 +10,9 @@
.cm-s-3024-day.CodeMirror {background: #f7f7f7; color: #3a3432;} .cm-s-3024-day.CodeMirror {background: #f7f7f7; color: #3a3432;}
.cm-s-3024-day div.CodeMirror-selected {background: #d6d5d4 !important;} .cm-s-3024-day div.CodeMirror-selected {background: #d6d5d4 !important;}
.cm-s-3024-day.CodeMirror ::selection { background: #d6d5d4; }
.cm-s-3024-day.CodeMirror ::-moz-selection { background: #d9d9d9; } .cm-s-3024-day .CodeMirror-line::selection, .cm-s-3024-day .CodeMirror-line > span::selection, .cm-s-3024-day .CodeMirror-line > span > span::selection { background: #d6d5d4; }
.cm-s-3024-day .CodeMirror-line::-moz-selection, .cm-s-3024-day .CodeMirror-line > span::-moz-selection, .cm-s-3024-day .CodeMirror-line > span > span::selection { background: #d9d9d9; }
.cm-s-3024-day .CodeMirror-gutters {background: #f7f7f7; border-right: 0px;} .cm-s-3024-day .CodeMirror-gutters {background: #f7f7f7; border-right: 0px;}
.cm-s-3024-day .CodeMirror-guttermarker { color: #db2d20; } .cm-s-3024-day .CodeMirror-guttermarker { color: #db2d20; }

View File

@ -10,8 +10,8 @@
.cm-s-3024-night.CodeMirror {background: #090300; color: #d6d5d4;} .cm-s-3024-night.CodeMirror {background: #090300; color: #d6d5d4;}
.cm-s-3024-night div.CodeMirror-selected {background: #3a3432 !important;} .cm-s-3024-night div.CodeMirror-selected {background: #3a3432 !important;}
.cm-s-3024-night.CodeMirror ::selection { background: rgba(58, 52, 50, .99); } .cm-s-3024-night .CodeMirror-line::selection, .cm-s-3024-night .CodeMirror-line > span::selection, .cm-s-3024-night .CodeMirror-line > span > span::selection { background: rgba(58, 52, 50, .99); }
.cm-s-3024-night.CodeMirror ::-moz-selection { background: rgba(58, 52, 50, .99); } .cm-s-3024-night .CodeMirror-line::-moz-selection, .cm-s-3024-night .CodeMirror-line > span::-moz-selection, .cm-s-3024-night .CodeMirror-line > span > span::-moz-selection { background: rgba(58, 52, 50, .99); }
.cm-s-3024-night .CodeMirror-gutters {background: #090300; border-right: 0px;} .cm-s-3024-night .CodeMirror-gutters {background: #090300; border-right: 0px;}
.cm-s-3024-night .CodeMirror-guttermarker { color: #db2d20; } .cm-s-3024-night .CodeMirror-guttermarker { color: #db2d20; }
.cm-s-3024-night .CodeMirror-guttermarker-subtle { color: #5c5855; } .cm-s-3024-night .CodeMirror-guttermarker-subtle { color: #5c5855; }

View File

@ -2,6 +2,9 @@
/* Color scheme */ /* Color scheme */
.cm-s-ambiance .cm-header {color: blue;}
.cm-s-ambiance .cm-quote { color: #24C2C7; }
.cm-s-ambiance .cm-keyword { color: #cda869; } .cm-s-ambiance .cm-keyword { color: #cda869; }
.cm-s-ambiance .cm-atom { color: #CF7EA9; } .cm-s-ambiance .cm-atom { color: #CF7EA9; }
.cm-s-ambiance .cm-number { color: #78CF8A; } .cm-s-ambiance .cm-number { color: #78CF8A; }
@ -20,8 +23,6 @@
.cm-s-ambiance .cm-bracket { color: #24C2C7; } .cm-s-ambiance .cm-bracket { color: #24C2C7; }
.cm-s-ambiance .cm-tag { color: #fee4ff } .cm-s-ambiance .cm-tag { color: #fee4ff }
.cm-s-ambiance .cm-attribute { color: #9B859D; } .cm-s-ambiance .cm-attribute { color: #9B859D; }
.cm-s-ambiance .cm-header {color: blue;}
.cm-s-ambiance .cm-quote { color: #24C2C7; }
.cm-s-ambiance .cm-hr { color: pink; } .cm-s-ambiance .cm-hr { color: pink; }
.cm-s-ambiance .cm-link { color: #F4C20B; } .cm-s-ambiance .cm-link { color: #F4C20B; }
.cm-s-ambiance .cm-special { color: #FF9D00; } .cm-s-ambiance .cm-special { color: #FF9D00; }
@ -32,8 +33,8 @@
.cm-s-ambiance .CodeMirror-selected { background: rgba(255, 255, 255, 0.15); } .cm-s-ambiance .CodeMirror-selected { background: rgba(255, 255, 255, 0.15); }
.cm-s-ambiance.CodeMirror-focused .CodeMirror-selected { background: rgba(255, 255, 255, 0.10); } .cm-s-ambiance.CodeMirror-focused .CodeMirror-selected { background: rgba(255, 255, 255, 0.10); }
.cm-s-ambiance.CodeMirror ::selection { background: rgba(255, 255, 255, 0.10); } .cm-s-ambiance .CodeMirror-line::selection, .cm-s-ambiance .CodeMirror-line > span::selection, .cm-s-ambiance .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); }
.cm-s-ambiance.CodeMirror ::-moz-selection { background: rgba(255, 255, 255, 0.10); } .cm-s-ambiance .CodeMirror-line::-moz-selection, .cm-s-ambiance .CodeMirror-line > span::-moz-selection, .cm-s-ambiance .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); }
/* Editor styling */ /* Editor styling */

View File

@ -10,8 +10,8 @@
.cm-s-base16-dark.CodeMirror {background: #151515; color: #e0e0e0;} .cm-s-base16-dark.CodeMirror {background: #151515; color: #e0e0e0;}
.cm-s-base16-dark div.CodeMirror-selected {background: #303030 !important;} .cm-s-base16-dark div.CodeMirror-selected {background: #303030 !important;}
.cm-s-base16-dark.CodeMirror ::selection { background: rgba(48, 48, 48, .99); } .cm-s-base16-dark .CodeMirror-line::selection, .cm-s-base16-dark .CodeMirror-line > span::selection, .cm-s-base16-dark .CodeMirror-line > span > span::selection { background: rgba(48, 48, 48, .99); }
.cm-s-base16-dark.CodeMirror ::-moz-selection { background: rgba(48, 48, 48, .99); } .cm-s-base16-dark .CodeMirror-line::-moz-selection, .cm-s-base16-dark .CodeMirror-line > span::-moz-selection, .cm-s-base16-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(48, 48, 48, .99); }
.cm-s-base16-dark .CodeMirror-gutters {background: #151515; border-right: 0px;} .cm-s-base16-dark .CodeMirror-gutters {background: #151515; border-right: 0px;}
.cm-s-base16-dark .CodeMirror-guttermarker { color: #ac4142; } .cm-s-base16-dark .CodeMirror-guttermarker { color: #ac4142; }
.cm-s-base16-dark .CodeMirror-guttermarker-subtle { color: #505050; } .cm-s-base16-dark .CodeMirror-guttermarker-subtle { color: #505050; }

View File

@ -10,8 +10,8 @@
.cm-s-base16-light.CodeMirror {background: #f5f5f5; color: #202020;} .cm-s-base16-light.CodeMirror {background: #f5f5f5; color: #202020;}
.cm-s-base16-light div.CodeMirror-selected {background: #e0e0e0 !important;} .cm-s-base16-light div.CodeMirror-selected {background: #e0e0e0 !important;}
.cm-s-base16-light.CodeMirror ::selection { background: #e0e0e0; } .cm-s-base16-light .CodeMirror-line::selection, .cm-s-base16-light .CodeMirror-line > span::selection, .cm-s-base16-light .CodeMirror-line > span > span::selection { background: #e0e0e0; }
.cm-s-base16-light.CodeMirror ::-moz-selection { background: #e0e0e0; } .cm-s-base16-light .CodeMirror-line::-moz-selection, .cm-s-base16-light .CodeMirror-line > span::-moz-selection, .cm-s-base16-light .CodeMirror-line > span > span::-moz-selection { background: #e0e0e0; }
.cm-s-base16-light .CodeMirror-gutters {background: #f5f5f5; border-right: 0px;} .cm-s-base16-light .CodeMirror-gutters {background: #f5f5f5; border-right: 0px;}
.cm-s-base16-light .CodeMirror-guttermarker { color: #ac4142; } .cm-s-base16-light .CodeMirror-guttermarker { color: #ac4142; }
.cm-s-base16-light .CodeMirror-guttermarker-subtle { color: #b0b0b0; } .cm-s-base16-light .CodeMirror-guttermarker-subtle { color: #b0b0b0; }

View File

@ -2,8 +2,8 @@
.cm-s-blackboard.CodeMirror { background: #0C1021; color: #F8F8F8; } .cm-s-blackboard.CodeMirror { background: #0C1021; color: #F8F8F8; }
.cm-s-blackboard .CodeMirror-selected { background: #253B76 !important; } .cm-s-blackboard .CodeMirror-selected { background: #253B76 !important; }
.cm-s-blackboard.CodeMirror ::selection { background: rgba(37, 59, 118, .99); } .cm-s-blackboard .CodeMirror-line::selection, .cm-s-blackboard .CodeMirror-line > span::selection, .cm-s-blackboard .CodeMirror-line > span > span::selection { background: rgba(37, 59, 118, .99); }
.cm-s-blackboard.CodeMirror ::-moz-selection { background: rgba(37, 59, 118, .99); } .cm-s-blackboard .CodeMirror-line::-moz-selection, .cm-s-blackboard .CodeMirror-line > span::-moz-selection, .cm-s-blackboard .CodeMirror-line > span > span::-moz-selection { background: rgba(37, 59, 118, .99); }
.cm-s-blackboard .CodeMirror-gutters { background: #0C1021; border-right: 0; } .cm-s-blackboard .CodeMirror-gutters { background: #0C1021; border-right: 0; }
.cm-s-blackboard .CodeMirror-guttermarker { color: #FBDE2D; } .cm-s-blackboard .CodeMirror-guttermarker { color: #FBDE2D; }
.cm-s-blackboard .CodeMirror-guttermarker-subtle { color: #888; } .cm-s-blackboard .CodeMirror-guttermarker-subtle { color: #888; }

View File

@ -1,7 +1,7 @@
.cm-s-cobalt.CodeMirror { background: #002240; color: white; } .cm-s-cobalt.CodeMirror { background: #002240; color: white; }
.cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; } .cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; }
.cm-s-cobalt.CodeMirror ::selection { background: rgba(179, 101, 57, .99); } .cm-s-cobalt .CodeMirror-line::selection, .cm-s-cobalt .CodeMirror-line > span::selection, .cm-s-cobalt .CodeMirror-line > span > span::selection { background: rgba(179, 101, 57, .99); }
.cm-s-cobalt.CodeMirror ::-moz-selection { background: rgba(179, 101, 57, .99); } .cm-s-cobalt .CodeMirror-line::-moz-selection, .cm-s-cobalt .CodeMirror-line > span::-moz-selection, .cm-s-cobalt .CodeMirror-line > span > span::-moz-selection { background: rgba(179, 101, 57, .99); }
.cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } .cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }
.cm-s-cobalt .CodeMirror-guttermarker { color: #ffee80; } .cm-s-cobalt .CodeMirror-guttermarker { color: #ffee80; }
.cm-s-cobalt .CodeMirror-guttermarker-subtle { color: #d0d0d0; } .cm-s-cobalt .CodeMirror-guttermarker-subtle { color: #d0d0d0; }

View File

@ -1,13 +1,14 @@
.cm-s-erlang-dark.CodeMirror { background: #002240; color: white; } .cm-s-erlang-dark.CodeMirror { background: #002240; color: white; }
.cm-s-erlang-dark div.CodeMirror-selected { background: #b36539 !important; } .cm-s-erlang-dark div.CodeMirror-selected { background: #b36539 !important; }
.cm-s-erlang-dark.CodeMirror ::selection { background: rgba(179, 101, 57, .99); } .cm-s-erlang-dark .CodeMirror-line::selection, .cm-s-erlang-dark .CodeMirror-line > span::selection, .cm-s-erlang-dark .CodeMirror-line > span > span::selection { background: rgba(179, 101, 57, .99); }
.cm-s-erlang-dark.CodeMirror ::-moz-selection { background: rgba(179, 101, 57, .99); } .cm-s-erlang-dark .CodeMirror-line::-moz-selection, .cm-s-erlang-dark .CodeMirror-line > span::-moz-selection, .cm-s-erlang-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(179, 101, 57, .99); }
.cm-s-erlang-dark .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } .cm-s-erlang-dark .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }
.cm-s-erlang-dark .CodeMirror-guttermarker { color: white; } .cm-s-erlang-dark .CodeMirror-guttermarker { color: white; }
.cm-s-erlang-dark .CodeMirror-guttermarker-subtle { color: #d0d0d0; } .cm-s-erlang-dark .CodeMirror-guttermarker-subtle { color: #d0d0d0; }
.cm-s-erlang-dark .CodeMirror-linenumber { color: #d0d0d0; } .cm-s-erlang-dark .CodeMirror-linenumber { color: #d0d0d0; }
.cm-s-erlang-dark .CodeMirror-cursor { border-left: 1px solid white !important; } .cm-s-erlang-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
.cm-s-erlang-dark span.cm-quote { color: #ccc; }
.cm-s-erlang-dark span.cm-atom { color: #f133f1; } .cm-s-erlang-dark span.cm-atom { color: #f133f1; }
.cm-s-erlang-dark span.cm-attribute { color: #ff80e1; } .cm-s-erlang-dark span.cm-attribute { color: #ff80e1; }
.cm-s-erlang-dark span.cm-bracket { color: #ff9d00; } .cm-s-erlang-dark span.cm-bracket { color: #ff9d00; }
@ -20,7 +21,6 @@
.cm-s-erlang-dark span.cm-operator { color: #d55; } .cm-s-erlang-dark span.cm-operator { color: #d55; }
.cm-s-erlang-dark span.cm-property { color: #ccc; } .cm-s-erlang-dark span.cm-property { color: #ccc; }
.cm-s-erlang-dark span.cm-qualifier { color: #ccc; } .cm-s-erlang-dark span.cm-qualifier { color: #ccc; }
.cm-s-erlang-dark span.cm-quote { color: #ccc; }
.cm-s-erlang-dark span.cm-special { color: #ffbbbb; } .cm-s-erlang-dark span.cm-special { color: #ffbbbb; }
.cm-s-erlang-dark span.cm-string { color: #3ad900; } .cm-s-erlang-dark span.cm-string { color: #3ad900; }
.cm-s-erlang-dark span.cm-string-2 { color: #ccc; } .cm-s-erlang-dark span.cm-string-2 { color: #ccc; }

View File

@ -7,8 +7,8 @@ Ported to CodeMirror by Peter Kroon
} }
.cm-s-lesser-dark.CodeMirror { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; } .cm-s-lesser-dark.CodeMirror { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; }
.cm-s-lesser-dark div.CodeMirror-selected {background: #45443B !important;} /* 33322B*/ .cm-s-lesser-dark div.CodeMirror-selected {background: #45443B !important;} /* 33322B*/
.cm-s-lesser-dark.CodeMirror ::selection { background: rgba(69, 68, 59, .99); } .cm-s-lesser-dark .CodeMirror-line::selection, .cm-s-lesser-dark .CodeMirror-line > span::selection, .cm-s-lesser-dark .CodeMirror-line > span > span::selection { background: rgba(69, 68, 59, .99); }
.cm-s-lesser-dark.CodeMirror ::-moz-selection { background: rgba(69, 68, 59, .99); } .cm-s-lesser-dark .CodeMirror-line::-moz-selection, .cm-s-lesser-dark .CodeMirror-line > span::-moz-selection, .cm-s-lesser-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(69, 68, 59, .99); }
.cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white !important; } .cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
.cm-s-lesser-dark pre { padding: 0 8px; }/*editable code holder*/ .cm-s-lesser-dark pre { padding: 0 8px; }/*editable code holder*/
@ -19,6 +19,8 @@ Ported to CodeMirror by Peter Kroon
.cm-s-lesser-dark .CodeMirror-guttermarker-subtle { color: #777; } .cm-s-lesser-dark .CodeMirror-guttermarker-subtle { color: #777; }
.cm-s-lesser-dark .CodeMirror-linenumber { color: #777; } .cm-s-lesser-dark .CodeMirror-linenumber { color: #777; }
.cm-s-lesser-dark span.cm-header {color: #a0a;}
.cm-s-lesser-dark span.cm-quote {color: #090;}
.cm-s-lesser-dark span.cm-keyword { color: #599eff; } .cm-s-lesser-dark span.cm-keyword { color: #599eff; }
.cm-s-lesser-dark span.cm-atom { color: #C2B470; } .cm-s-lesser-dark span.cm-atom { color: #C2B470; }
.cm-s-lesser-dark span.cm-number { color: #B35E4D; } .cm-s-lesser-dark span.cm-number { color: #B35E4D; }
@ -37,8 +39,6 @@ Ported to CodeMirror by Peter Kroon
.cm-s-lesser-dark span.cm-bracket { color: #EBEFE7; } .cm-s-lesser-dark span.cm-bracket { color: #EBEFE7; }
.cm-s-lesser-dark span.cm-tag { color: #669199; } .cm-s-lesser-dark span.cm-tag { color: #669199; }
.cm-s-lesser-dark span.cm-attribute {color: #00c;} .cm-s-lesser-dark span.cm-attribute {color: #00c;}
.cm-s-lesser-dark span.cm-header {color: #a0a;}
.cm-s-lesser-dark span.cm-quote {color: #090;}
.cm-s-lesser-dark span.cm-hr {color: #999;} .cm-s-lesser-dark span.cm-hr {color: #999;}
.cm-s-lesser-dark span.cm-link {color: #00c;} .cm-s-lesser-dark span.cm-link {color: #00c;}
.cm-s-lesser-dark span.cm-error { color: #9d1e15; } .cm-s-lesser-dark span.cm-error { color: #9d1e15; }

View File

@ -6,8 +6,8 @@
.cm-s-mbo.CodeMirror {background: #2c2c2c; color: #ffffec;} .cm-s-mbo.CodeMirror {background: #2c2c2c; color: #ffffec;}
.cm-s-mbo div.CodeMirror-selected {background: #716C62 !important;} .cm-s-mbo div.CodeMirror-selected {background: #716C62 !important;}
.cm-s-mbo.CodeMirror ::selection { background: rgba(113, 108, 98, .99); } .cm-s-mbo .CodeMirror-line::selection, .cm-s-mbo .CodeMirror-line > span::selection, .cm-s-mbo .CodeMirror-line > span > span::selection { background: rgba(113, 108, 98, .99); }
.cm-s-mbo.CodeMirror ::-moz-selection { background: rgba(113, 108, 98, .99); } .cm-s-mbo .CodeMirror-line::-moz-selection, .cm-s-mbo .CodeMirror-line > span::-moz-selection, .cm-s-mbo .CodeMirror-line > span > span::-moz-selection { background: rgba(113, 108, 98, .99); }
.cm-s-mbo .CodeMirror-gutters {background: #4e4e4e; border-right: 0px;} .cm-s-mbo .CodeMirror-gutters {background: #4e4e4e; border-right: 0px;}
.cm-s-mbo .CodeMirror-guttermarker { color: white; } .cm-s-mbo .CodeMirror-guttermarker { color: white; }
.cm-s-mbo .CodeMirror-guttermarker-subtle { color: grey; } .cm-s-mbo .CodeMirror-guttermarker-subtle { color: grey; }

View File

@ -9,8 +9,8 @@
*/ */
.cm-s-mdn-like.CodeMirror { color: #999; background-color: #fff; } .cm-s-mdn-like.CodeMirror { color: #999; background-color: #fff; }
.cm-s-mdn-like .CodeMirror-selected { background: #cfc !important; } .cm-s-mdn-like .CodeMirror-selected { background: #cfc !important; }
.cm-s-mdn-like.CodeMirror ::selection { background: #cfc; } .cm-s-mdn-like .CodeMirror-line::selection, .cm-s-mdn-like .CodeMirror-line > span::selection, .cm-s-mdn-like .CodeMirror-line > span > span::selection { background: #cfc; }
.cm-s-mdn-like.CodeMirror ::-moz-selection { background: #cfc; } .cm-s-mdn-like .CodeMirror-line::-moz-selection, .cm-s-mdn-like .CodeMirror-line > span::-moz-selection, .cm-s-mdn-like .CodeMirror-line > span > span::-moz-selection { background: #cfc; }
.cm-s-mdn-like .CodeMirror-gutters { background: #f8f8f8; border-left: 6px solid rgba(0,83,159,0.65); color: #333; } .cm-s-mdn-like .CodeMirror-gutters { background: #f8f8f8; border-left: 6px solid rgba(0,83,159,0.65); color: #333; }
.cm-s-mdn-like .CodeMirror-linenumber { color: #aaa; padding-left: 8px; } .cm-s-mdn-like .CodeMirror-linenumber { color: #aaa; padding-left: 8px; }

View File

@ -15,8 +15,8 @@
.cm-s-midnight.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;} .cm-s-midnight.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
.cm-s-midnight div.CodeMirror-selected {background: #314D67 !important;} .cm-s-midnight div.CodeMirror-selected {background: #314D67 !important;}
.cm-s-midnight.CodeMirror ::selection { background: rgba(49, 77, 103, .99); } .cm-s-midnight .CodeMirror-line::selection, .cm-s-midnight .CodeMirror-line > span::selection, .cm-s-midnight .CodeMirror-line > span > span::selection { background: rgba(49, 77, 103, .99); }
.cm-s-midnight.CodeMirror ::-moz-selection { background: rgba(49, 77, 103, .99); } .cm-s-midnight .CodeMirror-line::-moz-selection, .cm-s-midnight .CodeMirror-line > span::-moz-selection, .cm-s-midnight .CodeMirror-line > span > span::-moz-selection { background: rgba(49, 77, 103, .99); }
.cm-s-midnight .CodeMirror-gutters {background: #0F192A; border-right: 1px solid;} .cm-s-midnight .CodeMirror-gutters {background: #0F192A; border-right: 1px solid;}
.cm-s-midnight .CodeMirror-guttermarker { color: white; } .cm-s-midnight .CodeMirror-guttermarker { color: white; }
.cm-s-midnight .CodeMirror-guttermarker-subtle { color: #d0d0d0; } .cm-s-midnight .CodeMirror-guttermarker-subtle { color: #d0d0d0; }

View File

@ -2,8 +2,8 @@
.cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;} .cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;}
.cm-s-monokai div.CodeMirror-selected {background: #49483E !important;} .cm-s-monokai div.CodeMirror-selected {background: #49483E !important;}
.cm-s-monokai.CodeMirror ::selection { background: rgba(73, 72, 62, .99); } .cm-s-monokai .CodeMirror-line::selection, .cm-s-monokai .CodeMirror-line > span::selection, .cm-s-monokai .CodeMirror-line > span > span::selection { background: rgba(73, 72, 62, .99); }
.cm-s-monokai.CodeMirror ::-moz-selection { background: rgba(73, 72, 62, .99); } .cm-s-monokai .CodeMirror-line::-moz-selection, .cm-s-monokai .CodeMirror-line > span::-moz-selection, .cm-s-monokai .CodeMirror-line > span > span::-moz-selection { background: rgba(73, 72, 62, .99); }
.cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;} .cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;}
.cm-s-monokai .CodeMirror-guttermarker { color: white; } .cm-s-monokai .CodeMirror-guttermarker { color: white; }
.cm-s-monokai .CodeMirror-guttermarker-subtle { color: #d0d0d0; } .cm-s-monokai .CodeMirror-guttermarker-subtle { color: #d0d0d0; }
@ -20,9 +20,11 @@
.cm-s-monokai span.cm-variable {color: #f8f8f2;} .cm-s-monokai span.cm-variable {color: #f8f8f2;}
.cm-s-monokai span.cm-variable-2 {color: #9effff;} .cm-s-monokai span.cm-variable-2 {color: #9effff;}
.cm-s-monokai span.cm-variable-3 {color: #66d9ef;}
.cm-s-monokai span.cm-def {color: #fd971f;} .cm-s-monokai span.cm-def {color: #fd971f;}
.cm-s-monokai span.cm-bracket {color: #f8f8f2;} .cm-s-monokai span.cm-bracket {color: #f8f8f2;}
.cm-s-monokai span.cm-tag {color: #f92672;} .cm-s-monokai span.cm-tag {color: #f92672;}
.cm-s-monokai span.cm-header {color: #ae81ff;}
.cm-s-monokai span.cm-link {color: #ae81ff;} .cm-s-monokai span.cm-link {color: #ae81ff;}
.cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;} .cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;}

View File

@ -2,8 +2,8 @@
.cm-s-night.CodeMirror { background: #0a001f; color: #f8f8f8; } .cm-s-night.CodeMirror { background: #0a001f; color: #f8f8f8; }
.cm-s-night div.CodeMirror-selected { background: #447 !important; } .cm-s-night div.CodeMirror-selected { background: #447 !important; }
.cm-s-night.CodeMirror ::selection { background: rgba(68, 68, 119, .99); } .cm-s-night .CodeMirror-line::selection, .cm-s-night .CodeMirror-line > span::selection, .cm-s-night .CodeMirror-line > span > span::selection { background: rgba(68, 68, 119, .99); }
.cm-s-night.CodeMirror ::-moz-selection { background: rgba(68, 68, 119, .99); } .cm-s-night .CodeMirror-line::-moz-selection, .cm-s-night .CodeMirror-line > span::-moz-selection, .cm-s-night .CodeMirror-line > span > span::-moz-selection { background: rgba(68, 68, 119, .99); }
.cm-s-night .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } .cm-s-night .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; }
.cm-s-night .CodeMirror-guttermarker { color: white; } .cm-s-night .CodeMirror-guttermarker { color: white; }
.cm-s-night .CodeMirror-guttermarker-subtle { color: #bbb; } .cm-s-night .CodeMirror-guttermarker-subtle { color: #bbb; }

View File

@ -10,8 +10,8 @@
.cm-s-paraiso-dark.CodeMirror {background: #2f1e2e; color: #b9b6b0;} .cm-s-paraiso-dark.CodeMirror {background: #2f1e2e; color: #b9b6b0;}
.cm-s-paraiso-dark div.CodeMirror-selected {background: #41323f !important;} .cm-s-paraiso-dark div.CodeMirror-selected {background: #41323f !important;}
.cm-s-paraiso-dark.CodeMirror ::selection { background: rgba(65, 50, 63, .99); } .cm-s-paraiso-dark .CodeMirror-line::selection, .cm-s-paraiso-dark .CodeMirror-line > span::selection, .cm-s-paraiso-dark .CodeMirror-line > span > span::selection { background: rgba(65, 50, 63, .99); }
.cm-s-paraiso-dark.CodeMirror ::-moz-selection { background: rgba(65, 50, 63, .99); } .cm-s-paraiso-dark .CodeMirror-line::-moz-selection, .cm-s-paraiso-dark .CodeMirror-line > span::-moz-selection, .cm-s-paraiso-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(65, 50, 63, .99); }
.cm-s-paraiso-dark .CodeMirror-gutters {background: #2f1e2e; border-right: 0px;} .cm-s-paraiso-dark .CodeMirror-gutters {background: #2f1e2e; border-right: 0px;}
.cm-s-paraiso-dark .CodeMirror-guttermarker { color: #ef6155; } .cm-s-paraiso-dark .CodeMirror-guttermarker { color: #ef6155; }
.cm-s-paraiso-dark .CodeMirror-guttermarker-subtle { color: #776e71; } .cm-s-paraiso-dark .CodeMirror-guttermarker-subtle { color: #776e71; }

View File

@ -10,8 +10,8 @@
.cm-s-paraiso-light.CodeMirror {background: #e7e9db; color: #41323f;} .cm-s-paraiso-light.CodeMirror {background: #e7e9db; color: #41323f;}
.cm-s-paraiso-light div.CodeMirror-selected {background: #b9b6b0 !important;} .cm-s-paraiso-light div.CodeMirror-selected {background: #b9b6b0 !important;}
.cm-s-paraiso-light.CodeMirror ::selection { background: #b9b6b0; } .cm-s-paraiso-light .CodeMirror-line::selection, .cm-s-paraiso-light .CodeMirror-line > span::selection, .cm-s-paraiso-light .CodeMirror-line > span > span::selection { background: #b9b6b0; }
.cm-s-paraiso-light.CodeMirror ::-moz-selection { background: #b9b6b0; } .cm-s-paraiso-light .CodeMirror-line::-moz-selection, .cm-s-paraiso-light .CodeMirror-line > span::-moz-selection, .cm-s-paraiso-light .CodeMirror-line > span > span::-moz-selection { background: #b9b6b0; }
.cm-s-paraiso-light .CodeMirror-gutters {background: #e7e9db; border-right: 0px;} .cm-s-paraiso-light .CodeMirror-gutters {background: #e7e9db; border-right: 0px;}
.cm-s-paraiso-light .CodeMirror-guttermarker { color: black; } .cm-s-paraiso-light .CodeMirror-guttermarker { color: black; }
.cm-s-paraiso-light .CodeMirror-guttermarker-subtle { color: #8d8687; } .cm-s-paraiso-light .CodeMirror-guttermarker-subtle { color: #8d8687; }

View File

@ -14,8 +14,8 @@
font-size: 14px; font-size: 14px;
} }
.cm-s-pastel-on-dark div.CodeMirror-selected { background: rgba(221,240,255,0.2) !important; } .cm-s-pastel-on-dark div.CodeMirror-selected { background: rgba(221,240,255,0.2) !important; }
.cm-s-pastel-on-dark.CodeMirror ::selection { background: rgba(221,240,255,0.2); } .cm-s-pastel-on-dark .CodeMirror-line::selection, .cm-s-pastel-on-dark .CodeMirror-line > span::selection, .cm-s-pastel-on-dark .CodeMirror-line > span > span::selection { background: rgba(221,240,255,0.2); }
.cm-s-pastel-on-dark.CodeMirror ::-moz-selection { background: rgba(221,240,255,0.2); } .cm-s-pastel-on-dark .CodeMirror-line::-moz-selection, .cm-s-pastel-on-dark .CodeMirror-line > span::-moz-selection, .cm-s-pastel-on-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(221,240,255,0.2); }
.cm-s-pastel-on-dark .CodeMirror-gutters { .cm-s-pastel-on-dark .CodeMirror-gutters {
background: #34302f; background: #34302f;

View File

@ -1,7 +1,7 @@
.cm-s-rubyblue.CodeMirror { background: #112435; color: white; } .cm-s-rubyblue.CodeMirror { background: #112435; color: white; }
.cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; } .cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; }
.cm-s-rubyblue.CodeMirror ::selection { background: rgba(56, 86, 111, 0.99); } .cm-s-rubyblue .CodeMirror-line::selection, .cm-s-rubyblue .CodeMirror-line > span::selection, .cm-s-rubyblue .CodeMirror-line > span > span::selection { background: rgba(56, 86, 111, 0.99); }
.cm-s-rubyblue.CodeMirror ::-moz-selection { background: rgba(56, 86, 111, 0.99); } .cm-s-rubyblue .CodeMirror-line::-moz-selection, .cm-s-rubyblue .CodeMirror-line > span::-moz-selection, .cm-s-rubyblue .CodeMirror-line > span > span::-moz-selection { background: rgba(56, 86, 111, 0.99); }
.cm-s-rubyblue .CodeMirror-gutters { background: #1F4661; border-right: 7px solid #3E7087; } .cm-s-rubyblue .CodeMirror-gutters { background: #1F4661; border-right: 7px solid #3E7087; }
.cm-s-rubyblue .CodeMirror-guttermarker { color: white; } .cm-s-rubyblue .CodeMirror-guttermarker { color: white; }
.cm-s-rubyblue .CodeMirror-guttermarker-subtle { color: #3E7087; } .cm-s-rubyblue .CodeMirror-guttermarker-subtle { color: #3E7087; }

View File

@ -47,6 +47,8 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
text-shadow: none; text-shadow: none;
} }
.cm-s-solarized .cm-header { color: #586e75; }
.cm-s-solarized .cm-quote { color: #93a1a1; }
.cm-s-solarized .cm-keyword { color: #cb4b16 } .cm-s-solarized .cm-keyword { color: #cb4b16 }
.cm-s-solarized .cm-atom { color: #d33682; } .cm-s-solarized .cm-atom { color: #d33682; }
@ -73,8 +75,6 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
.cm-s-solarized .CodeMirror-nonmatchingbracket { color: #dc322f; } .cm-s-solarized .CodeMirror-nonmatchingbracket { color: #dc322f; }
.cm-s-solarized .cm-tag { color: #93a1a1 } .cm-s-solarized .cm-tag { color: #93a1a1 }
.cm-s-solarized .cm-attribute { color: #2aa198; } .cm-s-solarized .cm-attribute { color: #2aa198; }
.cm-s-solarized .cm-header { color: #586e75; }
.cm-s-solarized .cm-quote { color: #93a1a1; }
.cm-s-solarized .cm-hr { .cm-s-solarized .cm-hr {
color: transparent; color: transparent;
border-top: 1px solid #586e75; border-top: 1px solid #586e75;
@ -96,11 +96,11 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
.cm-s-solarized.cm-s-dark .CodeMirror-selected { background: #073642; } .cm-s-solarized.cm-s-dark .CodeMirror-selected { background: #073642; }
.cm-s-solarized.cm-s-dark.CodeMirror ::selection { background: rgba(7, 54, 66, 0.99); } .cm-s-solarized.cm-s-dark.CodeMirror ::selection { background: rgba(7, 54, 66, 0.99); }
.cm-s-solarized.cm-s-dark.CodeMirror ::-moz-selection { background: rgba(7, 54, 66, 0.99); } .cm-s-solarized.cm-s-dark .CodeMirror-line::-moz-selection, .cm-s-dark .CodeMirror-line > span::-moz-selection, .cm-s-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(7, 54, 66, 0.99); }
.cm-s-solarized.cm-s-light .CodeMirror-selected { background: #eee8d5; } .cm-s-solarized.cm-s-light .CodeMirror-selected { background: #eee8d5; }
.cm-s-solarized.cm-s-light.CodeMirror ::selection { background: #eee8d5; } .cm-s-solarized.cm-s-light .CodeMirror-line::selection, .cm-s-light .CodeMirror-line > span::selection, .cm-s-light .CodeMirror-line > span > span::selection { background: #eee8d5; }
.cm-s-solarized.cm-s-lightCodeMirror ::-moz-selection { background: #eee8d5; } .cm-s-solarized.cm-s-light .CodeMirror-line::-moz-selection, .cm-s-ligh .CodeMirror-line > span::-moz-selection, .cm-s-ligh .CodeMirror-line > span > span::-moz-selection { background: #eee8d5; }
/* Editor styling */ /* Editor styling */

View File

@ -1,7 +1,7 @@
.cm-s-the-matrix.CodeMirror { background: #000000; color: #00FF00; } .cm-s-the-matrix.CodeMirror { background: #000000; color: #00FF00; }
.cm-s-the-matrix div.CodeMirror-selected { background: #2D2D2D !important; } .cm-s-the-matrix div.CodeMirror-selected { background: #2D2D2D !important; }
.cm-s-the-matrix.CodeMirror ::selection { background: rgba(45, 45, 45, 0.99); } .cm-s-the-matrix .CodeMirror-line::selection, .cm-s-the-matrix .CodeMirror-line > span::selection, .cm-s-the-matrix .CodeMirror-line > span > span::selection { background: rgba(45, 45, 45, 0.99); }
.cm-s-the-matrix.CodeMirror ::-moz-selection { background: rgba(45, 45, 45, 0.99); } .cm-s-the-matrix .CodeMirror-line::-moz-selection, .cm-s-the-matrix .CodeMirror-line > span::-moz-selection, .cm-s-the-matrix .CodeMirror-line > span > span::-moz-selection { background: rgba(45, 45, 45, 0.99); }
.cm-s-the-matrix .CodeMirror-gutters { background: #060; border-right: 2px solid #00FF00; } .cm-s-the-matrix .CodeMirror-gutters { background: #060; border-right: 2px solid #00FF00; }
.cm-s-the-matrix .CodeMirror-guttermarker { color: #0f0; } .cm-s-the-matrix .CodeMirror-guttermarker { color: #0f0; }
.cm-s-the-matrix .CodeMirror-guttermarker-subtle { color: white; } .cm-s-the-matrix .CodeMirror-guttermarker-subtle { color: white; }

View File

@ -10,8 +10,8 @@
.cm-s-tomorrow-night-eighties.CodeMirror {background: #000000; color: #CCCCCC;} .cm-s-tomorrow-night-eighties.CodeMirror {background: #000000; color: #CCCCCC;}
.cm-s-tomorrow-night-eighties div.CodeMirror-selected {background: #2D2D2D !important;} .cm-s-tomorrow-night-eighties div.CodeMirror-selected {background: #2D2D2D !important;}
.cm-s-tomorrow-night-eighties.CodeMirror ::selection { background: rgba(45, 45, 45, 0.99); } .cm-s-tomorrow-night-eighties .CodeMirror-line::selection, .cm-s-tomorrow-night-eighties .CodeMirror-line > span::selection, .cm-s-tomorrow-night-eighties .CodeMirror-line > span > span::selection { background: rgba(45, 45, 45, 0.99); }
.cm-s-tomorrow-night-eighties.CodeMirror ::-moz-selection { background: rgba(45, 45, 45, 0.99); } .cm-s-tomorrow-night-eighties .CodeMirror-line::-moz-selection, .cm-s-tomorrow-night-eighties .CodeMirror-line > span::-moz-selection, .cm-s-tomorrow-night-eighties .CodeMirror-line > span > span::-moz-selection { background: rgba(45, 45, 45, 0.99); }
.cm-s-tomorrow-night-eighties .CodeMirror-gutters {background: #000000; border-right: 0px;} .cm-s-tomorrow-night-eighties .CodeMirror-gutters {background: #000000; border-right: 0px;}
.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker { color: #f2777a; } .cm-s-tomorrow-night-eighties .CodeMirror-guttermarker { color: #f2777a; }
.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker-subtle { color: #777; } .cm-s-tomorrow-night-eighties .CodeMirror-guttermarker-subtle { color: #777; }

View File

@ -1,7 +1,7 @@
.cm-s-twilight.CodeMirror { background: #141414; color: #f7f7f7; } /**/ .cm-s-twilight.CodeMirror { background: #141414; color: #f7f7f7; } /**/
.cm-s-twilight .CodeMirror-selected { background: #323232 !important; } /**/ .cm-s-twilight .CodeMirror-selected { background: #323232 !important; } /**/
.cm-s-twilight.CodeMirror ::selection { background: rgba(50, 50, 50, 0.99); } .cm-s-twilight .CodeMirror-line::selection, .cm-s-twilight .CodeMirror-line > span::selection, .cm-s-twilight .CodeMirror-line > span > span::selection { background: rgba(50, 50, 50, 0.99); }
.cm-s-twilight.CodeMirror ::-moz-selection { background: rgba(50, 50, 50, 0.99); } .cm-s-twilight .CodeMirror-line::-moz-selection, .cm-s-twilight .CodeMirror-line > span::-moz-selection, .cm-s-twilight .CodeMirror-line > span > span::-moz-selection { background: rgba(50, 50, 50, 0.99); }
.cm-s-twilight .CodeMirror-gutters { background: #222; border-right: 1px solid #aaa; } .cm-s-twilight .CodeMirror-gutters { background: #222; border-right: 1px solid #aaa; }
.cm-s-twilight .CodeMirror-guttermarker { color: white; } .cm-s-twilight .CodeMirror-guttermarker { color: white; }

View File

@ -2,8 +2,8 @@
.cm-s-vibrant-ink.CodeMirror { background: black; color: white; } .cm-s-vibrant-ink.CodeMirror { background: black; color: white; }
.cm-s-vibrant-ink .CodeMirror-selected { background: #35493c !important; } .cm-s-vibrant-ink .CodeMirror-selected { background: #35493c !important; }
.cm-s-vibrant-ink.CodeMirror ::selection { background: rgba(53, 73, 60, 0.99); } .cm-s-vibrant-ink .CodeMirror-line::selection, .cm-s-vibrant-ink .CodeMirror-line > span::selection, .cm-s-vibrant-ink .CodeMirror-line > span > span::selection { background: rgba(53, 73, 60, 0.99); }
.cm-s-vibrant-ink.CodeMirror ::-moz-selection { background: rgba(53, 73, 60, 0.99); } .cm-s-vibrant-ink .CodeMirror-line::-moz-selection, .cm-s-vibrant-ink .CodeMirror-line > span::-moz-selection, .cm-s-vibrant-ink .CodeMirror-line > span > span::-moz-selection { background: rgba(53, 73, 60, 0.99); }
.cm-s-vibrant-ink .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } .cm-s-vibrant-ink .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }
.cm-s-vibrant-ink .CodeMirror-guttermarker { color: white; } .cm-s-vibrant-ink .CodeMirror-guttermarker { color: white; }

View File

@ -22,8 +22,8 @@ THE SOFTWARE.
*/ */
.cm-s-xq-dark.CodeMirror { background: #0a001f; color: #f8f8f8; } .cm-s-xq-dark.CodeMirror { background: #0a001f; color: #f8f8f8; }
.cm-s-xq-dark .CodeMirror-selected { background: #27007A !important; } .cm-s-xq-dark .CodeMirror-selected { background: #27007A !important; }
.cm-s-xq-dark.CodeMirror ::selection { background: rgba(39, 0, 122, 0.99); } .cm-s-xq-dark .CodeMirror-line::selection, .cm-s-xq-dark .CodeMirror-line > span::selection, .cm-s-xq-dark .CodeMirror-line > span > span::selection { background: rgba(39, 0, 122, 0.99); }
.cm-s-xq-dark.CodeMirror ::-moz-selection { background: rgba(39, 0, 122, 0.99); } .cm-s-xq-dark .CodeMirror-line::-moz-selection, .cm-s-xq-dark .CodeMirror-line > span::-moz-selection, .cm-s-xq-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(39, 0, 122, 0.99); }
.cm-s-xq-dark .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } .cm-s-xq-dark .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; }
.cm-s-xq-dark .CodeMirror-guttermarker { color: #FFBD40; } .cm-s-xq-dark .CodeMirror-guttermarker { color: #FFBD40; }
.cm-s-xq-dark .CodeMirror-guttermarker-subtle { color: #f8f8f8; } .cm-s-xq-dark .CodeMirror-guttermarker-subtle { color: #f8f8f8; }