Skip to content

File dialogs - #41

Merged
MawCeron merged 2 commits into
developfrom
milestone/v0.1.3
Aug 19, 2026
Merged

File dialogs#41
MawCeron merged 2 commits into
developfrom
milestone/v0.1.3

Conversation

@MawCeron

Copy link
Copy Markdown
Owner

What changed

v0.1.3 milestone: "The file dialogs. Two one-line fixes, verifiable by hand in ten seconds."

  • fix: scroll the save-as listing by the rows it actually drawsfilePanel reserved two rows under the listing for the filename field in save-as mode, but browse scrolled with the full, unreduced panel height, so the cursor could scroll below what was actually drawn. Factored the row count into one listRows() method both call sites now share.
  • fix: absolutize the open document's path before the overwrite guardcommitName compared an absolute path built from a.exp.dir against a.ed.Path exactly as typed, which stays relative for a document opened as justwrite nota.md. Saving under the file's own name asked to overwrite the file already open.

Closes #5, #6

Test plan

  • go build ./..., go vet ./..., gofmt -l . clean
  • go test ./... and go test -race ./... pass
  • New tests: TestSaveAsScrollStaysInsideWhatItDraws, TestSaveAsOverTheOpenFileAsksNothing — both verified to fail on the pre-fix code and pass on the fix

filePanel reserved two rows under the listing for the filename
field in save-as mode, but browse scrolled with the full,
unreduced panel height. The two disagreed by exactly two rows, so
holding the cursor down in a long listing pushed the selection
below what was actually drawn, off the bottom of the panel.
Factor the row count into one method and have both call sites use
it, so they can no longer drift apart.

Closes #5
commitName compared an absolute path built from a.exp.dir (refresh
already runs it through filepath.Abs) against a.ed.Path exactly as
the user typed it, which stays relative for a document opened as
`justwrite nota.md`. The two named the same file but never
compared equal, so saving under the file's own name asked to
overwrite the file already open.

Closes #6
@MawCeron
MawCeron merged commit d8b1d48 into develop Aug 19, 2026
3 checks passed
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.

1 participant