Permalink
...
sdegutis
commented on
Comparing changes
Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Choose a Base Repository
codemirror/CodeMirror
Benvie/CodeMirror
BrendonSled/CodeMirror2
Brijen/CodeMirror2
CodePen/CodeMirrorEditor
DarioGT/CodeMirror2
GerHobbelt/CodeMirror2
GordonSmith/CodeMirror2
Gozala/CodeMirror
Kodowa/CodeMirror
MariusKarthaus/CodeMirror2
MichaelaIvanova/CodeMirror
NV/CodeMirror
Naatan/CodeMirror2
Nahrae/CodeMirror
Necrathex/CodeMirror2
NikhilS/CodeMirror2
Page-/CodeMirror2
ProPuke/CodeMirror2
Raynes/CodeMirror2
SimonWaldherrArchive/CodeMirror2
Suor/CodeMirror2
TheColorRed/CodeMirror2
TypedLambda/CodeMirror2
Visheshk/CodeMirror2
WebKutir/CodeMirror2
WolfgangKluge/CodeMirror2
achicu/CodeMirror2
adam-singer/CodeMirror2
adanlobato/CodeMirror2
adobe/CodeMirror2
aklaswad/CodeMirror2
alexey-k/CodeMirror2
amphro/CodeMirror2
ananyasen/CodeMirror2
andrecharland/CodeMirror2
ankit/CodeMirror2
areos/CodeMirror2
atul-bhouraskar/CodeMirror2
ayachi/CodeMirror2
benbunk/CodeMirror2
bengillies/CodeMirror2
billortell/CodeMirror2
blackvladimir/CodeMirror2
bnowel/CodeMirror2
borawjm/CodeMirror2
botelho/CodeMirror
bridger/CodeMirror2
bsletten/CodeMirror2
capacman/CodeMirror2
captn3m0/CodeMirror2
cethap/CodeMirror2
charles-cai/CodeMirror2
charlieroberts/CodeMirror2
chendeng/CodeMirror2
chris-morgan/CodeMirror2
cicloid/CodeMirror2
ciptard/CodeMirror2
clarkbox/CodeMirror2
clemos/CodeMirror2
cliffkoh/CodeMirror2
cloudgiant/CodeMirror2
codio/CodeMirror
contributed/CodeMirror2
dbja/CodeMirror2
deebugger/CodeMirror2
djiang/CodeMirror2
durdn/CodeMirror2
dxw/CodeMirror2
dynosmurf/CodeMirror2
dyoo/CodeMirror2
ekhaled/CodeMirror2
enjalot/CodeMirror2
espadrine/CodeMirror
est/CodeMirror2
existdissolve/CodeMirror2
fbuchinger/CodeMirror2
felmoon/CodeMirror2
femhub/CodeMirror2
flyabroad/CodeMirror2
fourchette/CodeMirror2
fpo123/CodeMirror2
fprochazka/CodeMirror2
frawa/TestCodeMirror2
fzzr-/CodeMirror2
galambalazs/CodeMirror2
gavriguy/CodeMirror2
gbv/CodeMirror2
greengiant/CodeMirror2
guidokessels/CodeMirror2
gzdw/CodeMirror2
hans/CodeMirror2
hanxianlong/CodeMirror2
ibdknox/CodeMirror
idflood/CodeMirror2
infinnity/CodeMirror2
ingrid/CodeMirror2
j6mes/CodeMirror2
jankeromnes/CodeMirror
jasondavis/CodeMirror2
jbrinkman/CodeMirror2
jem/CodeMirror2
jenlure/CodeMirror2
jimmyoneill/CodeMirror2
jmwong/CodeMirror2
jongalloway/CodeMirror2
jots/CodeMirror2
joycse06/CodeMirror2
jurisv/CodeMirror2
kaniga/CodeMirror2
kasei/CodeMirror2
kjetilk/CodeMirror2
koide/CodeMirror2
koops/CodeMirror2
krockot/CodeMirror2
larscwallin/CodeMirror2
leafo/CodeMirror2
lgastako/CodeMirror2
lm/CodeMirror2
lopuhin/CodeMirror2
luojun/CodeMirror2
luqui/CodeMirror2
maks/CodeMirror2
mamboer/CodeMirror2
manyanlong/CodeMirror2
massemanet/CodeMirror
maxkirsch/CodeMirror2
mb-crt/CodeMirror2
mbarkhau/CodeMirror2
mbrevoort/CodeMirror2-xquery
mcelrath/CodeMirror2
metzen/CodeMirror2
michalliu/CodeMirror2
michelemostarda/CodeMirror2
mimecuvalo/CodeMirror2
misfo/CodeMirror2
mixonic/CodeMirror
moon2l/CodeMirror2
movabletype/CodeMirror2
mozes/CodeMirror2
mwmessin/CodeMirror2
mwpark/CodeMirror2
mzero/CodeMirror2
nathansobo/CodeMirror2
nazriel/CodeMirror2
ndebeiss/CodeMirror2
nguillaumin/CodeMirror2
nickmoorman/CodeMirror2
nitrous-io-zz/CodeMirror
njx/CodeMirror
nlwillia/CodeMirror2
nvdnkpr/CodeMirror2
onkis/CodeMirror2
oozou/CodeMirror2
openube/CodeMirror2
oxling/CodeMirror2
panchalmukundak/CodeMirror2
pavelfeldman/CodeMirror
peteguhl/CodeMirror2
peterarmstrong/CodeMirror2
peterkroon/CodeMirror2
pombredanne/CodeMirror2
pplaquette/CodeMirror2
purplecabbage/CodeMirror2
rascalmicro/CodeMirror2
rduenasf/CodeMirror2
robermorales/CodeMirror2
robhawkes/CodeMirror2
samuela/CodeMirror2
satchit/CodeMirror2
seanmcgary/CodeMirror2
siefkenj/CodeMirror2
simoneau/CodeMirror2
skirmish/CodeMirror2
skoon/CodeMirror2
sourcelair/CodeMirror
sparkartgroup-archive/CodeMirror2
strax/CodeMirror2
syntagmatic/CodeMirror2
tarr11/CodeMirror2
timelyportfolio/codemirrorR
tpiccinini/CodeMirror2
treeform/CodeMirror2
ttscoff/CodeMirror2
tvoliter/CodeMirror2
uboness/CodeMirror2
utahguy/CodeMirror2
vegastexteditor/CodeMirror2
vestimir/CodeMirror2
vmx/CodeMirror2
vodori/CodeMirror2
waywardmonkeys/CodeMirror
whalefood/CodeMirror2
wmchristie/CodeMirror2
wwwlicious/CodeMirror2
xsocher/CodeMirror2
youngrok/CodeMirror2
zarazi/CodeMirror2
zires/CodeMirror2
zptcsoft/CodeMirror
Nothing to show
Choose a base branch
Nothing to show
Choose a Head Repository
codemirror/CodeMirror
Benvie/CodeMirror
BrendonSled/CodeMirror2
Brijen/CodeMirror2
CodePen/CodeMirrorEditor
DarioGT/CodeMirror2
GerHobbelt/CodeMirror2
GordonSmith/CodeMirror2
Gozala/CodeMirror
Kodowa/CodeMirror
MariusKarthaus/CodeMirror2
MichaelaIvanova/CodeMirror
NV/CodeMirror
Naatan/CodeMirror2
Nahrae/CodeMirror
Necrathex/CodeMirror2
NikhilS/CodeMirror2
Page-/CodeMirror2
ProPuke/CodeMirror2
Raynes/CodeMirror2
SimonWaldherrArchive/CodeMirror2
Suor/CodeMirror2
TheColorRed/CodeMirror2
TypedLambda/CodeMirror2
Visheshk/CodeMirror2
WebKutir/CodeMirror2
WolfgangKluge/CodeMirror2
achicu/CodeMirror2
adam-singer/CodeMirror2
adanlobato/CodeMirror2
adobe/CodeMirror2
aklaswad/CodeMirror2
alexey-k/CodeMirror2
amphro/CodeMirror2
ananyasen/CodeMirror2
andrecharland/CodeMirror2
ankit/CodeMirror2
areos/CodeMirror2
atul-bhouraskar/CodeMirror2
ayachi/CodeMirror2
benbunk/CodeMirror2
bengillies/CodeMirror2
billortell/CodeMirror2
blackvladimir/CodeMirror2
bnowel/CodeMirror2
borawjm/CodeMirror2
botelho/CodeMirror
bridger/CodeMirror2
bsletten/CodeMirror2
capacman/CodeMirror2
captn3m0/CodeMirror2
cethap/CodeMirror2
charles-cai/CodeMirror2
charlieroberts/CodeMirror2
chendeng/CodeMirror2
chris-morgan/CodeMirror2
cicloid/CodeMirror2
ciptard/CodeMirror2
clarkbox/CodeMirror2
clemos/CodeMirror2
cliffkoh/CodeMirror2
cloudgiant/CodeMirror2
codio/CodeMirror
contributed/CodeMirror2
dbja/CodeMirror2
deebugger/CodeMirror2
djiang/CodeMirror2
durdn/CodeMirror2
dxw/CodeMirror2
dynosmurf/CodeMirror2
dyoo/CodeMirror2
ekhaled/CodeMirror2
enjalot/CodeMirror2
espadrine/CodeMirror
est/CodeMirror2
existdissolve/CodeMirror2
fbuchinger/CodeMirror2
felmoon/CodeMirror2
femhub/CodeMirror2
flyabroad/CodeMirror2
fourchette/CodeMirror2
fpo123/CodeMirror2
fprochazka/CodeMirror2
frawa/TestCodeMirror2
fzzr-/CodeMirror2
galambalazs/CodeMirror2
gavriguy/CodeMirror2
gbv/CodeMirror2
greengiant/CodeMirror2
guidokessels/CodeMirror2
gzdw/CodeMirror2
hans/CodeMirror2
hanxianlong/CodeMirror2
ibdknox/CodeMirror
idflood/CodeMirror2
infinnity/CodeMirror2
ingrid/CodeMirror2
j6mes/CodeMirror2
jankeromnes/CodeMirror
jasondavis/CodeMirror2
jbrinkman/CodeMirror2
jem/CodeMirror2
jenlure/CodeMirror2
jimmyoneill/CodeMirror2
jmwong/CodeMirror2
jongalloway/CodeMirror2
jots/CodeMirror2
joycse06/CodeMirror2
jurisv/CodeMirror2
kaniga/CodeMirror2
kasei/CodeMirror2
kjetilk/CodeMirror2
koide/CodeMirror2
koops/CodeMirror2
krockot/CodeMirror2
larscwallin/CodeMirror2
leafo/CodeMirror2
lgastako/CodeMirror2
lm/CodeMirror2
lopuhin/CodeMirror2
luojun/CodeMirror2
luqui/CodeMirror2
maks/CodeMirror2
mamboer/CodeMirror2
manyanlong/CodeMirror2
massemanet/CodeMirror
maxkirsch/CodeMirror2
mb-crt/CodeMirror2
mbarkhau/CodeMirror2
mbrevoort/CodeMirror2-xquery
mcelrath/CodeMirror2
metzen/CodeMirror2
michalliu/CodeMirror2
michelemostarda/CodeMirror2
mimecuvalo/CodeMirror2
misfo/CodeMirror2
mixonic/CodeMirror
moon2l/CodeMirror2
movabletype/CodeMirror2
mozes/CodeMirror2
mwmessin/CodeMirror2
mwpark/CodeMirror2
mzero/CodeMirror2
nathansobo/CodeMirror2
nazriel/CodeMirror2
ndebeiss/CodeMirror2
nguillaumin/CodeMirror2
nickmoorman/CodeMirror2
nitrous-io-zz/CodeMirror
njx/CodeMirror
nlwillia/CodeMirror2
nvdnkpr/CodeMirror2
onkis/CodeMirror2
oozou/CodeMirror2
openube/CodeMirror2
oxling/CodeMirror2
panchalmukundak/CodeMirror2
pavelfeldman/CodeMirror
peteguhl/CodeMirror2
peterarmstrong/CodeMirror2
peterkroon/CodeMirror2
pombredanne/CodeMirror2
pplaquette/CodeMirror2
purplecabbage/CodeMirror2
rascalmicro/CodeMirror2
rduenasf/CodeMirror2
robermorales/CodeMirror2
robhawkes/CodeMirror2
samuela/CodeMirror2
satchit/CodeMirror2
seanmcgary/CodeMirror2
siefkenj/CodeMirror2
simoneau/CodeMirror2
skirmish/CodeMirror2
skoon/CodeMirror2
sourcelair/CodeMirror
sparkartgroup-archive/CodeMirror2
strax/CodeMirror2
syntagmatic/CodeMirror2
tarr11/CodeMirror2
timelyportfolio/codemirrorR
tpiccinini/CodeMirror2
treeform/CodeMirror2
ttscoff/CodeMirror2
tvoliter/CodeMirror2
uboness/CodeMirror2
utahguy/CodeMirror2
vegastexteditor/CodeMirror2
vestimir/CodeMirror2
vmx/CodeMirror2
vodori/CodeMirror2
waywardmonkeys/CodeMirror
whalefood/CodeMirror2
wmchristie/CodeMirror2
wwwlicious/CodeMirror2
xsocher/CodeMirror2
youngrok/CodeMirror2
zarazi/CodeMirror2
zires/CodeMirror2
zptcsoft/CodeMirror
Nothing to show
Choose a head branch
Nothing to show
11
contributors
Commits on Aug 21, 2014
|
|
marijnh |
Bump version number post-4.5.0
|
01b8a88
|
Commits on Aug 23, 2014
|
|
marijnh |
Bound retry count in measureCharInner hack for wrapping characters
|
b62d6b0
|
|||
|
|
marijnh |
Work around odd safari behavior in bad bidi rect feature detection
Issue #2780 |
b313482
|
Commits on Aug 26, 2014
Commits on Aug 27, 2014
|
|
anfedorov + marijnh |
[python mode] Make 'in' a keyword
|
027e577
|
Commits on Aug 28, 2014
|
|
kumak1 + marijnh |
[release notes] Fix section structure
|
4337996
|
Commits on Sep 01, 2014
|
|
marijnh |
Export findWordAt
Closes #2790 |
3d8c1e5
|
|||
|
|
marijnh |
[merge addon] Add diff_match_patch as explicit dependency
Closes #2783 |
9b87ca9
|
|||
|
|
marijnh |
Add Hebrew code range to nonASCIISingleCaseWordChar regexp
Fixes detection of Hebrew letters as word characters Closes #2789 |
59b7b90
|
|||
|
|
marijnh |
Force scroll update from swapDoc
Issue #2714 |
623eb7b
|
|||
|
|
marijnh |
[sass mode] Make sure indentCount is initialized propertly
Issue #2786 |
376f3ec
|
Commits on Sep 03, 2014
Commits on Sep 04, 2014
|
|
marijnh |
Only apply IE<11 zooming compensation for client rects when getting r…
…ect from a range It does not happen when measuring a node Issue #2665 |
17c992e
|
Commits on Sep 08, 2014
|
|
marijnh |
[closetag addon] Work better with htmlmixed mode
It now closes script and style tags when the slash is typed Closes #2797 |
616339b
|
|||
|
|
marijnh |
[javascript mode] Fix parsing of argument-less fat arrow functions
Closes #2794 |
7817708
|
|||
|
|
marijnh |
[smalltalk mode] Use \s instead of space in regexps that denote white…
…space Closes #2796 |
0a91c14
|
Commits on Sep 09, 2014
|
|
marijnh |
Add a requireJS demo
|
1adaa01
|
|||
|
|
MarcelGerber + marijnh |
Improve isWordChar() for Arabic language
|
c012f41
|
Commits on Sep 15, 2014
|
|
marijnh |
Fix handling of electricChars in multi-line edits
Closes #2804 |
8fac50a
|
|||
|
|
mbonaci + marijnh |
Make parentheses visible while under `matchingbracket` rule
Code: Brackets now become black when they are highlighted as "matching". JSON: key names are now in "white" (json was a bit saturated with orange - keys and string values). Cleanup: removed some unnecessary rules. Default face color normalized to #ffffec (was #ffffe9). |
c2ee5a6
|
|||
|
|
marijnh |
[show-hint addon] Give active hint color more precedence
To make it easy for client code to color completions without clashing with the selected styling. |
fcacef1
|
Commits on Sep 16, 2014
|
|
snasa + marijnh |
Update shell.js
|
640fbb2
|
Commits on Sep 17, 2014
|
|
danieleds + marijnh |
Added wordsOnly option. Updated documentation.
|
f09b6c5
|
Commits on Sep 18, 2014
Commits on Sep 19, 2014
|
|
marijnh |
[xml mode] Mark <menuitem> as self-closing tag
Closes #2810 |
a49b0fd
|
|||
|
|
marijnh |
[rst mode] Remove assertion mechanism
Throwing exceptions is a really bad way to deal with unexpected syntax in a highlighting mode. Closes #2805 |
6338ef8
|
|||
|
|
Hawkers + marijnh |
Update realworld.html
Added hawkee.com |
bb8996c
|
|||
|
|
marijnh |
Mark release 4.6
|
24bec6e
|
Unified
Split
Showing
with
607 additions
and 161 deletions.
- +7 −0 AUTHORS
- +5 −2 addon/dialog/dialog.js
- +18 −4 addon/edit/closetag.js
- +2 −2 addon/hint/html-hint.js
- +1 −1 addon/hint/show-hint.css
- +6 −6 addon/merge/merge.js
- +28 −4 addon/search/match-highlighter.js
- +1 −1 bower.json
- +12 −5 demo/markselection.html
- +52 −0 demo/requirejs.html
- +2 −0 doc/compress.html
- +42 −9 doc/manual.html
- +1 −0 doc/realworld.html
- +16 −3 doc/releases.html
- +1 −1 index.html
- +9 −1 lib/codemirror.css
- +32 −32 lib/codemirror.js
- +1 −0 mode/htmlmixed/htmlmixed.js
- +1 −0 mode/index.html
- +3 −5 mode/javascript/javascript.js
- +5 −13 mode/markdown/markdown.js
- +1 −1 mode/markdown/test.js
- +1 −0 mode/meta.js
- +67 −0 mode/modelica/index.html
- +245 −0 mode/modelica/modelica.js
- +2 −2 mode/python/python.js
- +29 −50 mode/rst/rst.js
- +1 −0 mode/sass/sass.js
- +2 −1 mode/shell/shell.js
- +2 −2 mode/smalltalk/smalltalk.js
- +1 −1 mode/xml/xml.js
- +1 −1 package.json
- +10 −14 theme/mbo.css
View
7
AUTHORS
| @@ -33,6 +33,7 @@ Anders Nawroth | ||
| Anderson Mesquita | ||
| Andreas Reischuck | ||
| Andre von Houck | ||
| +Andrey Fedorov | ||
| Andrey Lushnikov | ||
| Andy Joslin | ||
| Andy Kimball | ||
| @@ -84,6 +85,7 @@ dagsta | ||
| daines | ||
| Dan Heberden | ||
| Daniel, Dao Quang Minh | ||
| +Daniele Di Sarli | ||
| Daniel Faust | ||
| Daniel Huigens | ||
| Daniel KJ | ||
| @@ -145,6 +147,7 @@ Hakan Tunc | ||
| Hans Engel | ||
| Hardest | ||
| Hasan Karahan | ||
| +Hiroyuki Makino | ||
| hitsthings | ||
| Hocdoc | ||
| Ian Beck | ||
| @@ -215,6 +218,7 @@ Leonid Khachaturov | ||
| Leonya Khachaturov | ||
| Liam Newman | ||
| LM | ||
| +lochel | ||
| Lorenzo Stoakes | ||
| Luciano Longo | ||
| lynschinzer | ||
| @@ -223,6 +227,7 @@ Maksym Taran | ||
| Malay Majithia | ||
| Manuel Rego Casasnovas | ||
| Marat Dreizin | ||
| +Marcel Gerber | ||
| Marco Aurélio | ||
| Marco Munizaga | ||
| Marcus Bointon | ||
| @@ -316,6 +321,7 @@ Sascha Peilicke | ||
| satchmorun | ||
| sathyamoorthi | ||
| SCLINIC\jdecker | ||
| +Scott Aikin | ||
| Sebastian Zaha | ||
| shaund | ||
| shaun gilchrist | ||
| @@ -324,6 +330,7 @@ sheopory | ||
| Shiv Deepak | ||
| Shmuel Englard | ||
| Shubham Jain | ||
| +snasa | ||
| soliton4 | ||
| sonson | ||
| spastorelli | ||
View
7
addon/dialog/dialog.js
| @@ -129,8 +129,8 @@ | ||
| CodeMirror.defineExtension("openNotification", function(template, options) { | ||
| closeNotification(this, close); | ||
| var dialog = dialogDiv(this, template, options && options.bottom); | ||
| - var duration = options && (options.duration === undefined ? 5000 : options.duration); | ||
| var closed = false, doneTimer; | ||
| + var duration = options && typeof options.duration !== "undefined" ? options.duration : 5000; | ||
| function close() { | ||
| if (closed) return; | ||
| @@ -143,7 +143,10 @@ | ||
| CodeMirror.e_preventDefault(e); | ||
| close(); | ||
| }); | ||
| + | ||
| if (duration) | ||
| - doneTimer = setTimeout(close, options.duration); | ||
| + doneTimer = setTimeout(close, duration); | ||
| + | ||
| + return close; | ||
| }); | ||
| }); | ||
View
22
addon/edit/closetag.js
| @@ -102,11 +102,25 @@ | ||
| var pos = ranges[i].head, tok = cm.getTokenAt(pos); | ||
| var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state; | ||
| if (tok.type == "string" || tok.string.charAt(0) != "<" || | ||
| - tok.start != pos.ch - 1 || inner.mode.name != "xml" || | ||
| - !state.context || !state.context.tagName || | ||
| - closingTagExists(cm, state.context.tagName, pos, state)) | ||
| + tok.start != pos.ch - 1) | ||
| return CodeMirror.Pass; | ||
| - replacements[i] = "/" + state.context.tagName + ">"; | ||
| + // Kludge to get around the fact that we are not in XML mode | ||
| + // when completing in JS/CSS snippet in htmlmixed mode. Does not | ||
| + // work for other XML embedded languages (there is no general | ||
| + // way to go from a mixed mode to its current XML state). | ||
| + if (inner.mode.name != "xml") { | ||
| + if (cm.getMode().name == "htmlmixed" && inner.mode.name == "javascript") | ||
| + replacements[i] = "/script>"; | ||
| + else if (cm.getMode().name == "htmlmixed" && inner.mode.name == "css") | ||
| + replacements[i] = "/style>"; | ||
| + else | ||
| + return CodeMirror.Pass; | ||
| + } else { | ||
| + if (!state.context || !state.context.tagName || | ||
| + closingTagExists(cm, state.context.tagName, pos, state)) | ||
| + return CodeMirror.Pass; | ||
| + replacements[i] = "/" + state.context.tagName + ">"; | ||
| + } | ||
| } | ||
| cm.replaceSelections(replacements); | ||
| ranges = cm.listSelections(); | ||
View
4
addon/hint/html-hint.js
| @@ -3,9 +3,9 @@ | ||
| (function(mod) { | ||
| if (typeof exports == "object" && typeof module == "object") // CommonJS | ||
| - mod(require("../../lib/codemirror")); | ||
| + mod(require("../../lib/codemirror", "./xml-hint")); | ||
| else if (typeof define == "function" && define.amd) // AMD | ||
| - define(["../../lib/codemirror"], mod); | ||
| + define(["../../lib/codemirror", "./xml-hint"], mod); | ||
| else // Plain browser env | ||
| mod(CodeMirror); | ||
| })(function(CodeMirror) { | ||
View
2
addon/hint/show-hint.css
| @@ -32,7 +32,7 @@ | ||
| cursor: pointer; | ||
| } | ||
| -.CodeMirror-hint-active { | ||
| +li.CodeMirror-hint-active { | ||
| background: #08f; | ||
| color: white; | ||
| } | ||
View
12
addon/merge/merge.js
| @@ -1,17 +1,17 @@ | ||
| // CodeMirror, copyright (c) by Marijn Haverbeke and others | ||
| // Distributed under an MIT license: http://codemirror.net/LICENSE | ||
| +// declare global: diff_match_patch, DIFF_INSERT, DIFF_DELETE, DIFF_EQUAL | ||
| + | ||
| (function(mod) { | ||
| if (typeof exports == "object" && typeof module == "object") // CommonJS | ||
| - mod(require("../../lib/codemirror")); | ||
| + mod(require("../../lib/codemirror"), require("diff_match_patch")); | ||
| else if (typeof define == "function" && define.amd) // AMD | ||
| - define(["../../lib/codemirror"], mod); | ||
| + define(["../../lib/codemirror", "diff_match_patch"], mod); | ||
| else // Plain browser env | ||
| - mod(CodeMirror); | ||
| -})(function(CodeMirror) { | ||
| + mod(CodeMirror, diff_match_patch); | ||
| +})(function(CodeMirror, diff_match_patch) { | ||
| "use strict"; | ||
| - // declare global: diff_match_patch, DIFF_INSERT, DIFF_DELETE, DIFF_EQUAL | ||
| - | ||
| var Pos = CodeMirror.Pos; | ||
| var svgNS = "http://www.w3.org/2000/svg"; | ||
View
32
addon/search/match-highlighter.js
| @@ -8,12 +8,15 @@ | ||
| // document. | ||
| // | ||
| // The option can be set to true to simply enable it, or to a | ||
| -// {minChars, style, showToken} object to explicitly configure it. | ||
| -// minChars is the minimum amount of characters that should be | ||
| +// {minChars, style, wordsOnly, showToken, delay} object to explicitly | ||
| +// configure it. minChars is the minimum amount of characters that should be | ||
| // selected for the behavior to occur, and style is the token style to | ||
| // apply to the matches. This will be prefixed by "cm-" to create an | ||
| -// actual CSS class name. showToken, when enabled, will cause the | ||
| -// current token to be highlighted when nothing is selected. | ||
| +// actual CSS class name. If wordsOnly is enabled, the matches will be | ||
| +// highlighted only if the selected text is a word. showToken, when enabled, | ||
| +// will cause the current token to be highlighted when nothing is selected. | ||
| +// delay is used to specify how much time to wait, in milliseconds, before | ||
| +// highlighting the matches. | ||
| (function(mod) { | ||
| if (typeof exports == "object" && typeof module == "object") // CommonJS | ||
| @@ -28,17 +31,20 @@ | ||
| var DEFAULT_MIN_CHARS = 2; | ||
| var DEFAULT_TOKEN_STYLE = "matchhighlight"; | ||
| var DEFAULT_DELAY = 100; | ||
| + var DEFAULT_WORDS_ONLY = false; | ||
| function State(options) { | ||
| if (typeof options == "object") { | ||
| this.minChars = options.minChars; | ||
| this.style = options.style; | ||
| this.showToken = options.showToken; | ||
| this.delay = options.delay; | ||
| + this.wordsOnly = options.wordsOnly; | ||
| } | ||
| if (this.style == null) this.style = DEFAULT_TOKEN_STYLE; | ||
| if (this.minChars == null) this.minChars = DEFAULT_MIN_CHARS; | ||
| if (this.delay == null) this.delay = DEFAULT_DELAY; | ||
| + if (this.wordsOnly == null) this.wordsOnly = DEFAULT_WORDS_ONLY; | ||
| this.overlay = this.timeout = null; | ||
| } | ||
| @@ -81,12 +87,30 @@ | ||
| } | ||
| var from = cm.getCursor("from"), to = cm.getCursor("to"); | ||
| if (from.line != to.line) return; | ||
| + if (state.wordsOnly && !isWord(cm, from, to)) return; | ||
| var selection = cm.getRange(from, to).replace(/^\s+|\s+$/g, ""); | ||
| if (selection.length >= state.minChars) | ||
| cm.addOverlay(state.overlay = makeOverlay(selection, false, state.style)); | ||
| }); | ||
| } | ||
| + function isWord(cm, from, to) { | ||
| + var str = cm.getRange(from, to); | ||
| + if (str.match(/^\w+$/) !== null) { | ||
| + if (from.ch > 0) { | ||
| + var pos = {line: from.line, ch: from.ch - 1}; | ||
| + var chr = cm.getRange(pos, from); | ||
| + if (chr.match(/\W/) === null) return false; | ||
| + } | ||
| + if (to.ch < cm.getLine(from.line).length) { | ||
| + var pos = {line: to.line, ch: to.ch + 1}; | ||
| + var chr = cm.getRange(to, pos); | ||
| + if (chr.match(/\W/) === null) return false; | ||
| + } | ||
| + return true; | ||
| + } else return false; | ||
| + } | ||
| + | ||
| function boundariesAround(stream, re) { | ||
| return (!stream.start || !re.test(stream.string.charAt(stream.start - 1))) && | ||
| (stream.pos == stream.string.length || !re.test(stream.string.charAt(stream.pos))); | ||
View
2
bower.json
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "name": "codemirror", | ||
| - "version":"4.5.0", | ||
| + "version":"4.6.0", | ||
| "main": ["lib/codemirror.js", "lib/codemirror.css"], | ||
| "ignore": [ | ||
| "**/.*", | ||
View
17
demo/markselection.html
| @@ -12,6 +12,7 @@ | ||
| .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;} | ||
| .CodeMirror-selected { background-color: blue !important; } | ||
| .CodeMirror-selectedtext { color: white; } | ||
| + .styled-background { background-color: #ff7; } | ||
| </style> | ||
| <div id=nav> | ||
| <a href="http://codemirror.net"><img id=logo src="../doc/logo.png"></a> | ||
| @@ -28,18 +29,24 @@ | ||
| <article> | ||
| <h2>Selection Marking Demo</h2> | ||
| -<form><textarea id="code" name="code">Select something from here. | ||
| -You'll see that the selection's foreground color changes to white! | ||
| -Since, by default, CodeMirror only puts an independent "marker" layer | ||
| -behind the text, you'll need something like this to change its colour.</textarea></form> | ||
| +<form><textarea id="code" name="code"> | ||
| +Select something from here. You'll see that the selection's foreground | ||
| +color changes to white! Since, by default, CodeMirror only puts an | ||
| +independent "marker" layer behind the text, you'll need something like | ||
| +this to change its colour. | ||
| + | ||
| +Also notice that turning this addon on (with the default style) allows | ||
| +you to safely give text a background color without screwing up the | ||
| +visibility of the selection.</textarea></form> | ||
| <script> | ||
| var editor = CodeMirror.fromTextArea(document.getElementById("code"), { | ||
| lineNumbers: true, | ||
| styleSelectedText: true | ||
| }); | ||
| +editor.markText({line: 6, ch: 26}, {line: 6, ch: 42}, {className: "styled-background"}); | ||
| </script> | ||
| - <p>Simple addon to easily mark (and style) selected text.</p> | ||
| + <p>Simple addon to easily mark (and style) selected text. <a href="../doc/manual.html#addon_mark-selection">Docs</a>.</p> | ||
| </article> | ||
View
52
demo/requirejs.html
| @@ -0,0 +1,52 @@ | ||
| +<!doctype html> | ||
| + | ||
| +<head> | ||
| + <title>CodeMirror: HTML completion demo</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="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.14/require.min.js"></script> | ||
| + <style type="text/css"> | ||
| + .CodeMirror {border-top: 1px solid #888; border-bottom: 1px solid #888;} | ||
| + </style> | ||
| +</head> | ||
| + | ||
| +<body> | ||
| + <div id=nav> | ||
| + <a href="http://codemirror.net"><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/marijnh/codemirror">Code</a> | ||
| + </ul> | ||
| + <ul> | ||
| + <li><a class=active href="#">HTML completion</a> | ||
| + </ul> | ||
| + </div> | ||
| + | ||
| + <article> | ||
| + <h2>RequireJS module loading demo</h2> | ||
| + | ||
| + <p>This demo does the same thing as | ||
| + the <a href="html5complete.html">HTML5 completion demo</a>, but | ||
| + loads its dependencies | ||
| + with <a href="http://requirejs.org/">Require.js</a>, rather than | ||
| + explicitly. Press <strong>ctrl-space</strong> to activate | ||
| + completion.</p> | ||
| + | ||
| + <div id="code"></div> | ||
| + | ||
| + <script type="text/javascript"> | ||
| + require(["../lib/codemirror", "../mode/htmlmixed/htmlmixed", | ||
| + "../addon/hint/show-hint", "../addon/hint/html-hint"], function(CodeMirror) { | ||
| + editor = CodeMirror(document.getElementById("code"), { | ||
| + mode: "text/html", | ||
| + extraKeys: {"Ctrl-Space": "autocomplete"}, | ||
| + value: document.documentElement.innerHTML | ||
| + }); | ||
| + }); | ||
| + </script> | ||
| + </article> | ||
| +</body> |
View
2
doc/compress.html
| @@ -36,6 +36,7 @@ | ||
| <input type="hidden" id="download" name="download" value="codemirror-compressed.js"/> | ||
| <p>Version: <select id="version" onchange="setVersion(this);" style="padding: 1px;"> | ||
| <option value="http://codemirror.net/">HEAD</option> | ||
| + <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=4.6.0;f=">4.6</option> | ||
| <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=4.5.0;f=">4.5</option> | ||
| <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=4.4.0;f=">4.4</option> | ||
| <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=4.3.0;f=">4.3</option> | ||
| @@ -131,6 +132,7 @@ | ||
| <option value="http://codemirror.net/mode/markdown/markdown.js">markdown.js</option> | ||
| <option value="http://codemirror.net/mode/mirc/mirc.js">mirc.js</option> | ||
| <option value="http://codemirror.net/mode/mllike/mllike.js">mllike.js</option> | ||
| + <option value="http://codemirror.net/mode/modelica/modelica.js">modelica.js</option> | ||
| <option value="http://codemirror.net/mode/nginx/nginx.js">nginx.js</option> | ||
| <option value="http://codemirror.net/mode/ntriples/ntriples.js">ntriples.js</option> | ||
| <option value="http://codemirror.net/mode/octave/octave.js">octave.js</option> | ||
Oops, something went wrong.
Showing you all comments on commits in this comparison.
sdegutis
commented on 8fac50a
Sep 15, 2014
|
|