plugin Colored Indent

Plugins for SynWrite and CudaText...
Post Reply
Alexey
Posts: 1634
Joined: 05.10.2012 22:10

plugin Colored Indent

Post 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)
Attachments
Screenshot from 2019-01-31 18-35-16.png
SamC
Posts: 211
Joined: 12.08.2023 00:49

Colored Indent plugin in just tab rows

Post 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
Last edited by SamC on 30.01.2024 05:15, edited 1 time in total.
main Alexey
Posts: 3004
Joined: 25.08.2021 18:15

Re: colored intent plugin in just tab rows

Post by main Alexey »

yes, lines with just spaces and with just tabs. it is by design, ok IMHO.
SamC
Posts: 211
Joined: 12.08.2023 00:49

Re: colored intent plugin in just tab rows

Post 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.
main Alexey
Posts: 3004
Joined: 25.08.2021 18:15

Re: colored intent plugin in just tab rows

Post 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.
SamC
Posts: 211
Joined: 12.08.2023 00:49

Re: Colored Indent plugin in just tab rows

Post by SamC »

Get it, thanks!
main Alexey
Posts: 3004
Joined: 25.08.2021 18:15

Re: Colored Indent plugin in just tab rows

Post by main Alexey »

I added new option: "only_space".
Post Reply