Skip to content

fix(#2086): fix api.fs.rename_sub doesn't remove previous filename anymore #2087

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

Merged
merged 1 commit into from
Mar 26, 2023
Merged

fix(#2086): fix api.fs.rename_sub doesn't remove previous filename anymore #2087

merged 1 commit into from
Mar 26, 2023

Conversation

pholawat-tle
Copy link
Contributor

@pholawat-tle pholawat-tle commented Mar 26, 2023

fix issue #2086

Replace :p modifier with :p:h to replicate behavior prior to the bug
Reference: https://vimhelp.org/cmdline.txt.html#filename-modifiers

Before

image

After

image

Copy link
Member

@alex-courtis alex-courtis left a comment

Choose a reason for hiding this comment

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

This works nicely, many thanks for your contribution.

It matches the mapping description "Rename: Omit Filename"

@alex-courtis alex-courtis merged commit a38f9a5 into nvim-tree:master Mar 26, 2023
@pholawat-tle pholawat-tle deleted the 2086-fix-rename_sub branch March 27, 2023 00:19
@aemonge
Copy link

aemonge commented Apr 12, 2023

So how do I set the setting to get the previous filename?

                    vim.keymap.set('n', 'e', api.fs.rename_sub, opts('Rename: Absolute Path'))

@pholawat-tle
Copy link
Contributor Author

So how do I set the setting to get the previous filename?

                    vim.keymap.set('n', 'e', api.fs.rename_sub, opts('Rename: Absolute Path'))

Do vim.keymap.set("n", "r", api.fs.rename, opts("Rename"))

@aemonge
Copy link

aemonge commented Apr 19, 2023

Can it get mixed with Absolute Path?

It was pretty useful to simple edit the path, to move it to another directory.

@alex-courtis
Copy link
Member

Can it get mixed with Absolute Path?

See #2148

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.

3 participants