| Version 7 (modified by bowtie, 2 years ago) (diff) |
|---|
PadreWikiFeaturesBrackets Draft
Description
Bracket matching/completion
() # Brackets [] # Square Brackets {} # Braces '' # Single-Quoted String Literals "" # Double-Quoted String Literals
- brace implies (Brackets, Square Brackets & Braces)
Perl -> Find Unmatched Brace (brace)
Initial observations,
- works in current editor, does not require the file to be saved :)
- highlights the last unmatched ;-(
- I think it must be counting charter types, with little reference to Perl syntax ;-(
This file passes, this is rubbish ;-((
#!/usr/bin/perl # based on 03_Good_Morning.pl # This file assumes that you already read (and understood) earlier sessions! use strict; # This will be discussed later use warnings; ### added [ my [( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime( time() ); if ( $hour < 10 ) { print "Good morning!\n"; } elsif {( $hour == 12 ) { print "Out for lunch...\n"; }} ### added {} elsif ( $hour <= 18 ) { print "Hello world!\n"; }] ### added ] elsif (( $hour < 23 ) { print "Good night.\n"; }) ### added () else { print "sleep well!\n;" }
run against Padre r14200
Opps should have run the Syntax Checker first
- the editor appears to highlight matching braces in luminous green :)
Edit-> Brace Matching (brace) Ctrl+1
- moves the cursor for you
- If the cursor is outside a brace, it matches to the outside of it's pair. either forward or backwards :)
- If the cursor is inside a brace, it matches to the inside of it's pair. either forward or backwards :)
Q, why is this on the menu and not just a keyboard shortcut!
Edit -> Select To Brace Matching (brace)
- Cool :)
- Inside outside matching braces as above, and highlights selection for you :)
- you still need to explicitly copy to place selection on clipboard
- X11 copy don't work
the above actions also work with "line 7 added [" & "line 13 added ]" hence you are treating brace behind a # comment as active ;-((
Tickets
Attachments
-
prefs_braces.png
(16.6 KB) -
added by bowtie 2 years ago.
prefs_braces
