Micro: Creepy whitespace in Git-tracked files

Created on 13 Jan 2020  路  6Comments  路  Source: zyedidia/micro

Description of the problem or steps to reproduce

https://github.com/theAkito/serving-hookers/blob/b154a71baae1dd201dcfd5082e0cddf18dd34cc7/ufwban.sh#L75
Look at the broken indentation.

When I use micro to edit my files in WSL, the indentation above seems normal. Wiping the repository and doing a fresh clone, does not change anything about it. In micro the indentation seems normal. When I view it with nano, the indentation is shown as seen in the above link, which is the actual truth.

Specifications

You can use micro -version to get the commit hash.

Commit hash: be34e12
OS: WSL, Debian
Terminal: Microsoft CMD

Additional Information:

  • The problem only occurs on https://github.com/microsoft/WSL.
  • I did not wipe history to see if it changes anything, yet.
  • This problem exists since pretty much ever.

Most helpful comment

Yes, I would check the tabsize option, which defines the width in spaces of a tab character when it is displayed, and the tabstospaces option, which specifies whether micro should insert a tab character when you press tab, or tabsize spaces instead. It looks like you probably want tabsize to be 2 and tabstospaces to be true.

All 6 comments

It looks like the indentation difference is due to tabs instead of spaces. It seems to look ok in micro due to it displaying tabs as 2 spaces.

There may be options for whether to replace tabs by a certain number of spaces for consistency.

Yes, I would check the tabsize option, which defines the width in spaces of a tab character when it is displayed, and the tabstospaces option, which specifies whether micro should insert a tab character when you press tab, or tabsize spaces instead. It looks like you probably want tabsize to be 2 and tabstospaces to be true.

@AaronRobson Can you still reproduce this issue with the latest micro version?

@AaronRobson Can you still reproduce this issue with the latest micro version?

It was @theAkito who reported the issue, I was offering suggestions around the number of spaces a tab is shown as.

Back then, I somehow fixed it by playing around with tab size settings. However, it was not clear to me what the actual issue is and why it was solved. It was solved for me, so I moved on, but I couldn't confirm it indubitably, so I didn't close this issue.

That said, this issue is getting stale, so I guess we can just close it an if this arises another time, one can always re-open or re-create, as well.

Anyway, thanks everyone for taking the time and effort to help me with this issue! 馃槃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nabeelomer picture nabeelomer  路  4Comments

Bigguy34 picture Bigguy34  路  3Comments

Mohamed3on picture Mohamed3on  路  3Comments

AndreyTheHacker picture AndreyTheHacker  路  3Comments

utkarsh2102 picture utkarsh2102  路  3Comments