Skip to content

Commit

Permalink
Merge pull request #132 from andyherbert/master
Browse files Browse the repository at this point in the history
Bump to electron 7.0.1
  • Loading branch information
andyherbert authored May 1, 2020
2 parents 26566d5 + 53bc884 commit b2e0245
Show file tree
Hide file tree
Showing 6 changed files with 314 additions and 792 deletions.
3 changes: 3 additions & 0 deletions app/document/tools/cursor.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ class Cursor {

new_line() {
if (this.mode != modes.EDITING) return;
if (keyboard.insert_mode && this.y < doc.rows - 1) {
this.insert_row(this.y + 1);
}
const old_x = this.x;
this.move_to(0, Math.min(doc.rows - 1, this.y + 1));
if (this.scroll_document_with_cursor) this.scroll(-old_x, 1);
Expand Down
1 change: 1 addition & 0 deletions app/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ function file_menu_template(win) {
{label: "Duplicate as New Document", id: "duplicate", click(item) {win.send("duplicate");}},
{type: "separator"},
{label: "Open\u2026", id: "open", accelerator: "CmdorCtrl+O", click(item) {event.emit("open", win);}},
{label: "Open in Current Window\u2026", id: "open_in_current_window", accelerator: "CmdorCtrl+Shift+O", click(item) {event.emit("open_in_current_window", win);}},
darwin ? {role: "recentDocuments", submenu: [{role: "clearRecentDocuments"}]} : ({type: "separator"}, {label: "Settings", click(item) {event.emit("preferences");}}),
{type: "separator"},
{label: "Revert to Last Save", id: "revert_to_last_save", click(item) {win.send("revert_to_last_save");}, enabled: false},
Expand Down
10 changes: 9 additions & 1 deletion app/moebius.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function new_document_window() {
const win_pos = win.getPosition();
last_win_pos = win_pos;
const debug = prefs.get("debug");
docs[win.id] = {win, menu: menu.document_menu(win, debug), chat_input_menu: menu.chat_input_menu(win, debug), edited: false, win_pos, destroyed: false};
docs[win.id] = {win, menu: menu.document_menu(win, debug), chat_input_menu: menu.chat_input_menu(win, debug), edited: false, win_pos, destroyed: false, open_in_current_window: false};
touchbar.create_touch_bars(win);
prefs.send(win);
win.on("focus", (event) => {
Expand Down Expand Up @@ -99,6 +99,9 @@ async function open_file(file) {
}

function open_in_new_window(win) {
if (win && docs[win.id].open_in_current_window) {
return false;
}
return !win || docs[win.id].network || docs[win.id].file || docs[win.id].edited;
}

Expand All @@ -120,6 +123,11 @@ function open(win) {
menu.on("open", open);
electron.ipcMain.on("open", (event) => open());

menu.on("open_in_current_window", (win) => {
docs[win.id].open_in_current_window = true;
open(win);
});

async function preferences() {
const preferences = await window.static("app/html/preferences.html", {width: 480, height: 670});
preferences.send("prefs", prefs.get_all());
Expand Down
2 changes: 1 addition & 1 deletion electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ linux:
target: deb
description: Moebius is a new ANSI and ASCII Editor for Linux, MacOS, and Windows. The major feature that differentiates it from PabloDraw is the 'half-block' brush which allows editing in a style closer to Photoshop than a text editor, although you can still use the function and cursor keys to draw with, and you should find that most of the text editing features from PabloDraw are carried over to this editor.
category: Graphics
electronVersion: 6.0.8
electronVersion: 7.0.1
Loading

0 comments on commit b2e0245

Please sign in to comment.