Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
![ActiveFileInStatusBar in action](media/ActiveFileInStatusBar.gif)

## Install ##
Install [ActiveFileInStatusBar](https://marketplace.visualstudio.com/items?itemName=RoscoP.ActiveFileInStatusBar) directly from the Visual Studio Code extension gallery.
Install [ActiveFileInStatusBar](https://marketplace.visualstudio.com/items?itemName=RoscoP.ActiveFileInStatusBar) directly from the Visual Studio Code extension gallery.

## Options ##

Expand All @@ -17,6 +17,10 @@ Install [ActiveFileInStatusBar](https://marketplace.visualstudio.com/items?itemN
"ActiveFileInStatusBar.revealFile": false,
// Set text color for the filename in the status bar.
"ActiveFileInStatusBar.color": "",
// Do I need to search immediately after copying.
"ActiveFileInStatusBar.searchАfterСopy": false,
// Regex mask if you need to dissect the path before copying.
"ActiveFileInStatusBar.regex": "string",
```

## Contribute ##
Expand Down
14 changes: 13 additions & 1 deletion extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,19 @@ function activate(context) {
vscode.commands.executeCommand('workbench.action.files.revealActiveFileInWindows')
}
else {
copypaste.copy(sb.text)
copypaste.copy(
config.regex
? sb.text.replace(new RegExp(config.regex), '$1')
: sb.text
)

if (config.searchАfterСopy) {
vscode.commands.executeCommand('workbench.view.search');

setTimeout(() => {
vscode.commands.executeCommand('editor.action.clipboardPasteAction');
}, 100);
}
}
});
context.subscriptions.push(disposable);
Expand Down
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@
"type": "string",
"default": "",
"description": "Set text color for the filename in the status bar."
},
"ActiveFileInStatusBar.searchАfterСopy": {
"type": "boolean",
"default": false,
"description": "Do I need to search immediately after copying."
},
"ActiveFileInStatusBar.regex": {
"type": "string",
"default": "",
"description": "Regex mask if you need to dissect the path before copying."
}
}
}
Expand Down