You are not logged in.

#1 2011-01-25 18:52:13

synthead
Member
Registered: 2006-05-09
Posts: 1,337

I think I found a bug in vim's highlighting, can you guys check this?

#!/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...

vimbloodbath.th.png

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 wink

-- 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 smile

Last edited by synthead (2011-01-25 18:55:11)

Offline

#2 2011-01-25 22:19:48

frabjous
Member
Registered: 2010-07-13
Posts: 367

Re: I think I found a bug in vim's highlighting, can you guys check this?

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

#3 2011-01-25 22:43:22

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Re: I think I found a bug in vim's highlighting, can you guys check this?

Heeey, good idea smile

filelog[$i]='"'"${file[$i]/$SIMPLIFYMD_DROPBOX_FILE_ROOT\/}"'"' # slash escape sequences breaks vim highlighting, wat?

Doesn't bother me wink  THANKS!

Leaving this thread open in case someone wants to shed some light on this smile

Last edited by synthead (2011-01-25 22:43:55)

Offline

#4 2011-01-26 14:27:23

egan
Member
From: Mountain View, CA
Registered: 2009-08-17
Posts: 273

Re: I think I found a bug in vim's highlighting, can you guys check this?

Yeah this problem is fairly common. Sometimes it goes away when a file is reloaded.

Offline

Board footer

Powered by FluxBB