I have a question.
Today I tried to set my indent level to two spaces.
However, with Kotlin files it still indents with four spaces (e.g. after opening brace)
I looked through the code and I couldn’t find where the number of indent spaces is getting set.
Can you advise?
Note that Kakoune has two separate indentation-related options: tabstop tells Kakoune how wide actual tab characters should be drawn, while indentwidth describes how many spaces should be inserted by indentation commands like < and > (0 means “use a tab instead of spaces”).
If you’ve set tabstop to 2, that generally won’t affect auto-ident hooks, since they typically use < and > to change indentation.
Thanks for the suggestion. Unfortunately, it doesn’t apply to my case.
I have both options set to 2 spaces.
And it works in all other languages.
So, something in the new kotlin.kak file which I can’t figure out.
Hey buddy, nice work on getting kolin.kak into the wider community.
Why would I not? I’ll put it down to a self doubting day.
Your kotlin.kak-patch-1 was awesome! It got my butt in gear and made some changes at Bitbucket check it out as it may give you some more ideas to play with as your kotlin.kak-patch-1 did for me.
Try this: comment out all changes to any preference in spaces and tabs. Then use a single source of truth https://editorconfig.org/ for your file-type preferences.
Glad you’re back!
Yeah, I have pinpointed that tabulation error to dev version of Kakoune that I compiled on Ubuntu. I am currently on Fedora and on stable version and thus don’t have that problem any more. We’ll look into that later.
And, regarding that comment about listening, that was when maww requested changes and at that time I was nervous and ashamed that I couldn’t fix myself. So, your fixes came just in time and were big relief.
Since then I think I understand better the syntax of kakoune highlighters.
That’s very cool, let me compile those binaries and I’ll try.
I might even think about merging those into a single executable with the methods being supplied as an argument.
Hey all, I worked out how to do function indentation correctly. It will indent the next successive line for function continuation and de-dent the following line if no text was on the previous line.
fun hello() =
<space><space>\n
no indentation here as previous line contains no text
fun hello(): String = "hi"
<space><space>\n
fun noIndent(): Int = 1
try %< execute-keys -draft k <a-x> <a-k>^\h*?(?:\b(private|public|protected|internal)\b)?\h*?(?:\b(tailrec|inline|infix|operator|external|suspend)\b)?\h*?\b(fun|where)\b[\S\s]*?$ <ret> j<a-gt>
> catch %<
execute-keys -draft JK <a-&>
>
Also realised I forgot kotlin keywords on kakoune static word completion list this is now fixed.
Haha Cool, glad you’re on Git as well. I am sure you won’t regret as there are so many projects. I am more DevOps, but, will have a look at your suggestions. This whole thingy about big-data, AI, ML etc. becomes too big to ignore.