Marked as 0.2.8

This commit is contained in:
Wu Cheng-Han 2015-05-15 12:58:13 +08:00
parent 2d36d7ce84
commit 4e64583a0b
96 changed files with 3281 additions and 22102 deletions

View file

@ -27,6 +27,10 @@
font-family: monospace;
}
.CodeMirror-dialog input::selection {
color: white;
}
.CodeMirror-dialog button {
font-size: 70%;
}

View file

@ -97,7 +97,7 @@
var height = Math.max(bottom - top, 3);
var elt = frag.appendChild(document.createElement("div"));
elt.style.cssText = "position: absolute; right: 0px; width: " + Math.max(cm.display.barWidth - 1, 2) + "px; top: "
elt.style.cssText = "position: absolute; right: 0px; width: " + Math.max(cm.display.barWidth * 2, 2) + "px; top: "
+ (top + this.buttonHeight) + "px; height: " + height + "px";
elt.className = this.options.className;
}

View file

@ -38,8 +38,9 @@
.CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div {
position: absolute;
background: #bcd;
background: #ccc;
border-radius: 3px;
margin: 2px;
}
.CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical {

View file

@ -75,14 +75,13 @@
this.screen = clientSize;
this.total = scrollSize;
this.size = barSize;
var buttonSize = this.screen * (this.size / this.total);
if (buttonSize < minButtonSize) {
this.size -= minButtonSize - buttonSize;
buttonSize = minButtonSize;
}
this.inner.style[this.orientation == "horizontal" ? "width" : "height"] =
buttonSize + "px";
(buttonSize - 4) + "px";
this.inner.style[this.orientation == "horizontal" ? "left" : "top"] =
this.pos * (this.size / this.total) + "px";
};

View file

@ -118,7 +118,7 @@
var doReplaceConfirm = "Replace? <button>Yes</button> <button>No</button> <button>Stop</button>";
function replace(cm, all) {
if (cm.getOption("readOnly")) return;
var query = cm.getSelection() || getSearchState().lastQuery;
var query = cm.getSelection() || getSearchState(cm).lastQuery;
dialog(cm, replaceQueryDialog, "Replace:", query, function(query) {
if (!query) return;
query = parseQuery(query);
@ -128,8 +128,8 @@
for (var cursor = getSearchCursor(cm, query); cursor.findNext();) {
if (typeof query != "string") {
var match = cm.getRange(cursor.from(), cursor.to()).match(query);
cursor.replace(text.replace(/\$(\d)/g, function(_, i) {return match[i];}));
} else cursor.replace(text);
cursor.replace(text.replace(/\$(\d)/g, function(_, i) {return match[i];}), "+input");
} else cursor.replace(text, "+input");
}
});
} else {
@ -149,7 +149,7 @@
};
var doReplace = function(match) {
cursor.replace(typeof query == "string" ? text :
text.replace(/\$(\d)/g, function(_, i) {return match[i];}));
text.replace(/\$(\d)/g, function(_, i) {return match[i];}), "+input");
advance();
};
advance();

File diff suppressed because one or more lines are too long

View file

@ -2,12 +2,21 @@ uglifyjs --compress --mangle --output codemirror.min.js \
lib/codemirror.js \
addon/mode/overlay.js \
addon/selection/active-line.js \
addon/search/searchcursor.js \
addon/search/search.js \
addon/search/matchesonscrollbar.js \
addon/scroll/simplescrollbars.js \
addon/scroll/annotatescrollbar.js \
addon/dialog/dialog.js \
addon/edit/matchbrackets.js \
addon/edit/closebrackets.js \
addon/edit/matchtags.js \
addon/edit/closetag.js \
addon/edit/continuelist.js \
addon/comment/comment.js \
addon/wrap/hardwrap.js \
addon/fold/foldcode.js \
addon/fold/brace-fold.js \
addon/fold/foldgutter.js \
addon/fold/markdown-fold.js \
addon/fold/xml-fold.js \
@ -19,4 +28,5 @@ mode/css/css.js \
mode/htmlmixed/htmlmixed.js \
mode/clike/clike.js \
mode/clojure/clojure.js \
mode/ruby/ruby.js
mode/ruby/ruby.js \
keymap/sublime.js

View file

@ -258,7 +258,7 @@
var actual = line - offset;
if (line == obj.end) head = Pos(actual, cm.getLine(actual).length + 1);
if (actual < cm.lastLine()) {
cm.replaceRange(" ", Pos(actual), Pos(actual + 1, /^\s*/.exec(cm.getLine(actual + 1))[0].length));
cm.replaceRange(" ", Pos(actual), Pos(actual + 1, /^\s*/.exec(cm.getLine(actual + 1))[0].length), "+joinLines");
++offset;
}
}
@ -274,9 +274,9 @@
for (var i = 0; i < rangeCount; i++) {
var range = cm.listSelections()[i];
if (range.empty())
cm.replaceRange(cm.getLine(range.head.line) + "\n", Pos(range.head.line, 0));
cm.replaceRange(cm.getLine(range.head.line) + "\n", Pos(range.head.line, 0), null, "+duplicateLine");
else
cm.replaceRange(cm.getRange(range.from(), range.to()), range.from());
cm.replaceRange(cm.getRange(range.from(), range.to()), range.from(), null, "+duplicateLine");
}
cm.scrollIntoView();
});
@ -311,7 +311,7 @@
if (au != bu) { a = au; b = bu; }
return a < b ? -1 : a == b ? 0 : 1;
});
cm.replaceRange(lines, start, end);
cm.replaceRange(lines, start, end, "+sortLines");
if (selected) ranges.push({anchor: start, head: end});
}
if (selected) cm.setSelections(ranges, 0);
@ -402,7 +402,7 @@
if (at && CodeMirror.cmpPos(range.head, at) > 0) continue;
var word = wordAt(cm, range.head);
at = word.from;
cm.replaceRange(mod(word.word), word.from, word.to);
cm.replaceRange(mod(word.word), word.from, word.to, "case");
}
});
}
@ -452,7 +452,7 @@
var from = cm.getCursor(), to = found;
if (CodeMirror.cmpPos(from, to) > 0) { var tmp = to; to = from; from = tmp; }
cm.state.sublimeKilled = cm.getRange(from, to);
cm.replaceRange("", from, to);
cm.replaceRange("", from, to, "+delete");
}
};
cmds[map[cK + ctrl + "X"] = "swapWithSublimeMark"] = function(cm) {