Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

insert_final_newline being removed and added again every save #121

Closed
scttcper opened this issue Oct 27, 2016 · 6 comments
Closed

insert_final_newline being removed and added again every save #121

scttcper opened this issue Oct 27, 2016 · 6 comments

Comments

@scttcper
Copy link

scttcper commented Oct 27, 2016

I'm back. When using insert_final_newline = true the final line at the bottom is being removed and added again every save. This blocks the undo button.

How to test:

  1. Write some text on line 1
  2. Manually add your own final newline
  3. Write more text on line 1
  4. Save
  5. Undo (ctrl + z) should remove the text written in step 3 but instead it removes a newline that is being removed and written every save.
@florianb
Copy link
Collaborator

I hoped it would be you.. 😁
Let me check that, but it is likely the undo-history is changed.

@florianb
Copy link
Collaborator

Okay.. i guess i have to apologize. The insert_final_newline-algorithm is badly implemented. I will fix that.

Would you either expect to have insert_final_newline create an undo-marker, if a final newline was added, or should it add the final newline silently? I guess i would prefer first, since every change should create an undo-marker, eh?

@scttcper
Copy link
Author

scttcper commented Oct 27, 2016

I would expect a marker if it was added yeah

I think thats how whitespace works too.

@florianb
Copy link
Collaborator

Aye.. expect a patch soon.

florianb pushed a commit to florianb/atom-editorconfig that referenced this issue Oct 27, 2016
florianb pushed a commit to florianb/atom-editorconfig that referenced this issue Oct 27, 2016
@florianb
Copy link
Collaborator

Hey @scttcper, the new patch is published. 🙏

@scttcper
Copy link
Author

10/10 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants