DoxyDoxygen icon indicating copy to clipboard operation
DoxyDoxygen copied to clipboard

Possible to use tabs instead of spaces?

Open graylaurenm opened this issue 2 years ago • 4 comments

My files have a Tab Size of 4, which I'd like to inherit.

For example, instead of

/**
 * { function_description }
 *
 * @param      <type>  $args   The arguments
 *
 * @return     <type>  ( description_of_the_return_value )
 */

We'd see

/**
* { function_description }
*
* @param	<type>		$args   The arguments
*
* @return	<type>		( description_of_the_return_value )
*/

(Not sure if comments on here respect tabs vs spaces...)

graylaurenm avatar Feb 27 '22 18:02 graylaurenm

Tabs in a comment are converted to spaces when the comment is updated (only tabs used for indentation are preserved). But your need is probably related to the preferred_tabs_sizes setting. Please refer to the user manual for further informations

20Tauri avatar Feb 27 '22 20:02 20Tauri

Thanks @20Tauri.

Tabs in a comment are converted to spaces when the comment is updated (only tabs used for indentation are preserved).

So there's no support for tabs, then? Or maybe there is, based on your next sentence?

But your need is probably related to the preferred_tabs_sizes setting.

I'm unclear how to use that setting to create tabs. The documentation shows the default value is [ 12, 6, 8, 8, 8, 8 ] and from the example I can that after the 12th character you're adding 6 spaces. What do the next four "8"s mean? How do I convert those 6 spaces into 2 tabs?

graylaurenm avatar Mar 05 '22 18:03 graylaurenm

True tabs (in the editor's meaning) at the beginning of the line are accepted. Not in a docblock (as you expect)

"Tabs" behave has "rulers". The fist tab add up to 12 spaces to align the content. This ensure the alignement (but no tab are used in the generated snippet

The meaning of 8 depends of the previous values

  • First tab => alignment on "row" 12
  • Second tab => alignment on "row" 12+6
  • Third tab => alignment on "row" 12+6+8
  • Fourth tab => alignment on "row" 12+6+8+8

Here the example from documentation

    //     :caption: Example with the value '[ 13, 6, 8, 8, 8, 8 ]'
    //
    //     /**
    //      * @param[in]  a     { parameter_description }
    //      * 123456789012      12345678...and continue because there is no more tab
    //      *             123456
    //      */

20Tauri avatar Mar 06 '22 14:03 20Tauri

Awesome, thank you for your written explanation, I understand now.

I know there's the whole tabs-vs-spaces debate but I'm personally trying to use tabs as I feel that formatting with them "just works." I'll consider this a non-option now, though.

graylaurenm avatar Mar 06 '22 14:03 graylaurenm