bash syntax highlighting does not work with arrays

Bug #198636 reported by Mike MacCana
2
Affects Status Importance Assigned to Milestone
GtkSourceView
Confirmed
Low
gtksourceview2 (Ubuntu)
Triaged
Low
Ubuntu Desktop Bugs

Bug Description

Per other bug, 'sh; syntax highlighting is actually for bash, as functions etc are not in Bourne shell (or Bash 3 when run in default POSIX mode).

Anyway, for bash - not Bourne shell - gedit's syntax highlighting cannot properly cope with arrays (which have been in bash for quite some time).

The following simple array test, when pasted into gedit, breaks syntax highlighting, showing the rest of the file after looping through the array in grey.

#!/bin/bash
## Declare array with 4 elements
ARRAY=( 'Debian Linux' 'Red Hat Linux' 'Ubuntu Linux' )

## get number of elements in the array
ELEMENTS=${#ARRAY[@]}

## Loop through array, echoing each element
## syntax highligting breaks on next line

for (( CURRENTELEMENT=0;CURRENTELEMENT<$ELEMENTS;CURRENTELEMENT++)); do
    echo ${ARRAY[${CURRENTELEMENT}]}
done

Revision history for this message
Mike MacCana (lovekudu) wrote :
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for your bug report. This bug has been reported to the developers of the software. You can track it and make comments here: http://bugzilla.gnome.org/show_bug.cgi?id=512129

Changed in gedit:
assignee: nobody → desktop-bugs
importance: Undecided → Low
status: New → Triaged
Changed in gtksourceview:
status: Unknown → In Progress
Changed in gtksourceview:
importance: Unknown → Low
Changed in gtksourceview:
status: In Progress → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.