Page 1 of 1

plugin Colored Indent

Posted: 31.01.2019 15:25
by Alexey
plugin for CudaText.
gives highlighting of indentation levels. by default, highlights only 4 indentation
levels in different background colors, next levels are colored in loop.

detects indentation level from editor setting "tab_size".
if some indentation is incorrect (e.g. 5-7 chars with "tab_size":4), then
it's highlighted in special color.

plugin has config file, to open it: "Options / Settings-plugins / Colored Indent / Config".
- "lexers": ","-separated lexers, for which plugin is active.
- "color_set": ","-separated list of syntax-theme elements, from which background colors are taken.
- "color_error": syntax-theme element, from which error color is taken.
- "max_lines": maximal count of lines in document, when plugin is active.

plugin works on events: after file opened; after text is changed and short pause is passed.

author: Alexey (CudaText)

Colored Indent plugin in just tab rows

Posted: 30.01.2024 01:18
by SamC
Hello,
when using colored intent plugin,the lines with just tabs will not be colored.(line 157 and 158 below)
Thanks!
Snipaste_2024-01-30_09-15-47.png

Re: colored intent plugin in just tab rows

Posted: 30.01.2024 03:43
by main Alexey
yes, lines with just spaces and with just tabs. it is by design, ok IMHO.

Re: colored intent plugin in just tab rows

Posted: 30.01.2024 04:46
by SamC
"By design" means it can't be adjusted by plugin code and built-in cuda api?
I’ve see the plugin code,it seems no special code to clear the color of lines with just spaces and with just tabs.

Re: colored intent plugin in just tab rows

Posted: 30.01.2024 05:00
by main Alexey
it is plugin code. change it here, in "def get_indent":

Code: Select all

def get_indent(s):
    for i in range(len(s)):
        if s[i] not in (' ', '\t'):
            return s[:i]
    return s
please name the topic better: Colored Indent plugin.

Re: Colored Indent plugin in just tab rows

Posted: 30.01.2024 05:20
by SamC
Get it, thanks!

Re: Colored Indent plugin in just tab rows

Posted: 30.01.2024 05:21
by main Alexey
I added new option: "only_space".