jtokoph / auto-detect-indentation

Auto detect indentation of files in Atom
MIT License
39 stars 6 forks source link

Delay indentation detection until buffer is tokenized #12

Closed sryze closed 8 years ago

sryze commented 8 years ago

This fixes #7.

sryze commented 8 years ago

It looks like the specs need to be updated as well, I'll attempt to do it later tonight.

jtokoph commented 8 years ago

The package currently attempts to detect indentation before tokenization because a file might be opened that doesn't have a corresponding language package. It will still re-detect after the tokenization. On Mon, Mar 14, 2016 at 12:31 AM Sergey Zolotarev notifications@github.com wrote:

It looks like the specs need to be updated as well, I'll attempt to do it later tonight.

— Reply to this email directly or view it on GitHub https://github.com/jtokoph/auto-detect-indentation/pull/12#issuecomment-196182494 .

Jason

sryze commented 8 years ago

Oh, didn't see that. I actually consoled out what editor.isBufferRowCommented i was returning and to my surprise if didn't detect any of the comments. But after adding this it worked.

jtokoph commented 8 years ago

The first pass before tokenization won't detect comments. But the second pass after tokenization will detect them. You should be seeing things logged twice unless there is some other error On Mon, Mar 14, 2016 at 8:28 AM Sergey Zolotarev notifications@github.com wrote:

Oh, didn't see that. I actually consoled out what editor.isBufferRowCommented i was returning and to my surprise if didn't detect any of the comments. But after adding this it worked.

— Reply to this email directly or view it on GitHub https://github.com/jtokoph/auto-detect-indentation/pull/12#issuecomment-196368380 .

Jason