Comparing changes
Open a pull request
|
|
marijnh |
Bump version number post-3.16
|
ac4e684
|
|||
|
|
marijnh |
Also update version number on project page
I really should automate this. |
4b2b7bf
|
|
|
ciaranj + marijnh |
[merge addon] Add highlightDifferences option and method
Provides new option (highlightDifferences) and method highlightDifferences(bool) to the MergeView plugin. If true (or undefined) the original behaviour is maintained, which is to show the differences (line highlighting and gutter graphics), if false then the changes will not be shown. Calling the method causes the visual change to occur 'immediately' Signed-off-by: ciaranj <ciaranj@gmail.com> |
595468c
|
|||
|
|
marijnh |
[merge addon] Clean up showDifferences option
Issue #1765 |
4a7e45b
|
|||
|
|
Joseph Pecoraro + marijnh |
Add "gutterContextMenu" event to capture context menu events in gutters
|
1ba4b55
|
|||
|
|
marijnh |
Clean up gutterContextMenu code
Issue #1766 |
f151bc0
|
|||
|
|
marijnh |
[project page] Set border: 0 for logo
Woah, IE still defaults to a border around images in links. |
560ba1b
|
|||
|
|
marijnh |
Fix bug introduced by previous contextmenuInGutter patch
Issue #1766 |
ea27498
|
|||
|
|
marijnh |
Use zero-width space in context-menu select-all hack
To prevent the mouse click from landing outside of the selected text, which broke copy in IE. Closes #1764 |
4e0d423
|
|||
|
|
marijnh |
[project page] Add links to a few more demos
|
d87f2b6
|
|
|
marijnh |
Fix problem in workaround for Webkit's failure to render huge text nodes
|
73cde37
|
|||
|
|
marijnh |
Experimental option crudeMeasuringFrom
Stopgap for #1022 |
b88e8c3
|
|||
|
|
Dominator008 + marijnh |
Remove outdated note from LICENSE
Subdirectories no longer contain separate LICENSE files. Delete the note to them from the top level LICENSE. |
2a6e38e
|
|||
|
|
Dominator008 + marijnh |
Remove redundant line in AUTHORS
Removed the redundant "List of contributors..." line |
bfb6eed
|
|||
|
|
ciaranj + marijnh |
[merge addon] Shows differences when the non-edit pane is updated
Previous behaviour was to only update the displayed differences if the edit pane was modified. There exists use-cases such that the differences should be updated when any of the panes change. I don't expect this to introduce any performance regressions due to the existing debounce code within the update function. Signed-off-by: ciaranj <ciaranj@gmail.com> |
2a4c96f
|
|||
|
|
ciaranj + marijnh |
Allow linter to run on windows
Node provides some cross-platform utility methods to enable safe path traversal. This change merely swaps out a hardcoded '/' (unix path separator) to use one of these methods. An alternative strategy would be to use the constant 'path.sep' but this felt 'cleaner'. Signed-off-by: ciaranj <ciaranj@gmail.com> |
5c4892a
|
|||
|
|
TobiasBg + marijnh |
Main CSS file: Clean-up and fix lint warnings
Use 0 instead of 0px, clean-up two line breaks, to fix lint warning; Three empty CSS blocks could also be removed. |
fa9150c
|
|||
|
|
marijnh |
[fullscreen addon] Reduce z-index in order to not hide completion popups
|
a71f5fc
|
|
|
0b10011 + marijnh |
[scss] Fix indentation issues
Closes #1776 |
518527c
|
|||
|
|
marijnh |
[css mode] Fix unused variable
|
2e28aa3
|
|
|
marijnh |
[coffeescript mode] Stop highlighting .keyword (.on/.off/.in) as error
Closes #1779 |
6d56441
|
|
|
sathyamoorthi + marijnh |
[matchtags addon] option added to highlight both tags
|
b3a1ed4
|
|||
|
|
marijnh |
[matchtags addon] cleanup b3a1ed4
Issue #1781 |
9fbdb01
|
|||
|
|
marijnh |
[real-world uses] Add Tilemill
|
e9b20be
|
|
|
ibdknox + marijnh |
Vim: raise mode change events
Signed-off-by: Chris Granger <ibdknox@gmail.com> |
dec8638
|
|||
|
|
kubelsmieci + marijnh |
Update markselection.html
Demo was incorrectly named as showing 'Highlighter', fixed to 'Selection' |
f8ca178
|
|
|
marijnh |
Get rid of top links in CONTRIBUTING.md
Issue #1786 |
b5069df
|
|
|
marijnh |
[tern addon] Fix fetching of parser state
Issue #1799 |
df7ce15
|
|
|
marijnh |
[sql mode] Add comment style properties
|
4f08157
|
|||
|
|
marijnh |
In refresh, recompute line heights when no known text height
Issue #1793 |
36edc05
|
|||
|
|
marijnh |
[matchtags addon] Don't match tags when there is a selection
Closes #1802 |
22ea8d9
|
|||
|
|
AndersMad + marijnh |
[css-hint addon] Add
I have created this simple css autocomplete/hint that uses data from the css mode. Autocomplete works for both properties and values - but it does not filter the values by property. Better than nothing for now. |
b8e09e9
|
|||
|
|
marijnh |
[css-hint addon] Integrate
|
90d036d
|
|||
|
|
marijnh |
[closetag addon] Restructure
|
47965d3
|
|||
|
|
marijnh |
[closetag addon] Allow closing by typing / even when before a word
Closes #1795 |
a55b506
|
|||
|
|
marijnh |
[haskell mode] Allow keyword sets to be overridden
|
f5b9d3c
|
|||
|
|
marijnh |
[continuecomment addon] Clean up, support line comment blocks
|
fab90b7
|
|
|
peterkroon + marijnh |
[less mode] Fix indentation of nested rules
Issue #1801 |
f8282cc
|
|||
|
|
marijnh |
[less mode] Remove console.log
|
b3353e7
|
|||
|
|
mattpass + marijnh |
Better lint icons and in fewer bytes
Original error & warning icons had jagged edges due to being GIFs This made them look quite poor/low quality on dark BG'd themes So, new, better looking icons added which have been run thru TinyPNG for compression Result is fewer bytes than original and they look good on dark BG's too |
c55df0d
|
|||
|
|
marijnh |
Don't mutate options.gutters in setGuttersForLineNumbers
|
30a9ee5
|
|||
|
|
marijnh |
Prevent corrupted measurements due to vanishing/appearing scrollbar
Issue #1787 |
c8c7fc1
|
|
|
marijnh |
Amend c8c7fc1 to handle window resize-tiggered updated
Issue #1787 |
7ea6f43
|
|||
|
|
peterkroon + marijnh |
[dtd mode] Add
|
0074346
|
|||
|
|
marijnh |
Fix drag/drop on Chrome by setting an image src
Work around a Chrome regression where it aborts the drag if the setDragImage image is src-less. Closes #1810 |
1564808
|
|||
|
|
marijnh |
[tern addon] Compensate for fact that call start pos is a column, not…
… char offset Closes #1811 |
687026e
|
|||
|
|
marijnh |
Allow styling of lines from mode tokenizers (experimental)
|
e0b0e32
|
|
|
stoskov + marijnh |
Add a hook to server response
|
45d3cda
|
|||
|
|
peterkroon + marijnh |
[lint demo] Remove duplicate script tag
|
1b3f9d0
|
|
|
marijnh |
Fix false positive in IE9/10 selection reset workaround hack
Closes #1820 |
afd9b56
|
|||
|
|
Tomas-A + marijnh |
[searchcursor addon] Fix multiple-line search
There must be an error in line 73 because if the phrase starts at the same character position then conditional if will always become true (same number is equal to same number) therefore it must be changed to strict less than. |
e470d7f
|
|||
|
|
marijnh |
[sql mode] Merge functions and builtin list for plsql dialect
Closes #1803 |
5cd7bdc
|
|||
|
|
marijnh |
Don't make changes to bgClass invalidate line measurement caches
|
1bdd4cb
|
|||
|
|
marijnh |
[merge addon] Signal updateDiff events
|
a59d576
|
|||
|
|
marijnh |
Fix spanAffectsWrapping regexp for Safari
Issue #1825 |
ecafd26
|
|||
|
|
marijnh |
[runmode addon] Pass state object to callbacks
Issue #1824 |
d92d60a
|
|||
|
|
marijnh |
[compression helper] Add foldgutter.js
|
2bca585
|
|
|
mb-crt + marijnh |
[octave mode] Add
|
291ffbd
|
|||
|
|
marijnh |
[mode/meta.js] Add missing modes
|
51c8aee
|
|
|
marijnh |
[d mode] Remove executable flag from mode files
Closes #1830 |
e987409
|
- +11 −1 AUTHORS
- +3 −3 CONTRIBUTING.md
- +0 −4 LICENSE
- +25 −15 addon/comment/continuecomment.js
- +1 −1 addon/display/fullscreen.css
- +28 −27 addon/edit/closetag.js
- +10 −5 addon/edit/matchtags.js
- +50 −0 addon/hint/css-hint.js
- +10 −7 addon/hint/show-hint.js
- +17 −0 addon/lint/css-lint.js
- +3 −27 addon/lint/lint.css
- +1 −1 addon/lint/lint.js
- +32 −6 addon/merge/merge.js
- +1 −1 addon/runmode/runmode-standalone.js
- +1 −1 addon/runmode/runmode.js
- +1 −1 addon/runmode/runmode.node.js
- +2 −2 addon/search/searchcursor.js
- +29 −6 addon/tern/tern.js
- +3 −2 bin/lint
- +1 −1 bower.json
- +1 −1 demo/complete.html
- +70 −0 demo/lint.html
- +3 −19 demo/marker.html
- +3 −3 demo/markselection.html
- +1 −1 demo/matchtags.html
- +8 −4 demo/merge.html
- +1 −1 demo/spanaffectswrapping_shim.html
- +7 −0 doc/compress.html
- +1 −0 doc/docs.css
- +27 −1 doc/manual.html
- +3 −0 doc/realworld.html
- +9 −0 doc/releases.html
- +6 −2 index.html
- +13 −0 keymap/vim.js
- +7 −3 lib/codemirror.css
- +104 −46 lib/codemirror.js
- +1 −1 mode/coffeescript/coffeescript.js
- +15 −13 mode/css/css.js
- 0 mode/d/d.js
- 0 mode/d/index.html
- +127 −0 mode/dtd/dtd.js
- +89 −0 mode/dtd/index.html
- +173 −0 mode/fortran/fortran.js
- +81 −0 mode/fortran/index.html
- +5 −1 mode/haskell/haskell.js
- +4 −0 mode/index.html
- +47 −49 mode/less/less.js
- +6 −0 mode/meta.js
- +95 −0 mode/octave/index.html
- +118 −0 mode/octave/octave.js
- +8 −5 mode/sql/sql.js
- +73 −0 mode/toml/index.html
- +71 −0 mode/toml/toml.js
- +1 −1 package.json
- +25 −3 test/test.js
- +2 −24 theme/solarized.css
| @@ -17,6 +17,7 @@ alexey-k | ||
| Alex Piggott | ||
| Amy | ||
| Ananya Sen | ||
| +AndersMad | ||
| Andre von Houck | ||
| Andrey Lushnikov | ||
| Andy Kimball | ||
| @@ -36,6 +37,7 @@ Ben Keen | ||
| boomyjee | ||
| borawjm | ||
| Brandon Frohs | ||
| +Brett Zamir | ||
| Brian Sletten | ||
| Bruce Mitchener | ||
| Chandra Sekhar Pydi | ||
| @@ -44,6 +46,7 @@ Chris Coyier | ||
| Chris Granger | ||
| Chris Morgan | ||
| Christopher Brown | ||
| +ciaranj | ||
| CodeAnimal | ||
| ComFreek | ||
| dagsta | ||
| @@ -76,6 +79,7 @@ Felipe Lalanne | ||
| Felix Raab | ||
| Filip Noetzel | ||
| flack | ||
| +ForbesLindesay | ||
| Ford_Lawnmower | ||
| Gabriel Nahmias | ||
| galambalazs | ||
| @@ -85,6 +89,7 @@ Golevka | ||
| Gordon Smith | ||
| greengiant | ||
| Guillaume Massé | ||
| +Guillaume Massé | ||
| Hans Engel | ||
| Hardest | ||
| Hasan Karahan | ||
| @@ -137,11 +142,11 @@ komakino | ||
| Konstantin Lopuhin | ||
| koops | ||
| ks-ifware | ||
| +kubelsmieci | ||
| Lanny | ||
| leaf corcoran | ||
| Leonya Khachaturov | ||
| Liam Newman | ||
| -List of contributors. Updated before every release. | ||
| LM | ||
| Lorenzo Stoakes | ||
| lynschinzer | ||
| @@ -152,6 +157,8 @@ Marco Aurélio | ||
| Marijn Haverbeke | ||
| Mario Pietsch | ||
| Mark Lentczner | ||
| +Martin Balek | ||
| +Martín Gaitán | ||
| Mason Malone | ||
| Mateusz Paprocki | ||
| mats cronqvist | ||
| @@ -220,6 +227,7 @@ Stas Kobzar | ||
| Stefan Borsje | ||
| Steffen Beyer | ||
| Steve O'Hara | ||
| +stoskov | ||
| Tarmil | ||
| tfjgeorge | ||
| Thaddee Tyl | ||
| @@ -229,6 +237,8 @@ Thomas Schmid | ||
| Tim Baumann | ||
| Timothy Farrell | ||
| Timothy Hatcher | ||
| +TobiasBg | ||
| +Tomas-A | ||
| Tomas Varaneckas | ||
| Tom Erik Støwer | ||
| Tom MacWright | ||
| @@ -4,12 +4,12 @@ | ||
| - [Submitting bug reports](#submitting-bug-reports-) | ||
| - [Contributing code](#contributing-code-) | ||
| -## Getting help [^](#how-to-contribute) | ||
| +## Getting help | ||
| Community discussion, questions, and informal bug reporting is done on the | ||
| [CodeMirror Google group](http://groups.google.com/group/codemirror). | ||
| -## Submitting bug reports [^](#how-to-contribute) | ||
| +## Submitting bug reports | ||
| The preferred way to report bugs is to use the | ||
| [GitHub issue tracker](http://github.com/marijnh/CodeMirror/issues). Before | ||
| @@ -45,7 +45,7 @@ should be asked on the | ||
| [jsbin.com](http://jsbin.com/ihunin/edit), enter it there, press save, and | ||
| include the resulting link in your bug report. | ||
| -## Contributing code [^](#how-to-contribute) | ||
| +## Contributing code | ||
| - Make sure you have a [GitHub Account](https://github.com/signup/free) | ||
| - Fork [CodeMirror](https://github.com/marijnh/CodeMirror/) | ||
| @@ -17,7 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| THE SOFTWARE. | ||
| - | ||
| -Please note that some subdirectories of the CodeMirror distribution | ||
| -include their own LICENSE files, and are released under different | ||
| -licences. | ||
| @@ -1,44 +1,54 @@ | ||
| (function() { | ||
| var modes = ["clike", "css", "javascript"]; | ||
| for (var i = 0; i < modes.length; ++i) | ||
| - CodeMirror.extendMode(modes[i], {blockCommentStart: "/*", | ||
| - blockCommentEnd: "*/", | ||
| - blockCommentContinue: " * "}); | ||
| + CodeMirror.extendMode(modes[i], {blockCommentContinue: " * "}); | ||
| function continueComment(cm) { | ||
| var pos = cm.getCursor(), token = cm.getTokenAt(pos); | ||
| + if (token.type != "comment") return CodeMirror.Pass; | ||
| var mode = CodeMirror.innerMode(cm.getMode(), token.state).mode; | ||
| - var space; | ||
| - if (token.type == "comment" && mode.blockCommentStart && mode.blockCommentContinue) { | ||
| + var insert; | ||
| + if (mode.blockCommentStart && mode.blockCommentContinue) { | ||
| var end = token.string.indexOf(mode.blockCommentEnd); | ||
| var full = cm.getRange(CodeMirror.Pos(pos.line, 0), CodeMirror.Pos(pos.line, token.end)), found; | ||
| if (end != -1 && end == token.string.length - mode.blockCommentEnd.length) { | ||
| // Comment ended, don't continue it | ||
| } else if (token.string.indexOf(mode.blockCommentStart) == 0) { | ||
| - space = full.slice(0, token.start); | ||
| - if (!/^\s*$/.test(space)) { | ||
| - space = ""; | ||
| - for (var i = 0; i < token.start; ++i) space += " "; | ||
| + insert = full.slice(0, token.start); | ||
| + if (!/^\s*$/.test(insert)) { | ||
| + insert = ""; | ||
| + for (var i = 0; i < token.start; ++i) insert += " "; | ||
| } | ||
| } else if ((found = full.indexOf(mode.blockCommentContinue)) != -1 && | ||
| found + mode.blockCommentContinue.length > token.start && | ||
| /^\s*$/.test(full.slice(0, found))) { | ||
| - space = full.slice(0, found); | ||
| + insert = full.slice(0, found); | ||
| + } | ||
| + if (insert != null) insert += mode.blockCommentContinue; | ||
| + } | ||
| + if (insert == null && mode.lineComment) { | ||
| + var line = cm.getLine(pos.line), found = line.indexOf(mode.lineComment); | ||
| + if (found > -1) { | ||
| + insert = line.slice(0, found); | ||
| + if (/\S/.test(insert)) insert = null; | ||
| + else insert += mode.lineComment + line.slice(found + mode.lineComment.length).match(/^\s*/)[0]; | ||
| } | ||
| } | ||
| - if (space != null) | ||
| - cm.replaceSelection("\n" + space + mode.blockCommentContinue, "end"); | ||
| + if (insert != null) | ||
| + cm.replaceSelection("\n" + insert, "end"); | ||
| else | ||
| return CodeMirror.Pass; | ||
| } | ||
| CodeMirror.defineOption("continueComments", null, function(cm, val, prev) { | ||
| if (prev && prev != CodeMirror.Init) | ||
| cm.removeKeyMap("continueComment"); | ||
| - var map = {name: "continueComment"}; | ||
| - map[typeof val == "string" ? val : "Enter"] = continueComment; | ||
| - cm.addKeyMap(map); | ||
| + if (val) { | ||
| + var map = {name: "continueComment"}; | ||
| + map[typeof val == "string" ? val : "Enter"] = continueComment; | ||
| + cm.addKeyMap(map); | ||
| + } | ||
| }); | ||
| })(); |
| @@ -2,5 +2,5 @@ | ||
| position: fixed; | ||
| top: 0; left: 0; right: 0; bottom: 0; | ||
| height: auto; | ||
| - z-index: 9999; | ||
| + z-index: 9; | ||
| } | ||
| @@ -27,9 +27,9 @@ | ||
| if (val && (old == CodeMirror.Init || !old)) { | ||
| var map = {name: "autoCloseTags"}; | ||
| if (typeof val != "object" || val.whenClosing) | ||
| - map["'/'"] = function(cm) { return autoCloseTag(cm, '/'); }; | ||
| + map["'/'"] = function(cm) { return autoCloseSlash(cm); }; | ||
| if (typeof val != "object" || val.whenOpening) | ||
| - map["'>'"] = function(cm) { return autoCloseTag(cm, '>'); }; | ||
| + map["'>'"] = function(cm) { return autoCloseGT(cm); }; | ||
| cm.addKeyMap(map); | ||
| } else if (!val && (old != CodeMirror.Init && old)) { | ||
| cm.removeKeyMap("autoCloseTags"); | ||
| @@ -41,40 +41,41 @@ | ||
| var htmlIndent = ["applet", "blockquote", "body", "button", "div", "dl", "fieldset", "form", "frameset", "h1", "h2", "h3", "h4", | ||
| "h5", "h6", "head", "html", "iframe", "layer", "legend", "object", "ol", "p", "select", "table", "ul"]; | ||
| - function autoCloseTag(cm, ch) { | ||
| + function autoCloseGT(cm) { | ||
| var pos = cm.getCursor(), tok = cm.getTokenAt(pos); | ||
| var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state; | ||
| - if (inner.mode.name != "xml") return CodeMirror.Pass; | ||
| + if (inner.mode.name != "xml" || !state.tagName) return CodeMirror.Pass; | ||
| var opt = cm.getOption("autoCloseTags"), html = inner.mode.configuration == "html"; | ||
| var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose); | ||
| var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent); | ||
| - if (ch == ">" && state.tagName) { | ||
| - var tagName = state.tagName; | ||
| - if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch); | ||
| - var lowerTagName = tagName.toLowerCase(); | ||
| - // Don't process the '>' at the end of an end-tag or self-closing tag | ||
| - if (tok.type == "tag" && state.type == "closeTag" || | ||
| - tok.string.indexOf("/") == (tok.string.length - 1) || // match something like <someTagName /> | ||
| - dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1) | ||
| - return CodeMirror.Pass; | ||
| + var tagName = state.tagName; | ||
| + if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch); | ||
| + var lowerTagName = tagName.toLowerCase(); | ||
| + // Don't process the '>' at the end of an end-tag or self-closing tag | ||
| + if (tok.type == "tag" && state.type == "closeTag" || | ||
| + tok.string.indexOf("/") == (tok.string.length - 1) || // match something like <someTagName /> | ||
| + dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1) | ||
| + return CodeMirror.Pass; | ||
| - var doIndent = indentTags && indexOf(indentTags, lowerTagName) > -1; | ||
| - var curPos = doIndent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1); | ||
| - cm.replaceSelection(">" + (doIndent ? "\n\n" : "") + "</" + tagName + ">", | ||
| - {head: curPos, anchor: curPos}); | ||
| - if (doIndent) { | ||
| - cm.indentLine(pos.line + 1); | ||
| - cm.indentLine(pos.line + 2); | ||
| - } | ||
| - return; | ||
| - } else if (ch == "/" && tok.string == "<") { | ||
| - var tagName = state.context && state.context.tagName; | ||
| - if (tagName) cm.replaceSelection("/" + tagName + ">", "end"); | ||
| - return; | ||
| + var doIndent = indentTags && indexOf(indentTags, lowerTagName) > -1; | ||
| + var curPos = doIndent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1); | ||
| + cm.replaceSelection(">" + (doIndent ? "\n\n" : "") + "</" + tagName + ">", | ||
| + {head: curPos, anchor: curPos}); | ||
| + if (doIndent) { | ||
| + cm.indentLine(pos.line + 1); | ||
| + cm.indentLine(pos.line + 2); | ||
| } | ||
| - return CodeMirror.Pass; | ||
| + } | ||
| + | ||
| + function autoCloseSlash(cm) { | ||
| + var pos = cm.getCursor(), tok = cm.getTokenAt(pos); | ||
| + var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state; | ||
| + if (tok.string.charAt(0) != "<" || inner.mode.name != "xml") return CodeMirror.Pass; | ||
| + | ||
| + var tagName = state.context && state.context.tagName; | ||
| + if (tagName) cm.replaceSelection("/" + tagName + ">", "end"); | ||
| } | ||
| function indexOf(collection, elt) { | ||
| @@ -8,30 +8,35 @@ | ||
| clear(cm); | ||
| } | ||
| if (val) { | ||
| + cm.state.matchBothTags = typeof val == "object" && val.bothTags; | ||
| cm.on("cursorActivity", doMatchTags); | ||
| cm.on("viewportChange", maybeUpdateMatch); | ||
| doMatchTags(cm); | ||
| } | ||
| }); | ||
| function clear(cm) { | ||
| - if (cm.state.matchedTag) { | ||
| - cm.state.matchedTag.clear(); | ||
| - cm.state.matchedTag = null; | ||
| - } | ||
| + if (cm.state.tagHit) cm.state.tagHit.clear(); | ||
| + if (cm.state.tagOther) cm.state.tagOther.clear(); | ||
| + cm.state.tagHit = cm.state.tagOther = null; | ||
| } | ||
| function doMatchTags(cm) { | ||
| cm.state.failedTagMatch = false; | ||
| cm.operation(function() { | ||
| clear(cm); | ||
| + if (cm.somethingSelected()) return; | ||
| var cur = cm.getCursor(), range = cm.getViewport(); | ||
| range.from = Math.min(range.from, cur.line); range.to = Math.max(cur.line + 1, range.to); | ||
| var match = CodeMirror.findMatchingTag(cm, cur, range); | ||
| if (!match) return; | ||
| + if (cm.state.matchBothTags) { | ||
| + var hit = match.at == "open" ? match.open : match.close; | ||
| + if (hit) cm.state.tagHit = cm.markText(hit.from, hit.to, {className: "CodeMirror-matchingtag"}); | ||
| + } | ||
| var other = match.at == "close" ? match.open : match.close; | ||
| if (other) | ||
| - cm.state.matchedTag = cm.markText(other.from, other.to, {className: "CodeMirror-matchingtag"}); | ||
| + cm.state.tagOther = cm.markText(other.from, other.to, {className: "CodeMirror-matchingtag"}); | ||
| else | ||
| cm.state.failedTagMatch = true; | ||
| }); | ||
| @@ -0,0 +1,50 @@ | ||
| +(function () { | ||
| + "use strict"; | ||
| + | ||
| + function getHints(cm) { | ||
| + var cur = cm.getCursor(), token = cm.getTokenAt(cur); | ||
| + var inner = CodeMirror.innerMode(cm.getMode(), token.state); | ||
| + if (inner.mode.name != "css") return; | ||
| + | ||
| + // If it's not a 'word-style' token, ignore the token. | ||
| + if (!/^[\w$_-]*$/.test(token.string)) { | ||
| + token = { | ||
| + start: cur.ch, end: cur.ch, string: "", state: token.state, | ||
| + type: null | ||
| + }; | ||
| + var stack = token.state.stack; | ||
| + var lastToken = stack && stack.length > 0 ? stack[stack.length - 1] : ""; | ||
| + if (token.string == ":" || lastToken.indexOf("property") == 0) | ||
| + token.type = "variable"; | ||
| + else if (token.string == "{" || lastToken.indexOf("rule") == 0) | ||
| + token.type = "property"; | ||
| + } | ||
| + | ||
| + if (!token.type) | ||
| + return; | ||
| + | ||
| + var spec = CodeMirror.resolveMode("text/css"); | ||
| + var keywords = null; | ||
| + if (token.type.indexOf("property") == 0) | ||
| + keywords = spec.propertyKeywords; | ||
| + else if (token.type.indexOf("variable") == 0) | ||
| + keywords = spec.valueKeywords; | ||
| + | ||
| + if (!keywords) | ||
| + return; | ||
| + | ||
| + var result = []; | ||
| + for (var name in keywords) { | ||
| + if (name.indexOf(token.string) == 0 /* > -1 */) | ||
| + result.push(name); | ||
| + } | ||
| + | ||
| + return { | ||
| + list: result, | ||
| + from: CodeMirror.Pos(cur.line, token.start), | ||
| + to: CodeMirror.Pos(cur.line, token.end) | ||
| + }; | ||
| + } | ||
| + | ||
| + CodeMirror.registerHelper("hint", "css", getHints); | ||
| +})(); |
Showing you all comments on commits in this comparison.
JosephPecoraro
commented on f151bc0
Aug 22, 2013
|
This always does a prevent default. It used to only do a prevent default if the click was in a gutter. Was that part of your change intended? |
JosephPecoraro
commented on f151bc0
Aug 22, 2013
|
You could put this local variable declaration at the top and use it in the getRect call above. I had inlined it when I first split off gutterEvent. |
|
No, see ea27498 |
|
Can you please update meta.js as well? It might be better to call the mode MATLAB (or MATLAB / Octave) instead of just Octave because Octave is a MATLAB clone (I think) |
|
Good point. See 51c8aee |
busykai
commented on 9d67c93
Sep 23, 2013
|
This would allow two dots, right? That's ok, though... It's not a compiler. :) |
|
Yes, it does. Also three dots, and things like |
|
i is undefined here! |
|
Argh! Fixed in 53e4881 |
|
Perhaps a re-release of 3.17? It's basically broken out of the box. |
|
Oh, right, this will happen anytime you do Yeah, I'll do another release. |