FBI-1684: [MANTIS - 22275] Scroll in trigger editor jumps several lines up when

scrolling with the mouse scroll wheel

resolve observations
This commit is contained in:
alex_santos
2017-04-24 09:37:28 -04:00
parent 3bf28da76d
commit 1bce18fbe9
508 changed files with 63003 additions and 17118 deletions

View File

@@ -1,19 +1,32 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
/**
* Link to the project's GitHub page:
* https://github.com/duralog/CodeMirror
*/
(function() {
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
CodeMirror.defineMode('livescript', function(){
var tokenBase, external;
tokenBase = function(stream, state){
var next_rule, nr, i$, len$, r, m;
if (next_rule = state.next || 'start') {
var tokenBase = function(stream, state) {
var next_rule = state.next || "start";
if (next_rule) {
state.next = state.next;
if (Array.isArray(nr = Rules[next_rule])) {
for (i$ = 0, len$ = nr.length; i$ < len$; ++i$) {
r = nr[i$];
if (r.regex && (m = stream.match(r.regex))) {
state.next = r.next;
var nr = Rules[next_rule];
if (nr.splice) {
for (var i$ = 0; i$ < nr.length; ++i$) {
var r = nr[i$];
if (r.regex && stream.match(r.regex)) {
state.next = r.next || state.next;
return r.token;
}
}
@@ -33,16 +46,16 @@
stream.next();
return 'error';
};
external = {
var external = {
startState: function(){
return {
next: 'start',
lastToken: null
lastToken: {style: null, indent: 0, content: ""}
};
},
token: function(stream, state){
var style;
style = tokenBase(stream, state);
while (stream.pos == stream.start)
var style = tokenBase(stream, state);
state.lastToken = {
style: style,
indent: stream.indentation(),
@@ -51,8 +64,7 @@
return style.replace(/\./g, ' ');
},
indent: function(state){
var indentation;
indentation = state.lastToken.indent;
var indentation = state.lastToken.indent;
if (state.lastToken.content.match(indenter)) {
indentation += 2;
}
@@ -192,7 +204,7 @@
next: 'start'
}, {
token: 'text',
regex: '.',
regex: '',
next: 'start'
}
],
@@ -251,17 +263,18 @@
};
for (var idx in Rules) {
var r = Rules[idx];
if (Array.isArray(r)) {
if (r.splice) {
for (var i = 0, len = r.length; i < len; ++i) {
var rr = r[i];
if (rr.regex) {
if (typeof rr.regex === 'string') {
Rules[idx][i].regex = new RegExp('^' + rr.regex);
}
}
} else if (r.regex) {
} else if (typeof rr.regex === 'string') {
Rules[idx].regex = new RegExp('^' + r.regex);
}
}
})();
CodeMirror.defineMIME('text/x-livescript', 'livescript');
CodeMirror.defineMIME('text/x-livescript', 'livescript');
});