Fixing undo issue; cleaning up keybindings; removed diplicate focus event
This commit is contained in:
@@ -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,7 +93,8 @@ export class FilesService {
|
||||
file.session.setMode(
|
||||
getModeForPath( file.path ).mode
|
||||
);
|
||||
|
||||
file.session.setUndoManager( new UndoManager() );
|
||||
|
||||
this.files.set(file.path, file);
|
||||
} catch (error) {
|
||||
console.log(
|
||||
|
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user