sindresorhus / atom-editorconfig

Helps developers maintain consistent coding styles between different editors
https://atom.io/packages/editorconfig
MIT License
812 stars 80 forks source link

Syntax highlights flashing on save 1.5.2 #109

Closed scttcper closed 7 years ago

scttcper commented 7 years ago

I have the whitespace package disabled and editorconfig@1.5.2 and the syntax colors are flashing to white on save. When editor config is disabled (+ restart atom) this is no longer an issue. This happens with both the default javascript syntax package and the language-babel package. Atom 1.11.2

Involved .editorconfig-files

# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

Directory structure

standard small node app src/index.js

Installed packages

Built-in Atom Packages (89)
├── atom-dark-syntax@0.27.0
├── atom-dark-ui@0.52.0
├── atom-light-syntax@0.28.0
├── atom-light-ui@0.44.0
├── base16-tomorrow-dark-theme@1.2.0
├── base16-tomorrow-light-theme@1.2.0
├── one-dark-ui@1.6.0
├── one-light-ui@1.6.0
├── one-dark-syntax@1.3.0
├── one-light-syntax@1.3.0
├── solarized-dark-syntax@1.0.2
├── solarized-light-syntax@1.0.2
├── about@1.7.0
├── archive-view@0.61.1
├── autocomplete-atom-api@0.10.0
├── autocomplete-css@0.11.2
├── autocomplete-html@0.7.2
├── autocomplete-plus@2.31.1
├── autocomplete-snippets@1.11.0
├── autoflow@0.27.0
├── autosave@0.23.1
├── background-tips@0.26.1
├── bookmarks@0.42.0
├── bracket-matcher@0.82.1
├── command-palette@0.38.0
├── deprecation-cop@0.54.1
├── dev-live-reload@0.47.0
├── encoding-selector@0.22.0
├── exception-reporting@0.40.0
├── find-and-replace@0.201.1
├── fuzzy-finder@1.4.0
├── git-diff@1.1.0
├── go-to-line@0.31.0
├── grammar-selector@0.48.2
├── image-view@0.59.0
├── incompatible-packages@0.26.1
├── keybinding-resolver@0.35.0
├── line-ending-selector@0.5.0
├── link@0.31.1
├── markdown-preview@0.158.0
├── metrics@1.0.0
├── notifications@0.65.1
├── open-on-github@1.2.0
├── package-generator@1.0.0
├── settings-view@0.242.2-hotfix1
├── snippets@1.0.2
├── spell-check@0.68.2
├── status-bar@1.4.1
├── styleguide@0.47.0
├── symbols-view@0.113.1
├── tabs@0.101.0
├── timecop@0.33.2
├── tree-view@0.209.3
├── update-package-dependencies@0.10.0
├── welcome@0.35.1
├── whitespace@0.33.0
├── wrap-guide@0.38.2
├── language-c@0.52.1
├── language-clojure@0.21.0
├── language-coffee-script@0.47.2
├── language-csharp@0.12.1
├── language-css@0.37.1
├── language-gfm@0.88.0
├── language-git@0.15.0
├── language-go@0.42.1
├── language-html@0.45.1
├── language-hyperlink@0.16.0
├── language-java@0.23.0
├── language-javascript@0.119.0
├── language-json@0.18.2
├── language-less@0.29.5
├── language-make@0.22.2
├── language-mustache@0.13.0
├── language-objective-c@0.15.1
├── language-perl@0.35.0
├── language-php@0.37.2
├── language-property-list@0.8.0
├── language-python@0.45.0
├── language-ruby@0.69.0
├── language-ruby-on-rails@0.25.0
├── language-sass@0.56.0
├── language-shellscript@0.22.4
├── language-source@0.9.0
├── language-sql@0.23.0
├── language-text@0.7.1
├── language-todo@0.28.0
├── language-toml@0.18.0
├── language-xml@0.34.9
└── language-yaml@0.26.0

Community Packages (20) /Users/scoope7/.atom/packages
├── atom-beautify@0.29.13
├── atom-typescript@10.1.9
├── autocomplete-emojis@2.5.0
├── autocomplete-json@5.1.0
├── autocomplete-modules@1.6.7
├── docblockr@0.8.7
├── editorconfig@1.5.2
├── file-icons@1.7.22
├── highlight-selected@0.11.2
├── language-babel@2.45.0
├── linter@1.11.18
├── linter-csslint@1.3.3
├── linter-eslint@8.0.0
├── linter-flake8@2.0.2
├── minimap@4.25.4
├── monokai@0.18.0
├── pigments@0.37.0
├── python-isort@0.0.7
├── sort-lines@0.14.0
└── travis-ci-status@1.3.0

└── (empty)
florianb commented 7 years ago

@scttcper Thank you very much for reporting this issue!

May i ask if

Thanks in advance!

scttcper commented 7 years ago

Playing around with it more it seems to be python too and probably other syntaxes. Only line 51 and up flash. All lines before that seem unaffected.

I cloned this repo and tried to reproduce and it doesn't seem to happen. It could have something to do with my particular editor config? Edit: nevermind spoke too soon

florianb commented 7 years ago

That's pretty interesting and i guess this is indirectly caused by a other package. I already started crawling their sources to see if there is anything suspicious.

Just for clarification, if trim_trailing_whitespace (true) or insert_final_newline (true or false) are set, editorconfig will "adjust" the text immediately before it gets saved (onWillSave). So it might be that other packages listen get invoked again due to this edit.

I am searching how this might happen.

scttcper commented 7 years ago

Here's a terrible gif of the flashing in this repo. recording

florianb commented 7 years ago

Thanks a lot!

florianb commented 7 years ago

@scttcper I am able to reproduce it - i am working on a solution.

florianb commented 7 years ago

Okay @scttcper this issue is indirectly caused by our call of TextBuffer.setText() -- i have currently no clue why this happens, but i will solve this as soon as possible. I am sorry for any inconvenience! ☕️

florianb commented 7 years ago

Hey @scttcper - i figured out what made this happen. Thanks again for your support!

Oh, and it would be nice if you could check if this is working for you! 💝

florianb commented 7 years ago

Oh -- it may take some time until the updates are available.. Heroku seems to have troubles: https://status.heroku.com/

scttcper commented 7 years ago

Have not been able to confirm yet. 1.5.3 still seems to be the latest version. Maybe its still catching up from the outage this morning.

scttcper commented 7 years ago

@florianb please re-publish whenever you get a chance. 1.5.4 doesn't seem to be getting picked up.

florianb commented 7 years ago

@scttcper: I am sorry to hear that. I will release a new version as soon as possible.

florianb commented 7 years ago

Hi @scttcper i recently released 1.6.0 -- please let me know if this solves your problem. Thank you very much for your patience and sorry for the inconveniences! 💝

ghost commented 7 years ago

@florianb looking good here, thanks for the quick turnaround!

scttcper commented 7 years ago

@florianb Boom! 🍾 🎉 👍