Summary: | Auto Bracket - Smarter Brackets and Braces | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | Will <wbeldman> |
Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED WORKSFORME | ||
Severity: | wishlist | CC: | cfeck, christoph, contact, frank, muhammad.h, opensource, rfujimoto, rian.orie |
Priority: | NOR | ||
Version: | 2.2.1 | ||
Target Milestone: | --- | ||
Platform: | RedHat Enterprise Linux | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Will
2004-04-07 01:46:44 UTC
Agreed, I've found auto brackets more trouble than it's worth. I actually find I spend more time moving my cursor around and deleting extra brackets than with this option off. Perhaps function brackets should not be created? Only structural brackets (IE: if, else, for, etc). Also i believe it would be nice if the closing structural bracket '}' could be placed on it's own line 2 lines below. IE: if (condition) TYPE_SQUIGGLEY_BRACE CURSOR_HERE CLOSING_BRACE_INSERTED_HERE --meaning-- if (condition) { CURSOR_HERE } That way based on the location of '{' it would place '}' two lines below with the cursor between the two. That way, autobrackets works for both styles "if (condition) {" and "one true brace." *** This bug has been confirmed by popular vote. *** you should look at Textmate on OS-X warning: you may never want to use anything else after please also look at bug #101213 we may want to merge comments or something... there is now a patch in #101213, I think it may answer what is requested on this bug as well. IMHO in this example {CURSOR HERE} I would like: { CURSOR HERE } if you press enter after the first bracket it should indent the other one. so { + "CURSOR HERE" == {CURSOR HERE} but { + ENTER + "CURSOR HERE" == { CURSOR HERE // see auto-indent } // see indent align with current block level. if you dont press ENTER it should just stay on the same line as it is. the second suggestion is invalid IMHO you don't want to trap for );) I think we should just remove the extra bracket if [] as been type consecutively. semicolon as nothing to do there. see bug #101213 and I have a question for Mr Will Beldman: have you tried kate in KDE 3.5 ? JUST upgraded to 3.5. I'll also peruse the changelog for kate. Yes, the enter and indent is a good idea too. On 1 Dec 2005 16:43:21 -0000, Mathieu Jobin <somekool@somekool.net> wrote: [bugs.kde.org quoted mail] -- "The unexamined life is not worth living" - Socrates (In reply to comment #6) > if you press enter after the first bracket it should indent the other one. Yes, surely. > I think we should just remove the extra bracket if [] as been type > consecutively. I agree. There's actually an extension available in the reposit that solves half of the above issues. The autoplacement of the brace } is done properly through usage of the autobrace extension. This solves the issue for {} see: http://jakob.petsovits.at/autobrace-update and http://websvn.kde.org/trunk/playground/devtools/kte_autobrace/ The above does not solve the closing of the function parameter section As stated on #kate and bug 198540 I have a IMHO simple idea to solve that closing brackets problem. I didn't look in the code, yet, so I don't know how much effort it is. Idea is to have a stack with all closing parts that are inserted while using auto brackets. - if you just continue to write and type the contents of the stack, it will be ignored/replaced instead of added to the text and poped from stack - if you move the cursor right as pressing -> the brackets are poped from stack, too - if you make any more complicated move, the stack is cleared completely I think this will handle most of the cases where you are annoyed of "auto brackets" Can you retest with current Kate version (KDE >= 4.6) ? There, using auto brackets together with the cstyle indenter works quite nice. Any news? I think the auto brackets works nicely already. what is the proposed change? I would close this as WORKFORME Please add a comment, if it does not work correctly in a recent KDE version. really needs improvement about this issue closing the brackets really annoys in this way (which is at the moment) Muhammad, could you add exact steps to reproduce the bug? |