Code Monkey home page Code Monkey logo

coc-explorer's People

Contributors

alps2006 avatar alwc avatar asheq avatar chau-bao-long avatar danilamihailov avatar dependabot-preview[bot] avatar dependabot[bot] avatar goldfishpi avatar gopherj avatar hdspray avatar ic-768 avatar jacobmischka avatar kassio avatar lapingenieur avatar monlih avatar robin239 avatar straydragon avatar tcx4c70 avatar unrealapex avatar voldikss avatar weirongxu avatar wsdjeg avatar ytian81 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coc-explorer's Issues

'Rename' action throws an error when the target file already exists

Hi @weirongxu

Description

Suppose there are two files a.txt and b.txt in one directory and I want to rename a.txt to b.txt. After executing rename action the extension throws an error

[coc.nvim] Error: Target file or directory /home/voldikss/dotfiles/README.md already exists

Expected

  • If the target file already exist
    • If the target file is the source file itself(e.g. rename a.txt to a.txt), do nothing
    • Otherwise show a prompt with an option such as override? and ...

Using `l` or `enter` key on file opens select window UI

Hello! Thank you for such an awesome plugin! โค๏ธ

When using l or Enter key on directory everything works fine, folder opens as intented.
But when I try to open a file with l or Enter it shows the select window UI. Here's the screenshot:

How can I figure out what breaks the default l and Enter in coc-explorer buffer? Thanks!

[question] open with current buffer path as root

I'm trying to open the explorer with the current buffer as root path.

I first tried the NerdTree wat with no luck on %:

nnoremap ,, :CocCommand explorer --toggle --sources=buffer+,file+ --file-columns=git,selection,clip,indent,filename %<CR>

Now trying this, also with no luck:

function! ExploreCurrentBufferHead()
  return ':CocCommand explorer --sources=buffer+,file+ --file-columns=git,selection,clip,indent,filename ' . expand('%:h')
endfunction

nnoremap <expr> ,, ExploreCurrentBufferHead() <CR>

Could you help me please?

[Feature]: Unified asynchronous event to avoid over-render

if (!workspace.env.isVim) {
events.on(
['BufCreate', 'BufHidden', 'BufUnload', 'BufWritePost', 'InsertLeave'],
debounce(500, async () => {
await this.reload(null);
}),
);
} else if (workspace.env.isVim) {
onBufEnter(500, async (bufnr) => {
if (bufnr === this.explorer.bufnr) {
await this.reload(null, { render: false });
}
});
}

if (!workspace.env.isVim) {
if (autoReveal) {
onBufEnter(200, async (bufnr) => {
if (bufnr !== this.explorer.bufnr) {
const bufinfo = await nvim.call('getbufinfo', [bufnr]);
if (bufinfo[0] && bufinfo[0].name) {
const item = await this.revealItemByPath(bufinfo[0].name as string);
if (item !== null) {
await execNotifyBlock(async () => {
await this.render({ storeCursor: false, notify: true });
await this.gotoItem(item, { notify: true });
nvim.command('redraw', true);
});
}
}
}
});
}
events.on(
'BufWritePost',
debounce(1000, async (bufnr) => {
const bufinfo = await nvim.call('getbufinfo', [bufnr]);
if (bufinfo[0] && bufinfo[0].name) {
await gitManager.reload(pathLib.dirname(bufinfo[0].name as string), this.showHiddenFiles);
await this.render();
}
}),
);
events.on(
['InsertLeave', 'TextChanged'],
debounce(1000, async () => {
let needRender = false;
if (fileColumnManager.columns.includes('diagnosticError')) {
if (diagnosticManager.errorReload()) {
needRender = true;
}
}
if (fileColumnManager.columns.includes('diagnosticWarning')) {
if (diagnosticManager.warningReload()) {
needRender = true;
}
}
if (needRender) {
await this.render();
}
}),
);
} else {
onBufEnter(200, async (bufnr) => {
if (bufnr === this.explorer.bufnr) {
await this.reload(null);
}
});
}
}, 30);

keyMappings and the control key

When mapping a key using keyMappings, is it possible to use the Control key?

Example coc-settings.json:

{
...
"explorer.keyMappings": {
  "<ctrl v>": "toggleSelection"
  },
...
}

Thanks!

coc-explorer leaves a explorer buffer when 'quitOnOpen' is set

  • coc-settings.json:
{
  "explorer.sources": [
    {
      "name": "buffer",
      "expand": false
    },
    {
      "name": "file",
      "expand": true
    }
  ],
  "explorer.quitOnOpen": true, /////////////
  "explorer.keyMappings": {
    "<space>": "toggleSelection"
  },
  "explorer.icon.enableNerdfont": false
}
  • mini.vim: same as coc-explorer/mini_vimrc/mini.vim

Steps to reproduce

  • ge to open explorer
  • open a file
  • :q<CR>. And then nvim will show an error message "No write since last change for buffer [coc-explorer]..." and redirect me to a buffer which contains the following stuff.
<113|+|113> <112|[BUFFER]|112>
<104|-|104> <102|[FILE]:|102> <103|coc-explorer|103> <105|/home/voldikss/code/coc-explorer|105>
   <9|+|9> <9|autoload/|9><10|                               |10> <95|    4.1 kB|95> <97|19/11/01 16:58:16|97> 
   <9|+|9> <9|lib/|9><10|                                    |10> <95|    4.1 kB|95> <97|19/11/01 17:07:37|97> 
 <7|M|7> <9|+|9> <9|mini_vimrc/|9><10|                             |10> <95|    4.1 kB|95> <97|19/11/01 23:21:47|97> 
   <9|+|9> <9|node_modules/|9><10|                           |10> <95|   20.5 kB|95> <97|19/11/01 17:07:37|97> 
   <9|+|9> <9|scripts/|9><10|                                |10> <95|    4.1 kB|95> <97|19/11/01 16:58:16|97> 
   <9|+|9> <9|src/|9><10|                                    |10> <95|    4.1 kB|95> <97|19/11/01 16:58:16|97> 
     jest.config.js<10|                          |10> <95|      70 B|95> <97|19/11/01 16:58:16|97> 
     LICENSE<10|                                 |10> <95|   1.07 kB|95> <97|19/11/01 16:58:16|97> 
     memos.json<10|                              |10> <95|       2 B|95> <97|19/11/01 23:17:23|97> 
     package.json<10|                            |10> <95|     11 kB|95> <97|19/11/01 16:58:16|97> 
     readme.md<10|                               |10> <95|   8.33 kB|95> <97|19/11/01 16:58:16|97> 
     tsconfig.json<10|                           |10> <95|     307 B|95> <97|19/11/01 16:58:16|97> 
     tsconfig.prod.json<10|                      |10> <95|      78 B|95> <97|19/11/01 16:58:16|97> 
     tslint.json<10|                             |10> <95|     344 B|95> <97|19/11/01 16:58:16|97> 
     webpack.config.js<10|                       |10> <95|     733 B|95> <97|19/11/01 16:58:16|97> 
     yarn.lock<10|                               |10> <95|    233 kB|95> <97|19/11/01 16:58:16|97> 

[Feature]: Display node attribute by floating preview

New format for command and coc-settings.json

--file-columns=git:selection:clip:diagnosticError:indent:icon:filename;fullpath;size;modified;readonly
{
  "columns": [
	"git",
    "selection",
    "clip",
    "diagnosticError",
    "indent",
    "icon",
	"filename",
    ["fullpath"],
    ["size"],
    ["modified"],
    ["readonly"],
  ]
}

Match the colorscheme

What do you think that coc-explorer match the current colorscheme like defx nerdtree?
image

[Feature Request] Remove padding after filename column

There is a large amount of white space added after the filename. I'm assuming it's there for a reason but it would be great to be able to turn it off so that columns can be added after the filename. I had a look but couldn't figure out where it is coming from.

This is an example what I'd like to have:

Imgur

I have a very hacky fix here if more clarification is needed:

[Feature Request]: Toggles to show only buffers for this tab or not

When I was thinking about the difference between tab and buffer, I saw this question on stackoverflow: Why do Vim experts prefer buffers over tabs?

Someone said

"Vim experts" don't prefer buffers over tabs: they use buffers as the file proxies they are and tab pages as the workspaces they are

I love this idea. Because of this, I really need a feature that manages buffers of different tabs separately. So far, I only found that bufexplorer can do this.

I really appreciate this extension, could you add a feature like this?

Random characters in explorer

I have my dotfiles directory and when I open the explorer I see the following

image

I ran :CocCommand workspace.showOutput and nothing shows up when I open the explorer. So not sure why its doing it.

Error installing on Ubuntu 19.10

Firstly this is such an amazing plugin ๐Ÿš€ thanks for building it ๐Ÿ‘

I've tried it on a macbook and it installs and works fine without any issues, but I tried installing it on a laptop using ubuntu 19.10 and I'm getting errors trying to install it.

## versions

vim version: NVIM v0.5.0-dev
node version: v12.13.0
coc.nvim version: 0.0.74
term: tmux-256color
platform: linux
[coc.nvim] Installed extension: coc-explorer
[coc.nvim] Error on load extension coc-explorer from /home/username/.config/coc/extensions/node_modules/coc-explorer/lib/index.js: Error: Cannot find module 'trash'
Require stack:
- /home/username/.config/coc/extensions/node_modules/coc-explorer/lib/index.js
- /home/username/.config/coc/extensions/node_modules/coc-explorer/lib/index.js

I went into the coc-explorer directory to try and see what happens if I add the trash module manually and I get

Insufficient number of arguments or no entry found.
Alternatively, run 'webpack(-cli) --help' for usage info.

Hash: 9cd1ba0f17437bf8135b
Version: webpack 4.41.2
Time: 24ms
Built at: 11/02/2019 10:52:26

ERROR in Entry module not found: Error: Can't resolve './src' in '/home/username/.config/coc/extensions/node_modules/coc-explorer'

Not sure if this is the real underlying error or just a different thing. I've tried debugging this myself but I'm not very familiar with how coc extensions work, I'd appreciate any help

Alignment issue with git icons

Hi,

I have a weird alignment issue when files have a git status different than "nothing":

image

This is the same with or without nerdfonts enabled.

My config:

  "explorer.quitOnOpen": true,
  "explorer.file.autoReveal": true,
  "explorer.icon.enableNerdfont": true,
  "explorer.file.column.indent.topLevel": false,

I tried to set the unmodified icon to a single space to force alignment but it didn't change anything.

Latest neovim on ubuntu 19.10 and kitty

[Feature Request] Separate file and folder actions for <cr>

In at least some other tree plugins (ones that have apparently formed a strong muscle memory for me ๐Ÿ˜„), hitting cr on a file opens it, and hitting cr on a folder will expand or collapse it. It would be nice if coc-explorer had an option to enable that behavior; maybe separate file and folder actions for cr, or an option to change what "open" does by default with folders.

Focus

Is there any way to focus the explorer window if it's already open ?
Thanks

Development documentation

Hi, this plugin is interesting to me and I want to work on it.
Is there any documentation I can use for local development?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.