Version: (using KDE KDE 3.3.0) Installed from: Gentoo Packages Compiler: gcc 3.3.4-r1 OS: Linux Hi all, the indent for the perl-module isn't working correct! I tried to use the c-, python- and normal-style but none is working in the right way. To explain my problem, I give you two examples. if I have this construct: } else { <- | } or: sub xy { for () { <- | } } After pressing enter on the '<-' marked position, my cursor is at the place marked with the '|'. No indent... My examples applies to the c-style ident. For c++-Code instead, the indent is working correct. This seems to be only affected by the perl-highlight-module? kdevelop also use the kate-part. So, kdevelop is also affected by this problem! Regards, Martin
The cstyle indent is very c specific, and it integrates with the hlghlight attributes used by c-like languages. AFAIK it works with c, c++, c#, java and javascript. Maybe we should have a more general 'bstyle' for languages using brace blocks.
hm... but it worked with older versions of kate. If I set the option to indent with three spaces instead of tabs, you can see, that the cursor is placed on the 2nd column instead of the 3rd. It seems, that kate (or which ever part of it) places the cursor to the last but one position. Strange behavior
Kates default autoindenter simply keeps the indent.so __x<RET> __ The idea of more advanced autoindenters would be to automatically add or remove space according to code formatting, eg space is added after {<RET> etc. That is what the Cstyle indenter does, but it will not work with perl or php.
And in this case, I currently have no chance to have a normal indent working for my perl skripts? kdevelop also use the same indent for which reason kdevelop is also delimited in this case? Or do I simply misunderstand something
Do you have "Keep indent profile" in the "Indentation"-section enabled? Maybe this helps. (There is still shift-return for >= KDE 3.3.0, which copys all non-letter and non-number characters from the current line; just a workaround maybe).
Thanks for the tip! I've activated the 'Keep indent profile' already, thus this won't help me. But 'shift-return' my help in the meanwhile! Hoping, that indent will work sometimes again in kde. Regards
you can use the default autoindenter, which will allways make an indentation similar to the last line with text on it. As I said, for a more sophisticated indenter for perl and php, we need a extra type.
ah yes, ok. The default-indent is similar to 'shift enter' ok. It's ok for me so far. Thanks a lot! Regards
CVS commit by alund: FEATURE: Add a variable based autoindenter. This indenter matches a line and the first line with content above against regular expressions to decide if a line should be [un]indented. When a newline is entered, both the old and the new line is considered, and it can be triggered to indent the current by typing one of a list of characters. The regular expression patterns and trigger character list are read from document variables, which can be embedded directly in the document or read from a filetype configuration. The following variables are used: - var-indent-indent-after: a regular expression pattern, if the first line with content above the current, indentation is added - var-indent-indent: a regular expression pattern, if the current line matches indent is added. this is not tested if the above matched. - var-indent-unindent: a regular expression pattern, if it matches the current line, indent is removed. - var-indent-triggerchars: a string of characters, when any is typed, the current line is reindented. This should be usable for adding basic autoindentatin to bash, lua, basic, perl... Note that kates document variables currently can't contain a semicolon, (would be a common trigger char), I'm going to fix that. CCBUG: 87682 M +161 -1 kateautoindent.cpp 1.36 M +50 -10 kateautoindent.h 1.19 M +2 -1 kateconfig.h 1.46
Is there a way to add this configuration for other languages, such as scheme? Thanks
You can create a filtype configuration and set the options using variables. In released versions you have kates standard autoindenter, which is the default if you turn autoindent on. The standard indenter simply keeps the indentation that is in a line. The variable based indenter will hopefully be in the next release (KDE 3.4/Kate 2.4)
this should be remembered as "we need some more facilities for perl and co" *** This bug has been marked as a duplicate of 91414 ***
I am using KDE 3.5.5 "release 45.4" , openSUSE 10.2 (Linux (x86_64) release 2.6.18.8-0.5-default) I found a related problem hence I'm appending it here... When we have a perl if statement of the following form, the editor indents even the brace Expected Result: if($var =~ /#.*/) <return> | <------------Cursor position(brace ( '{' ) comes here) Observed result : if($var =~ /#.*/) <return> | <---------------- Cursor position (brace is incorrectly indented I have tried C-Style and python indentation modes and observed the same result in both the cases. I do agree that may be this happens because there is no dedicated indentation mode for perl. But it would be great if this is fixed.