Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug report: codes formatted wrong #1

Open
willin opened this issue Sep 19, 2017 · 3 comments
Open

bug report: codes formatted wrong #1

willin opened this issue Sep 19, 2017 · 3 comments
Assignees
Labels

Comments

@willin
Copy link

willin commented Sep 19, 2017

such as shell script:

sed -i '' -e '1s/.*/${`date +%Y-%m-%d`}/' src/lib/ip.js
# to
sed -i''-e'1s/.*/${`date +%Y-%m-%d`}/'src/lib/ip.js

i just want this plugin to format code comments and markdown files.

@halfcrazy
Copy link
Owner

halfcrazy commented Sep 19, 2017 via email

@willin
Copy link
Author

willin commented Sep 19, 2017

may like eslint, user can create a .panguignore to ignore files, directories or extentions.

@halfcrazy
Copy link
Owner

For now, you can try version 0.1.5, it introduces a new option, auto_space_on_save_ext for example.
"auto_space_on_save_ext": [".md", ".txt"], then the auto format will only works on file with those ext.

For code and text mixed scenarios, we need AST to get the text from the entire file. I haven't found a general workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants