wiki:Features/Brackets

Version 2 (modified by bowtie, 3 years ago) (diff)

--

PadreWikiFeaturesBrackets Draft

Description

Bracket matching/completion

    ()    # Brackets
    []    # Square Brackets
    {}    # Braces
    ''    # Single-Quoted String Literals
    ""    # Double-Quoted String Literals

Perl => Find Unmatched Brace (Brackets, Square Brackets & Braces)

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


Tickets

Ticket Resolution Summary Owner Reporter
#1090 Autocomplete bracket with indentation szabgab
#486 Undo after auto-complete matching bracket doesn't undo the closing bracket Sewi
#236 fixed Add auto completitions of brackets when first bracket is typed claudio claudio

Attachments (1)

Download all attachments as: .zip