#44 Flashing delimeters should be customizable per-language

open
nobody
None
5
2003-07-30
2003-07-29
No

I'm using the precompiled nedit binaries:

NEdit 5.4RC1
Jul 16, 2003

Built on: Linux, 386, GNU C
Built at: Jul 16 2003, 22:34:33
With Motif: 2.1.30 [@(#)Motif Version 2.1.30]
Running Motif: 2.1 [unknown]
Server: The XFree86 Project, Inc 40300000
Visual: 24-bit TrueColor (ID 0x21, Default)
Locale: de_DE@euro

first, I'm not sure if I am using this feature
correctly: I added a new
highlighting pattern to a language mode, which is just
'plain' with start (\<) and end (\>) patterns.

now I can jump between < and > characters in text with
Ctrl-M and select the text inbetween with Shift-Ctrl-M,
but if I place the cursor
behind the closing >, the opening < is not highlited
red, which works for plain parens: ().

Discussion

  • Scott Tringali

    Scott Tringali - 2003-07-29
    • milestone: --> 103146
     
  • Scott Tringali

    Scott Tringali - 2003-07-29

    Logged In: YES
    user_id=11321

    This is not how the feature works. Currently, you cannot
    add new delimiters to be matched by editing the highlight
    patterns.

    This feature restricts paren matching to work only on
    characters of the same highlight type. This way, it reduces
    a lot of false matches. For example, let's say you have
    some C code:

    puts("hello" "(" "world");

    When your cursor is on the last paren, it will not match the
    paren inside the string, because it's in a different
    highlight category.

    It is somewhat strange that Ctrl+M will jump between <>
    pairs, but not highlight them. I suspect the problem is
    that delimiter pairs are not language-specific, and it would
    be annoying to have <> flash in languages like C that
    usually do not use them as pairs.

     
  • Sergei Haller

    Sergei Haller - 2003-07-29

    Logged In: YES
    user_id=76018

    > This feature restricts paren matching to work only on
    > characters of the same highlight type

    so that's what 'syntax based' means... This could be added
    to Help files...

    I just rechecked it: Ctrl-M jumps between < and > in any
    case (also without my highlighting patterns) but, as said,
    without highlighting the characters < and >.

    this would be useful in languages like magma and expressions
    like
    sub< G | x >
    or
    map< G -> P | g :-> map< A->A | a :-> my_fun( a, g ) > >;

    BTW, in the second expression -> and :-> are ignored for
    jumping after defining them as a special highlightning
    patterns. (nice Work!)

    What do you think, would it be possible to let the user
    specify the
    to-be-highlighted-red chars for the "show matching (..)"
    feature?

    some definition on a per-language basis. Or for the
    beginning some ressource which would be used for all languages?

     
  • Sergei Haller

    Sergei Haller - 2003-07-29

    Logged In: YES
    user_id=76018

    > Or for the beginning some ressource which
    > would be used for all languages?

    this would be a ressource which changes the value of
    N_FLASH_CHARS, which is defined with a #define in search.c
    at the moment.

    for now I will just increase this value to 8 and recompile.

    for the future, it would be probably better to define the
    table MatchingChars like this:

    typedef struct _charMatchTable {
    char c;
    char match;
    char direction;
    char flash;
    } charMatchTable;

    static charMatchTable MatchingChars[] = {
    {'{', '}', SEARCH_FORWARD, 1},
    {'}', '{', SEARCH_BACKWARD, 1},
    {'(', ')', SEARCH_FORWARD, 1},
    {')', '(', SEARCH_BACKWARD, 1},
    {'[', ']', SEARCH_FORWARD, 1},
    {']', '[', SEARCH_BACKWARD, 1},
    {'<', '>', SEARCH_FORWARD, 0},
    {'>', '<', SEARCH_BACKWARD, 0},
    {'/', '/', SEARCH_FORWARD, 0},
    {'"', '"', SEARCH_FORWARD, 0},
    {'\'', '\'', SEARCH_FORWARD, 0},
    {'`', '`', SEARCH_FORWARD, 0},
    {'\\', '\\', SEARCH_FORWARD, 0},
    {0, 0, 0, 0}, // last one full of zeros
    };

    and extend this later to be changeable from somewhere in the
    preferences.

     
  • Scott Tringali

    Scott Tringali - 2003-07-30
    • milestone: 103146 -->
    • summary: show matching (..) based on syntax --> Flashing delimeters should be customizable per-language
     
  • Scott Tringali

    Scott Tringali - 2003-07-30

    Logged In: YES
    user_id=11321

    Reclassified as feature request. Thank you.

     
  • Joerg Fischer

    Joerg Fischer - 2003-12-04

    Logged In: YES
    user_id=918104

    See patch
    [ 806814 ] Matching patterns (keyword matching)

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks