Skip to content

Commit 4550401

Browse files
committed
Merge pull request #10 from elkebirmed/master
New feature: Search for a selected word
2 parents 4f138da + a232027 commit 4550401

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

‎README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# devdocs
22

3-
Put your cursor on a word. Press Cmd + Shift + P to bring up the command palette. Choose "Doc" to
3+
Put your cursor on a word or select it. Press Cmd + Shift + P to bring up the command palette. Choose "Doc" to
44
search on devdocs.io

‎lib/devdocs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ module.exports = {
66
},
77

88
search: function() {
9-
var wordUnderCursor = atom.workspace.getActiveTextEditor().getWordUnderCursor();
9+
var wordToSearchFor = atom.workspace.getActiveTextEditor().getSelectedText() || atom.workspace.getActiveTextEditor().getWordUnderCursor();
1010
var shell = require('shell');
11-
shell.openExternal("http://devdocs.io/#q=" + wordUnderCursor);
11+
shell.openExternal("http://devdocs.io/#q=" + wordToSearchFor);
1212
}
1313
};

‎package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
22
"name": "devdocs",
33
"main": "./lib/devdocs",
4-
"version": "0.2.1",
4+
"version": "0.3.0",
55
"private": true,
66
"author": {
77
"name": "Abu Ashraf Masnun"
88
},
9-
"description": "Put your cursor on a keyword and search for it using the 'doc' command",
9+
"description": "Put your cursor on a keyword or select it and search for it using the 'doc' command",
1010
"repository": {
1111
"type": "git",
1212
"url": "https://github.com/masnun/atom-devdocs"
1313
},
1414
"activationCommands": {},
1515
"license": "MIT",
1616
"engines": {
17-
"atom": ">0.50.0"
17+
"atom": ">1.0.3"
1818
},
1919
"dependencies": {}
2020
}

0 commit comments

Comments
 (0)