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

write-quit-all will write files without any changes #1760

Closed
antoyo opened this issue Mar 6, 2022 · 2 comments
Closed

write-quit-all will write files without any changes #1760

antoyo opened this issue Mar 6, 2022 · 2 comments
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@antoyo
Copy link
Contributor

antoyo commented Mar 6, 2022

Reproduction steps

  • Open a file that doesn't exists: helix new_file.
  • Use the command :write-quit-all.

The file will be created while I would expect the file to not be created because no changes were made (vim's behavior).
I believe the file should not be created because that's convenient to users that have a mapping to :write-quit-all.

Using :write alone should probably still create the file though (vim's behavior).

Environment

  • Platform: Linux
  • Terminal emulator: Alacritty
  • Helix version: helix v0.6.0
~/.cache/helix/helix.log

Nothing

@antoyo antoyo added the C-bug Category: This is a bug label Mar 6, 2022
@kirawi kirawi added the A-helix-term Area: Helix term improvements label Mar 6, 2022
@matoous
Copy link
Contributor

matoous commented Dec 11, 2022

This was fixed as a by-product of: #1444.

@antoyo
Copy link
Contributor Author

antoyo commented Dec 11, 2022

Indeed. Thanks!

@antoyo antoyo closed this as completed Dec 11, 2022
zqianem added a commit to zqianem/helix that referenced this issue Sep 3, 2023
This resolves helix-editor#4274 with the implementation largely based off of helix-editor#5435
and also addresses the review from @the-mikedavis on that PR.

The option name is from EditorConfig's `insert_final_newline`, which is
also used by VS Code as `files.insertFinalNewline`.

We match Vim's behavior in that :w will add the newline to unmodified
files but :wa will not; see helix-editor#1760.

Co-authored by: Xalfer <[email protected]>
zqianem added a commit to zqianem/helix that referenced this issue Sep 3, 2023
This resolves helix-editor#4274 with the implementation largely based off of helix-editor#5435
and also addresses the review from @the-mikedavis on that PR.

The option name is from EditorConfig's `insert_final_newline`, which is
also used by VS Code as `files.insertFinalNewline`.

We match Vim's behavior in that :w will add the newline to unmodified
files but :wa will not; see helix-editor#1760.

Co-authored-by: Xalfer <[email protected]>
zqianem added a commit to zqianem/helix that referenced this issue Sep 3, 2023
This resolves helix-editor#4274 with the implementation largely based off of helix-editor#5435
and also addresses the review from @the-mikedavis on that PR.

The option name is from EditorConfig's `insert_final_newline`, which is
also used by VS Code as `files.insertFinalNewline`.

We match Vim's behavior in that :w will add the newline to unmodified
files but :wa will not; see helix-editor#1760. Tests are included for this.

Co-authored-by: Xalfer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

3 participants