In the Katalon Q&A posts, Code is malformated; TAB characters are poorly processed

The other day I made a post at Katalon Q&A. You will find the following Code snippet.
The code snippet is poorly formatted. A few CR+LF disappered, TABs disappered. The original code was like this:

I wondered why whitespace characters were poorly processed, and I found why.

I copied the text range of original codes in editor by clicking right mouse button, and then pasted it into the Katalon Q&A post. At this very timing I found some CR+LF and all of TAB characters are ignored when pasted.

I think that it is very difficult to process TAB characters properly = replace TAB to some number of SPACE characters when pasted. It would require complexed JavaScript to achieve, just in the way Github’s Gist UI.

I think that I had better NOT to use TABs for text in Katalon Studio (just to make it better prepared for posting), I should rather use 4 SPACE characters instead in Katalon Studio. If I use SPACEs instaed of TABs, any copy-and-pasted code snippet into the Katalon Q&A posts would be formatted fine.

So I have a proposal to Katalon Team.

I check the default setting of current Katalon Studio, which is as follows:

As you can see,

  • it does NOT insert spaces for tabs
  • it does NOT show whitespace characters visible

I would like to propose to change the default setting of Katalon Studio as follows:

  • it DOES insert spaces for tabs
  • it DOES show whitespace characters visible
  • I would prefer CR+LF stay invisible, but other people may prefer them visible

code_poorly_formatted.png

code_in_editor_without_visible_tabs.png

current_default_settings_of_texteditor.png

proposed_default_settings_of_texteditor.png

1 Like

I realized that the setting in Preference>General>Editors>TextEditors is not enough.
In order to replace indenting TAB with SPACES, I had to tune the settings in Preference >Java>CodeStyle>Formatter in Katalon Studio.

Preferences_Java_CodeStyle_Formatter.PNG

1 Like