Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: paste from file #4171

Closed

Conversation

equals03
Copy link

This is an attempt to implement #3796.

It is an alternative implementation to #3966 using a lot of the "paste" functionality that was already available (for better or worse). I elected to read the file "raw" without going through the Document infrastructure as eventually it was being read directly into a String and, because it reuses the paste_impl function already, decided to skip the overhead of processing the document first. Oh and as a bonus it supports multiple files.

The command has been implemented as:
file-paste-after and file-paste-before
... to keep it in line with the current :*-paste-[before|after|replace] commands.

It does have basic file picker integration (which I am the most iffy with - comments/fixes expected and welcome!), using what seemed to be the easiest path - through the Actions enum. In particular, I'm looking for any suggestions as to what should happen in helix-view/src/editor.rs. It's not currently hit in any path so I've left it as a noop for now. Not great, but I just wanted something up for comments.

Beginning with rust so any code suggestions/critiques/guidance welcome. Additionally, any insight as to how to get c-O to work in the picker would be great 😄

Opted for a "paste" like function and reused the existing paste
functionality.

This allows for Paste::Before/After to be used.
@kirawi kirawi added A-helix-term Area: Helix term improvements S-waiting-on-review Status: Awaiting review from a maintainer. labels Oct 10, 2022
@pascalkuthe
Copy link
Member

I am closing this PR as stale as it has a lot of conflicts. I also don't see us going in this direction. Instead we will more liekly add a simple :read command instead.

Thank you for contributing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants