feature(key) add ability to copy path with help of Ctrl + p

This commit is contained in:
coderaiser 2018-05-15 17:33:14 +03:00
parent f98027e64b
commit d6c3a240b5
4 changed files with 14 additions and 0 deletions

View file

@ -166,6 +166,7 @@ Hot keys
| `Ctrl + с` | copy to buffer
| `Ctrl + v` | paste from buffer
| `Ctrl + z` | clear buffer
| `Ctrl + p` | copy path
| `Ctrl + r` | refresh
| `Ctrl + d` | clear local storage
| `Ctrl + a` | select all files in a panel

View file

@ -5,6 +5,7 @@
const Info = DOM.CurrentInfo;
const exec = require('execon');
const clipboard = require('@cloudcmd/clipboard');
const Events = require('../dom/events');
const Buffer = require('../dom/buffer');
@ -415,6 +416,16 @@ function KeyProto() {
break;
case Key.P:
if (!ctrlMeta)
return;
event.preventDefault();
clipboard
.writeText(Info.dirPath)
.catch(CloudCmd.log);
break;
/**
* обновляем страницу,
* загружаем содержимое каталога

View file

@ -39,6 +39,7 @@ module.exports = {
M : 77,
O : 79,
P : 80,
Q : 81,
R : 82,
S : 83,

View file

@ -157,6 +157,7 @@
"writejson": "^1.1.0"
},
"devDependencies": {
"@cloudcmd/clipboard": "^1.0.0",
"babel-cli": "^6.18.0",
"babel-loader": "^7.0.0",
"babel-plugin-transform-object-assign": "^6.22.0",