You are not logged in.
#!/bin/bash
if [[ $(exec file -bi "${file[$i]}" 2> /dev/null) = application/pdf ]]; then # is this file a PDF document?
if [[ ${file[$i]} != *.[pP][dD][fF] ]]; then # add ".pdf" to PDF files that aren't named *.[pP][dD][fF]
mv "${file[$i]}" "${file[$i]}.pdf"
file[$i]="${file[$i]}.pdf"
datestamp "Added missing .pdf extension to PDF document ${filelog[$i]}"
filelog[$i]="\"${file[$i]/$DROPBOX_FILE_ROOT\/}\""
fi
fi
The line ...
filelog[$i]="\"${file[$i]/$DROPBOX_FILE_ROOT\/}\""
... makes the colors all wonky for the rest of whatever is under it. This is all valid bash code too. Talk about annoying! vim looks like a bloodbath ... here's a screenshot...
Just posting this here in case there's something I don't know. Don't want to send a bug report upstream unless you guys think I should ... vim's a granddaddy
-- mod edit: read the Forum Etiquette and only post thumbnails http://wiki.archlinux.org/index.php/For … s_and_Code [jwr] --
synth's edit: will do, thanks
Last edited by synthead (2011-01-25 18:55:11)
Offline
As a workaround, I guess you could change the line to:
filelog[$i]='"'"${file[$i]/$DROPBOX_FILE_ROOT\/}"'"'
But yeah, I think it's a bug, or at least something that could be improved.
Offline
Heeey, good idea
filelog[$i]='"'"${file[$i]/$SIMPLIFYMD_DROPBOX_FILE_ROOT\/}"'"' # slash escape sequences breaks vim highlighting, wat?
Doesn't bother me THANKS!
Leaving this thread open in case someone wants to shed some light on this
Last edited by synthead (2011-01-25 22:43:55)
Offline
Yeah this problem is fairly common. Sometimes it goes away when a file is reloaded.
Offline