Closed suienzan closed 6 years ago
+1, I can confirm I am seeing this same issue. I tried adding additional general settings of:
general:
indent_char: " "
indent_size: 4
which did not fix the problem.
(If you need a workaround until this bug is fixed, you can also install tabs-to-spaces and have it run after the code is beautified.)
I was able to fix this a little jankily by changing the default values in the code
In ~/.atom/packages/atom-beautify/node_modules/pug-beautify/index.js, at lines 6-9, I changed:
var fill_tab = (typeof opt.fill_tab !== 'undefined') ? opt.fill_tab : true;
var omit_div = (typeof opt.omit_div !== 'undefined') ? opt.omit_div : false;
var tab_size = (typeof opt.tab_size !== 'undefined') ? opt.tab_size : 4;
var debug = (typeof opt.debug !== 'undefined') ? opt.debug : false;
To:
var fill_tab = (typeof opt.fill_tab !== 'undefined') ? opt.fill_tab : false;
var omit_div = (typeof opt.omit_div !== 'undefined') ? opt.omit_div : false;
var tab_size = (typeof opt.tab_size !== 'undefined') ? opt.tab_size : 2;
var debug = (typeof opt.debug !== 'undefined') ? opt.debug : false;
so the default fill_tab option is now false and the tab_size is 2 (which you can change to your preference)
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.
Description
When beautify
<template lang='pug'>
part in.vue
files, indent char will be force to tab.Input Before Beautification
This is what the code looked like before:
Expected Output
The beautified code should have looked like this:
Actual Output
The beautified code actually looked like this:
It changes the two space to a tab. While if use file extension
.pug
, the output will be as expected.Steps to Reproduce
Atom Beautify: Beautify Editor
Debug
Here is a link to the
debug.md
Gist: https://gist.github.com/midori-tooyama/8e7909f1b98bc54677cc0cb8a9ffd2f6Checklist
I have:
Atom Beautify: Help Debug Editor
command in Atom and added link fordebug.md
Gist to this issue