bash syntax highlighting does not work with arrays
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=
## Loop through array, echoing each element
## syntax highligting breaks on next line
for (( CURRENTELEMENT=
echo ${ARRAY[
done
Changed in gtksourceview: | |
status: | Unknown → In Progress |
Changed in gtksourceview: | |
importance: | Unknown → Low |
Changed in gtksourceview: | |
status: | In Progress → Confirmed |
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