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

Ignore extension when renaming directory #1664

Merged
merged 1 commit into from
Mar 31, 2024
Merged

Conversation

Limero
Copy link
Contributor

@Limero Limero commented Mar 30, 2024

I noticed when renaming a directory that had a . in the name that it would put the cursor before the dot. It doesn't make sense to treat that as a file extension, so this PR ignores this logic when renaming a directory.

Copy link
Collaborator

@joelim-work joelim-work left a comment

Choose a reason for hiding this comment

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

Thanks for the changes, looks good to me.


BTW, it might be useful to extract this as a utility function - unfortunately the standard library function filepath.Ext has the following problems:

  • A hidden file (e.g. .gitignore) is treated as having an extension.
  • The path is only evaluated as a string, so the result is the same regardless of whether it points to a file or a direectory.

The reason I mention this is that dupfilefmt (which you introduced in #1315) also has the same problem. But that can be addressed later.

@gokcehan gokcehan merged commit 702d675 into gokcehan:master Mar 31, 2024
4 checks passed
@gokcehan gokcehan mentioned this pull request Mar 31, 2024
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