Permalink
Browse files

Added ignoreFocus out for InputBox

Now when asking the user for the URL of the link, they can Alt+Tab to their browser to obtain the URL and come back to paste it.

Pressing the `Escape` key will close the InputBox.
  • Loading branch information...
Alcha committed Aug 20, 2018
1 parent 0918957 commit 66eb63d3951329eb704f4ca03b64eb3e96cdd4b4
Showing with 6 additions and 2 deletions.
  1. +1 −1 package.json
  2. +5 −1 tools/LinkTools.js
@@ -2,7 +2,7 @@
"name": "enmeti",
"displayName": "Enmeti (MD Link Inserter)",
"description": "Helps to insert links in Markdown files.",
"version": "0.1.1",
"version": "0.1.2",
"publisher": "hf-solutions-llc",
"license": "MIT",
"author": {
@@ -1,3 +1,6 @@
// Used for JSDocs
const Window = require('vscode').window

/** A regex statement to test if the string starts with a link reference. */
const urlStarterRegex = /\[\d+\]: /

@@ -93,7 +96,8 @@ const getLinkUrlFromUser = window => {
validateInput: val => {
if (urlRegex.test(val)) return null
else return 'Please provide a value url.'
}
},
ignoreFocusOut: true
}).then(res => resolve(res), err => { if (err) reject(err) })
})
}

0 comments on commit 66eb63d

Please sign in to comment.