Skip to content

Commit

Permalink
Ignore extension when renaming directory (#1664)
Browse files Browse the repository at this point in the history
  • Loading branch information
Limero authored Mar 31, 2024
1 parent 1e10e95 commit 702d675
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -1612,8 +1612,8 @@ func (e *callExpr) eval(app *app, args []string) {
normal(app)
app.ui.cmdPrefix = "rename: "
extension := filepath.Ext(curr.Name())
if len(extension) == 0 || extension == curr.Name() {
// no extension or .hidden
if len(extension) == 0 || extension == curr.Name() || curr.IsDir() {
// no extension or .hidden or is directory
app.ui.cmdAccLeft = append(app.ui.cmdAccLeft, []rune(curr.Name())...)
} else {
app.ui.cmdAccLeft = append(app.ui.cmdAccLeft, []rune(curr.Name()[:len(curr.Name())-len(extension)])...)
Expand Down

0 comments on commit 702d675

Please sign in to comment.