adrianlee44 / atom-aligner

Easily align multi-line with support for different operators and custom configurations
https://atom.io/packages/aligner
MIT License
77 stars 3 forks source link

indent spaces instead of tabs #46

Closed geminorum closed 8 years ago

geminorum commented 8 years ago

not following the editor settings to use soft or hard tabs.

Tab Type Determine character inserted when Tab key is pressed. Possible values: "auto", "soft" and "hard". When set to "soft" or "hard", soft tabs (spaces) or hard tabs (tab characters) are used. When set to "auto", the editor auto-detects the tab type based on the contents of the buffer (it uses the first leading whitespace on a non-comment line), or uses the value of the Soft Tabs config setting if auto-detection fails.

in my case aligner will convert all indent tabs into spaces

adrianlee44 commented 8 years ago

Thanks for reporting this @geminorum. Let me take a look.

adrianlee44 commented 8 years ago

Are you referring to the spaces/tabs before the first character of the line or the spaces/tabs around the character that you are trying to align?

geminorum commented 8 years ago

Are you referring to the spaces/tabs before the first character of the line or the spaces/tabs around the character that you are trying to align?

before the first character

adrianlee44 commented 8 years ago

I'm having trouble reproduce the bug. These are the test cases I have tried and please let me know if I miss your use case.

  1. Tab Type: auto, Soft Tabs: true
  2. Tab Type: soft, Soft Tabs: true
  3. Tab Type: hard, Soft Tabs: true
  4. Tab Type: auto, Soft Tabs: false
  5. Tab Type: soft, Soft Tabs: false
  6. Tab Type: hard, Soft Tabs: false

All of the above test cases kept the same indentation length and type when aligning.

I'm on Atom 1.4.0 with aligner 0.17.4.

Can you provide more information such as editor configuration, or video? Thanks.

adrianlee44 commented 8 years ago

@geminorum, are you still seeing this bug?

geminorum commented 8 years ago

Still a problem on Atom 1.4.1 with aligner 0.18.0 / aligner-php 1.0.0

here I'm using NPP to demonstrate the bug:

aligner-bug-before Before: hence the arrows as hard tabs

aligner-bug-after After: the replaced dots as spaces (soft tabs)

adrianlee44 commented 8 years ago

I'm using Atom 1.4.1 with the latest aligner and aligner-php on OSX.

I created the file on Atom and double checked on Sublime Text 3. I wasn't able to reproduce the bug but I'll try it again on Windows.

Original file on Atom

screen shot 2016-01-29 at 10 07 30 pm

Original file on Sublime

screen shot 2016-01-29 at 10 08 09 pm

After aligning on Atom

screen shot 2016-01-29 at 10 09 28 pm

After aligning on Sublime

screen shot 2016-01-29 at 10 09 36 pm
adrianlee44 commented 8 years ago

I just tried this out on Windows with Atom 1.4.1 and the latest aligner and aligner-php.

This is using Atom and double checking with NPP. I wasn't able to reproduce the bug.

Before screenshot1

After screenshot2

geminorum commented 8 years ago

Just tested with freshly installed Atom on Ubuntu, still the same problem. :)

adrianlee44 commented 8 years ago

I just reproduced the bug. The key was to hide invisibles. Thanks.

adrianlee44 commented 8 years ago

This should be fixed with v0.18.1. Please let me know if you are still seeing the bug after updating. Thanks for all your help and reporting this issue.

geminorum commented 8 years ago

fixed on 0.18.1 thanks a lot.