Atom-beautify: Indent does not work as it should with Uncrustify beautifier

Created on 3 Sep 2016  路  6Comments  路  Source: Glavin001/atom-beautify

Description

The results of beautification are not what I expect.

Expected Results

The beautified code should have looked like:

#include <iostream>

int main()
{
    std::cout<<"XDDD";
    std::cout<<"LOOOOOL";
    return 0;
}

Steps to Reproduce

  1. Add code to Atom editor
  2. Run command Atom Beautify: Beautify Editor
  3. This beautified code does not look right! (there are 2 TABS (size 4) instead of just one)
  4. I've editted 3 files : .jsbeautifyrc in source file directory in %USERPROFILE% Windows directory and in packages/src directory - nothing works

    Debug

Here is a link to the debug.md Gist: https://gist.github.com/49b17f9a5a86abd8927cf01181d77c34

Checklist

  • [x] I have tried uninstalling and reinstalling Atom Beautify to ensure it installed properly
  • [x] I have reloaded (or restarted) Atom to ensure it is not a caching issue
  • [ ] Searched for existing Atom Beautify Issues at https://github.com/Glavin001/atom-beautify/issues
    so I know this is not a duplicate issue
  • [x] Generated debugging information and added link for debug.md Gist to this issue
bug stale windows

Most helpful comment

if you want to change the tab width from 8(Unix default) to 4:

$ atom ~/.atom/packages/atom-beautify/src/beautifiers/uncrustify/default.cfg
output_tab_size = 4 # (edit about line 14) 
indent_columns  = 4 # (edit about line 42) 

then change path of the C and C++ setting of atom-beautify:
~/.atom/packages/atom-beautify/src/beautifiers/uncrustify/default.cfg

All 6 comments

I had the same problem until yesterday when Atom was x.09
Today with Atom x.10 I did uninstall Beautify and after re-installing it I left all the settings to default.
So far so good, but I did not yet enable on save option for js and json. If it won't work I'll update this comment.
Hope it helps

Dunno, still doesn't work

@Frynio I had the same problem while working with jinja html templates for python. If you look in the lower right corner atom displays the detected language for the document open in the editor, atom was detecting the document to be written in HTML(Angular) when it's actual type was plain HTML. This was throwing off beautify and it was using what ever beautify's default tab settings were.

@Frynio are you still experiencing this issue? It may be an issue with how Atom-Beautify integrates with Uncrustify.

if you want to change the tab width from 8(Unix default) to 4:

$ atom ~/.atom/packages/atom-beautify/src/beautifiers/uncrustify/default.cfg
output_tab_size = 4 # (edit about line 14) 
indent_columns  = 4 # (edit about line 42) 

then change path of the C and C++ setting of atom-beautify:
~/.atom/packages/atom-beautify/src/beautifiers/uncrustify/default.cfg

This issue has been automatically marked as stale because it has not had recent activity. If this is still an issue, please add a comment. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings