Merge pull request #2267 from ajaxorg/fix/various
Fix various small issues
This commit is contained in:
commit
7b037f35ba
5 changed files with 25 additions and 13 deletions
|
|
@ -117,12 +117,19 @@ module.exports = {
|
|||
assert.equal(o.getOption("initialValue"), 8);
|
||||
o.setOption("initialValue", 7);
|
||||
assert.equal(o.getOption("opt2"), 7);
|
||||
|
||||
|
||||
config.setDefaultValues("test_object", {
|
||||
opt1: 1,
|
||||
forwarded: 2
|
||||
});
|
||||
config.resetOptions(o);
|
||||
assert.equal(o.getOption("opt1"), 1);
|
||||
assert.equal(o.getOption("forwarded"), 2);
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -539,11 +539,14 @@ var Editor = function(renderer, session) {
|
|||
var iterator = new TokenIterator(self.session, pos.row, pos.column);
|
||||
var token = iterator.getCurrentToken();
|
||||
|
||||
if (!token || token.type.indexOf('tag-name') === -1) {
|
||||
if (!token || !/\b(?:tag-open|tag-name)/.test(token.type)) {
|
||||
session.removeMarker(session.$tagHighlight);
|
||||
session.$tagHighlight = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (token.type.indexOf("tag-open") != -1)
|
||||
token = iterator.stepForward();
|
||||
|
||||
var tag = token.value;
|
||||
var depth = 0;
|
||||
|
|
|
|||
|
|
@ -45,10 +45,10 @@ var TextInput = function(parentNode, host) {
|
|||
if (useragent.isTouchPad)
|
||||
text.setAttribute("x-palm-disable-auto-cap", true);
|
||||
|
||||
text.wrap = "off";
|
||||
text.autocorrect = "off";
|
||||
text.autocapitalize = "off";
|
||||
text.spellcheck = false;
|
||||
text.setAttribute("wrap", "off");
|
||||
text.setAttribute("autocorrect", "off");
|
||||
text.setAttribute("autocapitalize", "off");
|
||||
text.setAttribute("spellcheck", false);
|
||||
|
||||
text.style.opacity = "0";
|
||||
if (useragent.isOldIE) text.style.top = "-100px";
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
define(function(require, exports, module) {
|
||||
"no use strict";
|
||||
|
||||
var lang = require("./lang");
|
||||
var oop = require("./oop");
|
||||
var EventEmitter = require("./event_emitter").EventEmitter;
|
||||
|
||||
|
|
@ -91,10 +90,10 @@ function reportError(msg, data) {
|
|||
if (typeof console == "object" && console.error)
|
||||
console.error(e);
|
||||
setTimeout(function() { throw e; });
|
||||
};
|
||||
}
|
||||
|
||||
var AppConfig = function() {
|
||||
this.$defaultOptions = {};
|
||||
this.$defaultOptions = {};
|
||||
};
|
||||
|
||||
(function() {
|
||||
|
|
@ -145,7 +144,7 @@ var AppConfig = function() {
|
|||
this.setDefaultValues = function(path, optionHash) {
|
||||
Object.keys(optionHash).forEach(function(key) {
|
||||
this.setDefaultValue(path, key, optionHash[key]);
|
||||
});
|
||||
}, this);
|
||||
};
|
||||
|
||||
this.warn = warn;
|
||||
|
|
|
|||
|
|
@ -150,7 +150,8 @@ function onMouseDown(e) {
|
|||
if (isSamePoint(screenCursor, newCursor) && isSamePoint(cursor, selection.lead))
|
||||
return;
|
||||
screenCursor = newCursor;
|
||||
|
||||
|
||||
editor.$blockScrolling++;
|
||||
editor.selection.moveToPosition(cursor);
|
||||
editor.renderer.scrollCursorIntoView();
|
||||
|
||||
|
|
@ -160,8 +161,9 @@ function onMouseDown(e) {
|
|||
rectSel[0] = editor.$mouseHandler.$clickSelection.clone();
|
||||
rectSel.forEach(editor.addSelectionMarker, editor);
|
||||
editor.updateSelectionMarkers();
|
||||
editor.$blockScrolling--;
|
||||
};
|
||||
|
||||
editor.$blockScrolling++;
|
||||
if (isMultiSelect && !accel) {
|
||||
selection.toSingleRange();
|
||||
} else if (!isMultiSelect && accel) {
|
||||
|
|
@ -173,6 +175,7 @@ function onMouseDown(e) {
|
|||
screenAnchor = session.documentToScreenPosition(selection.lead);
|
||||
else
|
||||
selection.moveToPosition(pos);
|
||||
editor.$blockScrolling--;
|
||||
|
||||
screenCursor = {row: -1, column: -1};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue