Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#236 closed enhancement (fixed)

Add auto completitions of brackets when first bracket is typed

Reported by: claudio Owned by: claudio
Priority: minor Milestone:
Component: Brackets Version: trunk
Keywords: Cc: heiko_jansen@…

Description

When a bracket is typed, the ending bracket ( ")", "}", "]") should be automatically inserted while leaving the cursor positioned after the first bracket.

This option should be optional. I propose in "Perl / (Boolean) Automatically insert ending bracket".

Change History (6)

comment:1 Changed 6 years ago by claudio

  • Status changed from new to accepted

comment:2 Changed 6 years ago by hjansen

  • Cc heiko_jansen@… added
  • Resolution set to fixed
  • Status changed from accepted to closed

I'm not really content with the Perl(5)-centric positioning of the option switch but I have yet to come up with a better proposal.
Apart from that I think that this kind of autocompletion is a common feature of other editors and that Padre should be able to do it as well. I've therefore just committed changeset r3024 which implements what you described.
If you use Padre from SVN please give it a try.
For everybody who tests this: I'm especially interested in getting to know if the implementation works with document encodings other than ISO_8859-1 or UTF-8.

comment:3 follow-up: Changed 6 years ago by claudio

Hehe. You are a faster coder than me. I started to implement the changes today, so I won't commit my changes and have a look at yours.

I think once padre supports more languages, the "Perl" menu should disappear when not editing perl. For now, the Perl menu is the least option. I guess it would be more natural to add it in a configuration window as it is something you don't switch on and off (it depends on your coding style).

C.

comment:4 Changed 6 years ago by claudio

s/least/not the worst/

comment:5 in reply to: ↑ 3 Changed 6 years ago by hjansen

Replying to claudio:

I think once padre supports more languages, the "Perl" menu should disappear when not editing perl.

It does already do so.
I'm not sure if it's possible to have e.g. Padre-Plugin-XML define a "XML" menu which automatically replaces the Perl menu when you switch from editing a Perl doc to a XML doc (and vice-versa) but I think the necessary hooks are there.
But that does not solve the conceptual problem.

For now, the Perl menu is the least option. I guess it would be more natural to add it in a configuration window as it is something you don't switch on and off (it depends on your coding style).

We probably need to put some more thoughts into the question of global and language/plugin specific preferences, which options need to be predefined in Padre, etc. But that discussion either needs a separate ticket or should take place on irc.

comment:6 Changed 4 years ago by szabgab

  • Component changed from editor to Brackets
Note: See TracTickets for help on using tickets.