-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93ce047
commit d2ef9fd
Showing
8 changed files
with
89 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import sublime, sublime_plugin | ||
import os | ||
|
||
from .BaseCommand import BaseCommand | ||
from .BaseThread import BaseThread | ||
|
||
from .lib.normalize_trailing_slash import normalize_trailing_slash | ||
from .lib.printer import p | ||
from .node_dependency_tree import get_tree | ||
|
||
class GetPathCommand(BaseCommand, sublime_plugin.WindowCommand): | ||
def run(self): | ||
super(GetPathCommand, self).run() | ||
self.start_timer() | ||
|
||
root = normalize_trailing_slash(self.window.root) | ||
p('Root:', root) | ||
|
||
filename_no_ext = os.path.splitext(self.view.filename)[0] | ||
p('File w/o ext:', filename_no_ext) | ||
|
||
path = filename_no_ext.split(root)[1] | ||
p('Path:', path) | ||
|
||
sublime.set_clipboard(path); | ||
|
||
self.stop_timer('Get_Path') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
New Feature: Copy module path to the clipboard | ||
|
||
`Command + Shift + C` (OSX) or | ||
|
||
1. Within a file, right click to open the context menu | ||
2. Click on `Dependents -> Copy path to the clipboard` | ||
|
||
Copy the rootless path of the current module to the clipboard. (Sass and JS) | ||
|
||
For example, if the root is `assets/js` and the filename is `path/to/assets/js/myFeature/file.js`, | ||
then the command will copy `myFeature/file` to the clipboard. | ||
|
||
This is useful when you want to include the current module as a dependency of another module. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters