andreyorst / smarttab.kak

Automatic handling different styles of indentation and alignment.
MIT License
62 stars 4 forks source link

Command to get the current mode? #3

Closed dpc closed 5 years ago

dpc commented 5 years ago

I'm trying to debug some hooks that trigger this, and I need to know which mode was actually selected. :)

andreyorst commented 5 years ago

can you please provide an example of what you're trying to achieve?

dpc commented 5 years ago

:getsmarttabmode

Prints:

smarttabs (or whatever is the current mode)

in status bar. :)

andreyorst commented 5 years ago

I mean what are you want to do that involves automatic switching depending on current mode?

I can add an option that prints mode, but I think it'll be confusing that setting this option isn't hanging mode

dpc commented 5 years ago

I had a bug in my hooks regex, and I was getting different mode than I wanted. The regex was the problem, but it wasn't immediately obvious which mode I'm in.

I have actually configured "displaying whitespaces" now, and eventually fixed my regex. But at that point it would be great to be able to query the current mode somehow.

If this is not idiomatic or something, then let's just forget about it. It was just a thought.

dpc commented 5 years ago

Thanks!