Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup #3968

Merged
merged 3 commits into from
May 26, 2019
Merged

cleanup #3968

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/ace/edit_session.js
Original file line number Diff line number Diff line change
Expand Up @@ -2093,7 +2093,7 @@ EditSession.$uid = 0;
* @returns {Number}
**/
this.getScreenTabSize = function(screenColumn) {
return this.$tabSize - screenColumn % this.$tabSize;
return this.$tabSize - (screenColumn % this.$tabSize | 0);
};


Expand Down
15 changes: 8 additions & 7 deletions lib/ace/ext/emmet.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@

define(function(require, exports, module) {
"use strict";
var HashHandler = require("ace/keyboard/hash_handler").HashHandler;
var Editor = require("ace/editor").Editor;
var snippetManager = require("ace/snippets").snippetManager;
var Range = require("ace/range").Range;
var HashHandler = require("../keyboard/hash_handler").HashHandler;
var Editor = require("../editor").Editor;
var snippetManager = require("../snippets").snippetManager;
var Range = require("../range").Range;
var config = require("../config");
var emmet, emmetPath;

/**
Expand Down Expand Up @@ -238,7 +239,7 @@ AceEmmetEditor.prototype = {
* @since 0.65
*/
prompt: function(title) {
return prompt(title);
return prompt(title); // eslint-disable-line no-alert
},

/**
Expand Down Expand Up @@ -435,15 +436,15 @@ var onChangeMode = function(e, target) {

exports.load = function(cb) {
if (typeof emmetPath == "string") {
require("ace/config").loadModule(emmetPath, function() {
config.loadModule(emmetPath, function() {
emmetPath = null;
cb && cb();
});
}
};

exports.AceEmmetEditor = AceEmmetEditor;
require("ace/config").defineOptions(Editor.prototype, "editor", {
config.defineOptions(Editor.prototype, "editor", {
enableEmmet: {
set: function(val) {
this[val ? "on" : "removeListener"]("changeMode", onChangeMode);
Expand Down
2 changes: 1 addition & 1 deletion lib/ace/ext/keybinding_menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

define(function(require, exports, module) {
"use strict";
var Editor = require("ace/editor").Editor;
var Editor = require("../editor").Editor;
/**
* Generates a menu which displays the keyboard shortcuts.
* @author <a href="mailto:matthewkastor@gmail.com">
Expand Down
2 changes: 1 addition & 1 deletion lib/ace/ext/linking.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

define(function(require, exports, module) {

var Editor = require("ace/editor").Editor;
var Editor = require("../editor").Editor;

require("../config").defineOptions(Editor.prototype, "editor", {
enableLinking: {
Expand Down
6 changes: 3 additions & 3 deletions lib/ace/ext/prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ var FilteredList= require("../autocomplete").FilteredList;
var AcePopup = require('../autocomplete/popup').AcePopup;
var $singleLineEditor = require('../autocomplete/popup').$singleLineEditor;
var UndoManager = require("../undomanager").UndoManager;
var Tokenizer = require("ace/tokenizer").Tokenizer;
var overlayPage = require('./menu_tools/overlay_page').overlayPage;
var modelist = require("ace/ext/modelist");
var Tokenizer = require("../tokenizer").Tokenizer;
var overlayPage = require("./menu_tools/overlay_page").overlayPage;
var modelist = require("./modelist");
var openPrompt;

function prompt(editor, message, options, callback) {
Expand Down
3 changes: 0 additions & 3 deletions lib/ace/ext/rtl.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
define(function(require, exports, module) {
"use strict";
/** simple statusbar **/
var dom = require("ace/lib/dom");
var lang = require("ace/lib/lang");

var commands = [{
name: "leftToRight",
Expand Down
6 changes: 3 additions & 3 deletions lib/ace/ext/settings_menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

define(function(require, exports, module) {
"use strict";
var OptionPanel = require("ace/ext/options").OptionPanel;
var OptionPanel = require("./options").OptionPanel;
var overlayPage = require('./menu_tools/overlay_page').overlayPage;
/**
* This displays the settings menu if it is not already being shown.
Expand All @@ -71,8 +71,8 @@ function showSettingsMenu(editor) {
* to the editor with appropriate keyboard shortcuts.
* @param {ace.Editor} editor An instance of the Editor.
*/
module.exports.init = function(editor) {
var Editor = require("ace/editor").Editor;
module.exports.init = function() {
var Editor = require("../editor").Editor;
Editor.prototype.showSettingsMenu = function() {
showSettingsMenu(this);
};
Expand Down
4 changes: 2 additions & 2 deletions lib/ace/ext/statusbar.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
define(function(require, exports, module) {
"use strict";
/** simple statusbar **/
var dom = require("ace/lib/dom");
var lang = require("ace/lib/lang");
var dom = require("../lib/dom");
var lang = require("../lib/lang");

var StatusBar = function(editor, parentNode) {
this.element = dom.createElement("div");
Expand Down
12 changes: 6 additions & 6 deletions lib/ace/lib/useragent.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ exports.getOS = function() {
};

// this can be called in non browser environments (e.g. from ace/requirejs/text)
if (typeof navigator != "object")
return;
var _navigator = typeof navigator == "object" ? navigator : {};

var os = (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase();
var ua = navigator.userAgent;
var os = (/mac|win|linux/i.exec(_navigator.platform) || ["other"])[0].toLowerCase();
var ua = _navigator.userAgent || "";
var appName = _navigator.appName || "";

// Is the user using a browser that identifies itself as Windows
exports.isWin = (os == "win");
Expand All @@ -75,7 +75,7 @@ exports.isLinux = (os == "linux");

// Windows Store JavaScript apps (aka Metro apps written in HTML5 and JavaScript) do not use the "Microsoft Internet Explorer" string in their user agent, but "MSAppHost" instead.
exports.isIE =
(navigator.appName == "Microsoft Internet Explorer" || navigator.appName.indexOf("MSAppHost") >= 0)
(appName == "Microsoft Internet Explorer" || appName.indexOf("MSAppHost") >= 0)
? parseFloat((ua.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1])
: parseFloat((ua.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]); // for ie

Expand All @@ -85,7 +85,7 @@ exports.isOldIE = exports.isIE && exports.isIE < 9;
exports.isGecko = exports.isMozilla = ua.match(/ Gecko\/\d+/);

// Is this Opera
exports.isOpera = window.opera && Object.prototype.toString.call(window.opera) == "[object Opera]";
exports.isOpera = typeof opera == "object" && Object.prototype.toString.call(window.opera) == "[object Opera]";

// Is the user using a browser that identifies itself as WebKit
exports.isWebKit = parseFloat(ua.split("WebKit/")[1]) || undefined;
Expand Down