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

Indent with tab issue on website #1470

Closed
clarkWGriswold opened this issue Aug 2, 2018 · 9 comments
Closed

Indent with tab issue on website #1470

clarkWGriswold opened this issue Aug 2, 2018 · 9 comments

Comments

@clarkWGriswold
Copy link

clarkWGriswold commented Aug 2, 2018

Beautifying with "Indent with a tab character" is indenting with a single space, see below.

answer = checkForHardFreezeBlackoutSchedules();

function checkForHardFreezeBlackoutSchedules() {

 var blackoutHelper = new TUChangeBlackoutHelper();
 var startDate = new GlideDateTime(current.start_date);
 var endDate = new GlideDateTime(current.end_date);

 var blckOutSchedGR = new GlideRecord('cmn_schedule_blackout');
 blckOutSchedGR.addQuery('u_type_of_freeze', 'Hard');
 blckOutSchedGR.query();

 while (blckOutSchedGR.next()) {

  if (blackoutHelper.isTimeFrameInBlackoutWindows(startDate, endDate, String(blckOutSchedGR.sys_id), true)) {

   return 'yes';
  }
 }
 return 'yes';
 //return 'no';
}
@bitwiseman
Copy link
Member

@clarkWGriswold where are you seeing this issue (website, nodejs, python, some editor plugin)? What version of beautifier are you using?

@templarundead
Copy link

Website v1.8.0-rc4

@clarkWGriswold
Copy link
Author

clarkWGriswold commented Aug 4, 2018 via email

@bitwiseman
Copy link
Member

@clarkWGriswold
There's problems displaying tabs on webpages.
I'm not sure how to fix this yet. It maybe a tab display issue or it may be that I have an old version of codemirror.
https://stackoverflow.com/questions/3946688/encoding-a-tab-in-html

@clarkWGriswold
Copy link
Author

clarkWGriswold commented Aug 8, 2018 via email

@bitwiseman
Copy link
Member

Hmm ...
https://github.com/beautify-web/js-beautify/blob/master/index.html#L78 just sets the value to 1.
https://github.com/beautify-web/js-beautify/blob/master/web/common-function.js#L153 sets the indent char to \t but I'm wondering if I should make it \\t.

@bitwiseman
Copy link
Member

Oh, I see it:
https://github.com/beautify-web/js-beautify/blob/master/web/common-function.js#L152 gets the value of the web pages setting, which is a string. Then 153, checks if that is equal to a number. 😱

@bitwiseman bitwiseman added this to the v1.8.x milestone Aug 8, 2018
bitwiseman added a commit that referenced this issue Aug 8, 2018
@bitwiseman
Copy link
Member

@clarkWGriswold
Thanks for your help. I've cherry-picked this fix to the website, so it should be working now.

@bitwiseman bitwiseman changed the title Indent with tab issue Indent with tab issue on website Aug 8, 2018
@clarkWGriswold
Copy link
Author

clarkWGriswold commented Aug 8, 2018 via email

@bitwiseman bitwiseman modified the milestones: v1.8.x, 1.8.0-rc7 Aug 14, 2018
@bitwiseman bitwiseman modified the milestones: 1.8.0-rc8, 1.8.0 Aug 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants