atom / whitespace

Atom whitespace package
MIT License
94 stars 61 forks source link

syntax-scope config broken #151

Closed ulybu closed 7 years ago

ulybu commented 7 years ago

Prerequisites

Description

  1. pug files aren't by default exempted from trailing whitespaces autoremove, as stated in the readme

    Note: for .source.jade, .source.diff, .source.pug and .source.patch, removing trailing whitespace is disabled by default.

2 . Can't disabled auto removal of trailing whitespaces for a specific language (syntax-scoped properties) with

'.source.pug':
  whitespace:
    removeTrailingWhitespace: false

Steps to Reproduce

  1. Default options not working: Whithout touching package's options
    1. open pug file, add a trailing whitespace
    2. move away th cursor from the line
    3. save
  2. manually enforcing syntax-scope
    1. open config.cson
    2. add
      '.source.pug':
      whitespace:
      removeTrailingWhitespace: false
    3. redo steps 1.ii and 1.iii

Expected behavior: trailing whitespace shouldn't be removed on save

Actual behavior: trailing is removed on save

Reproduces how often: On my setup: everytime

Versions

apm  1.10.0
npm  2.13.3
node 0.10.40
python 2.7.12
git 2.7.4
Atom    : 1.9.6
Electron: 0.37.8
Chrome  : 49.0.2623.75
Node    : 5.10.0

Ubuntu 16.04 LTS Whitespace 0.32.2 atom-pug 0.2.0

Additional Information

Haven't try that with other OS/config

blakewhite commented 7 years ago

Markdown files are similarly having trailing 2 spaces removed from lines with the 'Keep Markdown Line Break Whitespace' option turned on. I think there might be a larger underlying bug.

winstliu commented 7 years ago

Atom : 1.9.6

Your Atom version is approximately a year old - the latest Atom version is currently Atom 1.19.2. If you can still reproduce this on that version, I'll be happy to reopen this issue.

blakewhite commented 7 years ago

I'm not sure about the original bug, but my comment still stands on version 1.19.0 x64

winstliu commented 7 years ago

@blakewhite Whoops, thought you two were the same person! If you're using language-markdown, please follow https://github.com/burodepeper/language-markdown/blob/master/FAQ.md#trailing-whitespace-is-automatically-removed-but-i-dont-want-that.

SampsonCrowley commented 6 years ago

I have no idea how you closed this without even testing man, this is still an issue with atom 1.23.1

result of scope Descriptor:

scopes:
  0: "text.html.ruby"
  1: "source.ruby.rails.embedded.html"
  2: "string.quoted.single.ruby"
  3: "punctuation.definition.string.begin.ruby"

relevant config.cson

"text.html.ruby":
  whitespace:
    ensureSingleTrailingNewline: false
    removeTrailingWhitespace: false
"text.plain":
  whitespace:
    ensureSingleTrailingNewline: false
    removeTrailingWhitespace: false

as you can see text.html.ruby is clearly a scope of the file i am using, yet setting ensureSingleTrailingNewline: false does absolutely nothing. Whitespace keeps adding the newline anyways

disabled entire package until this is properly fixed

winstliu commented 6 years ago

@SampsonCrowley please open a new issue so that we can ensure that all the prerequisites have been followed. Thanks!

SampsonCrowley commented 6 years ago

no need. after looking at some other sls's i have text.html.ruby should have been .text.html.ruby