Skip to content

Commit

Permalink
fix: handle edge case where cwd == prevCWD
Browse files Browse the repository at this point in the history
This would cause the path to be displayed incorrectly
  • Loading branch information
ALX99 committed Jun 15, 2024
1 parent 420516d commit 133cabf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/models/main_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,12 @@ func (m Model) viewCWD() string {
return m.sb.String()
}

if m.cwd == m.prevCWD {
m.sb.WriteString(m.cwd)
m.sb.WriteString("/")
return m.sb.String()
}

common := longestCommonPath(m.cwd, m.prevCWD) + "/"

if len(m.cwd) < len(m.prevCWD) {
Expand Down

0 comments on commit 133cabf

Please sign in to comment.