atom / whitespace

Atom whitespace package
MIT License
94 stars 67 forks source link

'whitespace' does not work with 'autosave' #178

Closed carvalhoviniciusluiz closed 6 years ago

carvalhoviniciusluiz commented 6 years ago

Description

'whitespace' in conjunction with the 'autosave' enabled package does not work. When the window loses focus, the file is saved, but whitespace is not removed

Steps to Reproduce

  1. window loses focus
  2. 'whitespace' triggers the trigger to remove spaces
Aerijo commented 6 years ago

Is it enabled for that language? Does it work for anything? Check the config file for any language specific settings related to whitespace.

Also, please provide much more context when raising an issue. The issue template is there because we need that information to (1) confirm it's an issue with Atom, and not a community package, and (2) identify and fix any bugs.

carvalhoviniciusluiz commented 6 years ago

I do not know what, but I need to provide information. Lets do this

whitespace package

  1. Access the "settings" option (cmd + ,)
  2. go to the "packages" menu and search for 'whitespace'
  3. Access the package settings
  4. Clear the option "Ensure Single Trailing Newline"

autosave package

  1. Access the settings option (cmd + ,)
  2. go to the packages menu and search for 'autosave'
  3. Access the package settings
  4. Check the option "enabled"

current scenario

with the patotes following the informed settings

  1. the developer changes a file by adding multiple blank spaces
  2. If the developer changes file tab, the previous file will be saved automatically but will not have the spaces removed.
  3. If the developer saves the file manually (cmd + s) and the cursor is on the same line that contains the blank spaces, that line will not have the spaces removed

ideal setting

with the patotes following the informed settings

  1. the developer changes a file by adding multiple blank spaces
  2. If the developer changes the file tab, the previous file will be saved automatically and the white space will be removed automatically.
  3. If the developer saves the file manually (cmd + s) and the cursor is on the same line that contains the blanks, that line is removed if it has no code

to be clearer, this behavior should be the same as the "trim_trailing_white_space_on_save" option in the Sublime Text!