-
-
Notifications
You must be signed in to change notification settings - Fork 401
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: add replace function #400
base: harpoon2
Are you sure you want to change the base?
Conversation
i am unlikely have this change. i don't think i want this level of functionality in harpoon. let me stew on it for a few days. there is something about making things so fully featured that feels wrong or too complicated |
I liked this idea because most of the time I'm working in 3~4 files, one to code a feat, other test, and sometimes third and four there are files to use this feat. When I change the implementation I have to go in UI and remove the files, with replace this can help that you don't need to delete or move the file on the UI. I tested and works fine I want to hear more of the thoughts that Prime have about, maybe I'm not seeing something important. |
its just hard to use :) and requires a lot of remaps, but i can be convinced on this one dalton if you say this is a great one, maybe i just need a bit more time and could come around to using this myself. i just think its a lot of over head :) |
so when we add an item, we emit an event. you need to think of events to emit here, which probably will be add, remove, and move |
960c21e
to
96fb609
Compare
Yeah I get that it might be over complicated. The main idea is to not have to go in the ui to remove a file i'm done working with, and directly add a new one in it's place. I added events:
|
ok i have one problem with this if you replace at position 3 and there are no items in the list then we have something broken. The list's length will be 0, but there is 1 item in it (position 3). You need a way to prevent this from happening |
If you attempt to replace a position that is empty, the So in this case, the item would be put at position 1 and counted in the length. |
Add a replace function that either:
example
With these key binds:
And this harpoon list:
Pressing M-k in file_1 results in:
Pressing M-k in file_3 results in:
If there is no file harpooned at the selected index, it appends the file,
pressing M-l in file_1: