Skip to content

Conversation

@lemarcantoine
Copy link

My Atom kept freezing each time I created a new .less file so I investigated and fixed 2 bugs.

Also I've seen that you don't maintain the code anymore and you may not want to test my changes. If you agree I can take the ownership of the code and plugin.

Old method needed a newline character to stop, resulting in an endless loop when compiling a one-line file
The old method triggered the LESS compilation on "core:save" which happens before the new file content is actually written on the disk.
With the "onDidSave", you don't need to save your file twice to get your changes compiled.
@schmuli
Copy link
Owner

schmuli commented Apr 21, 2018

I am happy to transfer ownership.

@schmuli
Copy link
Owner

schmuli commented Apr 21, 2018

Two things:

  1. In order to transfer ownership, you have to delete your fork of atom-less, as it will move this repo to your user.
  2. I don't know yet how to transfer the Atom package.


deactivate: ->
@subscriptions.dispose()

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should probably get rid of this too

fs.readFile filepath, (err, fileData) =>
if err != null
callback err
callback null, fileData.toString().match /.*/
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point of this file is to read the first line of a file in the most efficient way possible. So instead of reading in the entire file, which could be very large, we instead read as few bytes as possible while looking for the the newline separator. We then pass the first line to the callback.

Your change is reading the entire file, and is actually passing a RegEx Match object, which is not what the callback is expecting, as far as I know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants