Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#98 C syntax highlighting: problem with %

v2.9.7
closed
nobody
5
2006-02-23
2005-02-25
xgrtl
No

There is a problem highlighting something like:

cout << "some text %" << mExec;

it interprets %" as a printf format character, and then
the rest it continues as if it was a string, including
next lines until next "

Discussion

  • Joe Allen
    Joe Allen
    2005-02-26

    Logged In: YES
    user_id=1000448

    This is working the version of joe in cvs.

     
  • John Coppens
    John Coppens
    2005-03-09

    Logged In: YES
    user_id=21667

    This seems to be in _any_ string, as far as I can understand
    the syntax definitions. A work-around is to escape the %
    sign, like \%
    Rather weird, escaping a character because the editor
    doesn't like it, but it works, and at least the rest of the
    source code looks nice.
    Solving it the "right way" would involve detecting the
    syntax one level up, like checking for printf, sprintf,
    fprintf, strftime, etc, where all these have small differences.

     
  • John Coppens
    John Coppens
    2005-03-09

    Logged In: YES
    user_id=21667

    This seems to be in _any_ string, as far as I can understand
    the syntax definitions. A work-around is to escape the %
    sign, like \%
    Rather weird, escaping a character because the editor
    doesn't like it, but it works, and at least the rest of the
    source code looks nice.
    Solving it the "right way" would involve detecting the
    syntax one level up, like checking for printf, sprintf,
    fprintf, strftime, etc, where all these have small differences.

     
  • John Coppens
    John Coppens
    2005-03-09

    Logged In: YES
    user_id=21667

    Fine... Downloaded CVS - Seems to work

    BUT I cannot seem to config the colors anymore? Changing
    anything in /etc/joe/syntax/c.jsf doesn't change on the
    screen. Particularly the blue for Preproc is unreadable on a
    dark background :-(

     
  • Joe Allen
    Joe Allen
    2005-03-11

    Logged In: YES
    user_id=1000448

    Unless you give a '--prefix' option to ./configure, the
    default place for the syntax files is /usr/local/etc/joe/syntax

     
  • John Coppens
    John Coppens
    2005-03-12

    Logged In: YES
    user_id=21667

    Yes. The prefix was given (/usr), mainley because I have a
    Slackware distro,
    and joe came installed with that prefix.
    The strange thing is, that the %-problem is solved (so the
    /etc/joe/syntax/c.jsf
    is read correctly), but the colors are not.

     
  • Tres Melton
    Tres Melton
    2005-05-23

    Logged In: YES
    user_id=167628

    This issue is still there for me with the newest joe-3.3 I
    could find. Here is the offending code section:

    #define mmx_m2r(op, mem, reg) \ __asm__ __volatile__ (#op " %0, %%" #reg \ : /* nothing */ \ : "X" (mem))

    Joe can't figure out that the string on line 2 ends with: %%"
    and #reg is still cyan like it was part of the string (along
    w/ everything below it)

    tres<at>mindspring.don't-spam-me.com

     
  • Joe Allen
    Joe Allen
    2006-02-23

    • status: open --> closed