Added support for ending a line with a square bracket

Simple support for ending a line with a square bracket. This means pressing the semicolon key at the end of accessing an array element will insert a semicolon at the end of the line.