Skip to content

Commit

Permalink
Have CTRL+S on body pane save the Leo file instead/along with the bod…
Browse files Browse the repository at this point in the history
…y pane in the 'gnx' filesystem

Fixes #62
  • Loading branch information
boltex committed Jul 9, 2020
1 parent af550ce commit d2046fd
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
29 changes: 27 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,15 @@
"dark": "resources/dark/save.svg"
}
},
{
"command": "leointeg.saveLeoFileFromOutline",
"category": "Leo",
"title": "Save Leo File",
"icon": {
"light": "resources/light/save.svg",
"dark": "resources/dark/save.svg"
}
},
{
"command": "leointeg.saveAsLeoFile",
"category": "Leo",
Expand Down Expand Up @@ -1401,6 +1410,10 @@
{
"command": "leointeg.expandAndGoRight",
"when": "false"
},
{
"command": "leointeg.saveLeoFileFromOutline",
"when": "false"
}
],
"view/title": [
Expand Down Expand Up @@ -1435,7 +1448,7 @@
"group": "navigation@1"
},
{
"command": "leointeg.saveLeoFile",
"command": "leointeg.saveLeoFileFromOutline",
"when": "view =~ /leoIntegration/ && leoTreeOpened && leoTreeTitled && leoChanged",
"group": "navigation@2"
},
Expand Down Expand Up @@ -1467,7 +1480,7 @@
],
"view/item/context": [
{
"command": "leointeg.saveLeoFile",
"command": "leointeg.saveLeoFileFromOutline",
"when": "viewItem =~ /leoDocumentSelectedTitled/ && leoChanged",
"group": "inline@1"
},
Expand Down Expand Up @@ -1614,6 +1627,18 @@
"key": "alt+end",
"when": "leoTreeOpened && sideBarFocus && focusedView =~ /leoIntegration|leoDocuments/"
},
{
"command": "leointeg.saveLeoFileFromOutline",
"key": "ctrl+s",
"mac": "cmd+s",
"when": "leoTreeOpened && sideBarFocus && focusedView =~ /leoIntegration|leoDocuments/"
},
{
"command": "leointeg.saveLeoFile",
"key": "ctrl+s",
"mac": "cmd+s",
"when": "leoTreeOpened && editorTextFocus && resourceScheme == leo"
},
{
"command": "leointeg.gotoNextCloneSelectionFromOutline",
"key": "alt+n",
Expand Down
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ export class Constants {
SWITCH_FILE: "switchLeoFile",
NEW_FILE: "newLeoFile",
SAVE_FILE: "saveLeoFile", // TODO : add to #34 @boltex detect focused panel for command-palette to return focus where appropriate
SAVE_FILE_FO: "saveLeoFileFromOutline", // TODO : add to #34 @boltex detect focused panel for command-palette to return focus where appropriate
SAVE_AS_FILE: "saveAsLeoFile",
CLOSE_FILE: "closeLeoFile",
// * Outline selection
Expand Down
1 change: 1 addition & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export function activate(p_context: vscode.ExtensionContext) {
[w_cmdPrefix + Constants.COMMANDS.OPEN_FILE, () => w_leoIntegration.openLeoFile()],
[w_cmdPrefix + Constants.COMMANDS.SAVE_AS_FILE, () => w_leoIntegration.saveAsLeoFile()],
[w_cmdPrefix + Constants.COMMANDS.SAVE_FILE, () => w_leoIntegration.saveLeoFile()],
[w_cmdPrefix + Constants.COMMANDS.SAVE_FILE_FO, () => w_leoIntegration.saveLeoFile(true)],
[w_cmdPrefix + Constants.COMMANDS.CLOSE_FILE, () => w_leoIntegration.closeLeoFile()],

[w_cmdPrefix + Constants.COMMANDS.SELECT_NODE, (p_node: LeoNode) => w_leoIntegration.selectTreeNode(p_node, false, false)], // Called by nodes in tree when selected
Expand Down

0 comments on commit d2046fd

Please sign in to comment.