Skip to content

feat: add vim-style warning on exit with unsaved changes#122

Merged
agavra merged 1 commit intoagavra:mainfrom
mikecfisher:feat/quit-warning-unsaved-changes
Jan 20, 2026
Merged

feat: add vim-style warning on exit with unsaved changes#122
agavra merged 1 commit intoagavra:mainfrom
mikecfisher:feat/quit-warning-unsaved-changes

Conversation

@mikecfisher
Copy link
Copy Markdown
Contributor

@mikecfisher mikecfisher commented Jan 20, 2026

Summary

  • :q shows error "No write since last change (add ! to override)" when there are unsaved changes
  • :q! forces quit regardless of dirty state
  • Pressing q in normal mode warns once ("Unsaved changes. Press q again to quit."), second q quits
  • Warning resets when any other action is taken

Closes #61

Test plan

  • Add a comment, press q → should show warning
  • Press q again → should quit
  • Add a comment, type :q → should show error message
  • Type :q! → should quit immediately
  • Add a comment, save with :w, press q → should quit without warning

- :q shows error when dirty, :q\! forces quit

- Pressing q warns once, second q quits

- Warning resets on other actions

Closes agavra#61

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Copy link
Copy Markdown
Owner

@agavra agavra left a comment

Choose a reason for hiding this comment

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

Looks great for your first rust contribution @mikecfisher - thanks for the fix! Also tested locally to make sure it works.

@agavra agavra merged commit b419c75 into agavra:main Jan 20, 2026
4 checks passed
@mikecfisher
Copy link
Copy Markdown
Contributor Author

Thanks for the quick review!

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.

issue a warning before exiting from :q if there are comments in the buffer

2 participants