Fixing undo issue; cleaning up keybindings; removed diplicate focus event
This commit is contained in:
parent
9915b98700
commit
d7c8ea1902
185
public/theme-penguins_in_space.js
Normal file
185
public/theme-penguins_in_space.js
Normal file
@ -0,0 +1,185 @@
|
||||
ace.define("ace/theme/penguins_in_space-css", ["require", "exports", "module"], function(require, exports, module) {
|
||||
module.exports = """
|
||||
.penguins-in-space .ace_gutter {
|
||||
background: #282c34;
|
||||
color: #6a6f7a;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_print-margin {
|
||||
width: 1px;
|
||||
background: #e8e8e8;
|
||||
}
|
||||
|
||||
.penguins-in-space {
|
||||
background-color: #282c34;
|
||||
color: #abb2bf;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_cursor {
|
||||
color: #528bff;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_marker-layer .ace_selection {
|
||||
background: #3d4350;
|
||||
}
|
||||
|
||||
.penguins-in-space.ace_multiselect .ace_selection.ace_start {
|
||||
box-shadow: 0 0 3px 0 #282c34;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_marker-layer .ace_step {
|
||||
background: #c6dbae;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_marker-layer .ace_bracket {
|
||||
margin: -1px 0 0 -1px;
|
||||
border: 1px solid #747369;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_marker-layer .ace_active-line {
|
||||
background: rgba(76,87,103,.19);
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_gutter-active-line {
|
||||
background-color: rgba(76,87,103,.19);
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_marker-layer .ace_selected-word {
|
||||
border: 1px solid #3d4350;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_fold {
|
||||
background-color: #61afef;
|
||||
border-color: #abb2bf;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_keyword {
|
||||
color: #00a8c6;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_keyword.ace_operator {
|
||||
color: #00a8c6;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_keyword.ace_other.ace_unit {
|
||||
color: #d19a66;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_constant.ace_language {
|
||||
color: #d19a66;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_constant.ace_numeric {
|
||||
color: #d19a66;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_constant.ace_character {
|
||||
color: #56b6c2;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_constant.ace_other {
|
||||
color: #56b6c2;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_support.ace_function {
|
||||
color: #61afef;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_support.ace_constant {
|
||||
color: #d19a66;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_support.ace_class {
|
||||
color: #ff5d38;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_support.ace_type {
|
||||
color: #ff5d38;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_storage {
|
||||
color: #c678dd;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_storage.ace_type {
|
||||
color: #E6DB74;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_invalid {
|
||||
color: #fff;
|
||||
background-color: #f2777a;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_invalid.ace_deprecated {
|
||||
color: #272b33;
|
||||
background-color: #d27b53;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_string {
|
||||
color: #e6db74;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_string.ace_regexp {
|
||||
color: #e6db74;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_comment {
|
||||
font-style: italic;
|
||||
color: #454a54;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_variable {
|
||||
color: #e06c75;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_variable.ace_parameter {
|
||||
color: #d19a66;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_meta.ace_tag {
|
||||
color: #e06c75;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_entity.ace_other.ace_attribute-name {
|
||||
color: #e06c75;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_entity.ace_name.ace_function {
|
||||
color: #61afef;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_entity.ace_name.ace_tag {
|
||||
color: #e06c75;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_markup.ace_heading {
|
||||
color: #98c379;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_indent-guide {
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ09NrYAgMjP4PAAtGAwchHMyAAAAAAElFTkSuQmCC) right repeat-y;
|
||||
}
|
||||
|
||||
.penguins-in-space .ace_indent-guide-active {
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQIW2PQ1dX9zzBz5sz/ABCcBFFentLlAAAAAElFTkSuQmCC) right repeat-y;
|
||||
}
|
||||
""";
|
||||
|
||||
});
|
||||
|
||||
ace.define("ace/theme/penguins_in_space", ["require", "exports", "module", "ace/theme/penguins_in_space-css", "ace/lib/dom"], function(require, exports, module) {
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "penguins-in-space";
|
||||
exports.cssText = require("./penguins_in_space-css");
|
||||
var dom = require("../lib/dom");
|
||||
dom.importCssString(exports.cssText, exports.cssClass, false);
|
||||
|
||||
});
|
||||
(function() {
|
||||
ace.require(["ace/theme/penguins_in_space"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
@ -7,7 +7,7 @@ export const EditorSettings: any = {
|
||||
CONFIG: {
|
||||
behavioursEnabled: true,
|
||||
fontSize: "12px",
|
||||
theme: "ace/theme/one_dark",
|
||||
theme: "ace/theme/gruvbox",
|
||||
mode: "ace/mode/text",
|
||||
printMarginColumn: 80,
|
||||
enableBasicAutocompletion: true,
|
||||
|
@ -8,11 +8,7 @@ export const Keybindings: Array<{}> = [
|
||||
bindKey: {win: "F11", mac: "F11"},
|
||||
readOnly: false
|
||||
}, {
|
||||
name: "showSettingsMenu",
|
||||
bindKey: {win: "ctrl-shift-m", mac: "ctrl-shift-m"},
|
||||
readOnly: false
|
||||
}, {
|
||||
name: "showKeyboardShortcuts",
|
||||
name: "showKeyShortcuts",
|
||||
bindKey: {win: "ctrl-shift-k", mac: "command-shift-k"},
|
||||
readOnly: false
|
||||
}, {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { ReplaySubject, Observable } from 'rxjs';
|
||||
|
||||
import { EditSession } from 'ace-builds';
|
||||
import { EditSession, UndoManager } from 'ace-builds';
|
||||
import { getModeForPath } from 'ace-builds/src-noconflict/ext-modelist';
|
||||
|
||||
import { TabsService } from './tabs/tabs.service';
|
||||
@ -93,6 +93,7 @@ export class FilesService {
|
||||
file.session.setMode(
|
||||
getModeForPath( file.path ).mode
|
||||
);
|
||||
file.session.setUndoManager( new UndoManager() );
|
||||
|
||||
this.files.set(file.path, file);
|
||||
} catch (error) {
|
||||
|
@ -85,11 +85,7 @@ export class NewtonEditorBase {
|
||||
this.editor.execCommand("openCommandPalette");
|
||||
}
|
||||
|
||||
public showSettingsMenu() {
|
||||
this.editor.showSettingsMenu();
|
||||
}
|
||||
|
||||
public showKeyboardShortcuts() {
|
||||
public showKeyShortcuts() {
|
||||
this.editor.showKeyboardShortcuts();
|
||||
}
|
||||
|
||||
|
@ -7,8 +7,9 @@ import "ace-builds/src-noconflict/ext-keybinding_menu";
|
||||
import "ace-builds/src-noconflict/ext-command_bar";
|
||||
import "ace-builds/src-noconflict/ext-prompt";
|
||||
import "ace-builds/src-noconflict/ext-language_tools";
|
||||
import "ace-builds/src-noconflict/theme-one_dark";
|
||||
import "ace-builds/src-noconflict/theme-dracula";
|
||||
//import "ace-builds/src-noconflict/theme-one_dark";
|
||||
//import "ace-builds/src-noconflict/theme-penguins_in_space";
|
||||
import "ace-builds/src-noconflict/theme-gruvbox";
|
||||
|
||||
import { NewtonEditorBase } from './newton-editor.base';
|
||||
|
||||
@ -90,6 +91,12 @@ export class NewtonEditorComponent extends NewtonEditorBase {
|
||||
|
||||
// Note: https://ajaxorg.github.io/ace-api-docs/interfaces/ace.Ace.EditorEvents.html
|
||||
this.editor.on("focus", (e) => {
|
||||
let message = new ServiceMessage();
|
||||
message.action = "set-active-editor";
|
||||
message.editorUUID = this.uuid;
|
||||
|
||||
this.editorsService.sendMessage(message);
|
||||
|
||||
this.updateInfoBar();
|
||||
});
|
||||
|
||||
@ -116,14 +123,6 @@ export class NewtonEditorComponent extends NewtonEditorBase {
|
||||
}
|
||||
});
|
||||
|
||||
this.editor.on("focus", () => {
|
||||
let message = new ServiceMessage();
|
||||
message.action = "set-active-editor";
|
||||
message.editorUUID = this.uuid;
|
||||
|
||||
this.editorsService.sendMessage(message);
|
||||
});
|
||||
|
||||
this.editor.on("change", () => {
|
||||
if (!this.activeFile) return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user