indent_size = tab - what does it mean?

73 views
Skip to first unread message

Harold Tessmann

unread,
Jul 20, 2017, 9:05:02 PM7/20/17
to editor...@googlegroups.com
Either I need more caffeine, or the documentation at <https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#indent_size> is unclear. What would it mean if you set indent_size = tab?

Harold

Hong Xu

unread,
Jul 20, 2017, 11:40:51 PM7/20/17
to editor...@googlegroups.com
It means an indent should be a tab.


Harold Tessmann

unread,
Jul 21, 2017, 11:10:40 AM7/21/17
to editor...@googlegroups.com
Isn’t this redundant with indent_style = tab, though? What would happen if I did:

indent_style = space
indent_size = tab

It seems like the only acceptable value for indent_size should be numeric, and indent_style alone should determine whether to use a tab character or spaces.

Harold 

Hong Xu

unread,
Jul 21, 2017, 1:21:23 PM7/21/17
to editor...@googlegroups.com
It could be the case that indent_style is tab but indent_size is a
number. In this case, tab fill most of the indent and spaces fill the
rest when tabs are too wide. This could happen to some projects such as
GCC and Vim. However, if indent_size is not specified an indent_style is
tab, it defaults to tab.



ppa...@redhat.com

unread,
Nov 7, 2017, 4:17:17 AM11/7/17
to EditorConfig
The semantics of indent_size = tab is not clear to me after reading this thread. 

Hong Xu, could you please 


and 

(2) add a few tests with concrete data somewhere that will show clearly what the various combinations of indent_style and indent_size are supposed to do?

Thanks,

-- Peter

Hong Xu

unread,
Nov 7, 2017, 4:12:53 PM11/7/17
to editor...@googlegroups.com, ppa...@redhat.com
On 11/07/2017 01:17 AM, ppa...@redhat.com wrote:
> The semantics of indent_size = tab is not clear to me after reading this
> thread. 
>
> Hong Xu, could you please 
>
> (1) document indent_size = tab
> in https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#indent_size
> <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Feditorconfig%2Feditorconfig%2Fwiki%2FEditorConfig-Properties%23indent_size&sa=D&sntz=1&usg=AFQjCNHx-kbgMmeLZ62MwcPLiEGTbO_cZw
>
> and 
>
> (2) add a few tests with concrete data somewhere that will show clearly
> what the various combinations of indent_style and indent_size are
> supposed to do?
>

Hi Peter,

The explanation is in this page:

http://docs.editorconfig.org/en/master/editorconfig-format.html

A test case is available here:

https://github.com/editorconfig/editorconfig-core-test/blob/master/properties/indent_size_default.in

Thanks,
Hong

signature.asc

Hong Xu

unread,
Nov 13, 2017, 3:53:28 AM11/13/17
to editor...@googlegroups.com, ppa...@redhat.com
Hello again,

I have now added the explanation to the wiki page. Thank you for
pointing this out.

Hong

signature.asc
Reply all
Reply to author
Forward
0 new messages