Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Commit

Permalink
Save improvements
Browse files Browse the repository at this point in the history
* Fix: update 'abrApp.windows' on saveAs
* Improve file extension detection on save
  • Loading branch information
brrd committed Jan 23, 2016
1 parent 845b401 commit 3aedaf7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/abr-window.js
Expand Up @@ -19,7 +19,8 @@ function alreadyOpen (abrApp, path) {
}
var windows = abrApp.windows;
for (var i=0; i<windows.length; i++) {
if (windows[i] && windows[i].path === path) {
if (!windows[i]) continue;
if (windows[i].path === path) {
return windows[i];
}
}
Expand Down
3 changes: 2 additions & 1 deletion app/renderer/abr-document.js
Expand Up @@ -268,6 +268,7 @@ AbrDocument.prototype = {
}
that.setClean();
that.setPath(path);
that.ipcClient.trigger("setWinPath", path);
that.updateWindowTitle();
if (typeof callback === "function") {
callback();
Expand All @@ -282,7 +283,7 @@ AbrDocument.prototype = {
return false;
}
// Append extension if none
if (path.indexOf(".") === -1) {
if (parsePath(path).basename.indexOf(".") === -1) {
path += ".md";
}
return this.save(path, callback);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -9,7 +9,7 @@
"bugs": {
"url": "https://github.com/brrd/Abricotine/issues"
},
"version": "0.2.1",
"version": "0.2.2",
"keywords": [
"markdown",
"text",
Expand Down

0 comments on commit 3aedaf7

Please sign in to comment.