Skip to content

Add cut,copy and paste functionality.#52

Merged
kyazdani42 merged 5 commits into
nvim-tree:masterfrom
kristijanhusak:feature/cut-copy-paste
Jul 21, 2020
Merged

Add cut,copy and paste functionality.#52
kyazdani42 merged 5 commits into
nvim-tree:masterfrom
kristijanhusak:feature/cut-copy-paste

Conversation

@kristijanhusak

Copy link
Copy Markdown
Contributor

This PR adds cut, copy and paste functionality that I mentioned in issue #51

Note that I don't have much experience with Lua, so do as detailed review as possible.

@kristijanhusak kristijanhusak force-pushed the feature/cut-copy-paste branch from 85850dd to 9b20fcb Compare July 16, 2020 09:50
@kyazdani42

Copy link
Copy Markdown
Member

thanks :) I'll review this PR in depth later but it looks already pretty good imo.

@kristijanhusak

kristijanhusak commented Jul 21, 2020

Copy link
Copy Markdown
Contributor Author

I think handling of existing files on copy/move needs to be handled. Now it will just throw an error, but I guess it should prompt for override/cancel. Will try to add it.

Edit: Prompt added.

@kristijanhusak kristijanhusak force-pushed the feature/cut-copy-paste branch from dd511d0 to 86ff3b7 Compare July 21, 2020 06:58

@kyazdani42 kyazdani42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work.
I wonder if you could add some kind of popup information or buffer list that would show information about the state of the clipboard ? This could also be done in another PR.

Comment thread lua/lib/fs.lua
Comment thread lua/lib/fs.lua Outdated
if not success then
api.nvim_err_writeln('Could not '..action_type..' '..entry.absolute_path..' - '..msg)
end
::continue::

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

goto is not available for some distributions of neovim (as neovim uses lua 5.1 where goto is not available). You could leave it for now as i still have some piece of code with gotos but this issue will need to be addressed in another PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the logic to not use continue.

@kristijanhusak

Copy link
Copy Markdown
Contributor Author

Yeah I can add something. Maybe echo will be sufficient?
Do you want to have it like a mapping or command?

@kyazdani42

Copy link
Copy Markdown
Member

a command would be more appropriate. Echo should be enough indeed

@kristijanhusak

Copy link
Copy Markdown
Contributor Author

I added :LuaTreeClipboard command. See if the format is ok.

@kyazdani42 kyazdani42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ! Thanks :)

@kyazdani42 kyazdani42 merged commit 7743d90 into nvim-tree:master Jul 21, 2020
Almo7aya pushed a commit to Almo7aya/nvim-tree.lua that referenced this pull request Oct 11, 2022
…paste

Add cut,copy and paste functionality.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants