Re: [PATCH] bracket matching extension



Hello!

> The new bracket matching, if you are on or after a bracket, highlights
> the opening and closing brackets, too.   By the new way, it helps you to
> find the opening bracket during you type your program, you don't have to
> go back to the closing bracket you have typed if you are after it.

I wonder what in_screen and furthest_bracket_search are supposed to do in
edit_get_bracket_this()?

I understand that the original code is very, very ugly, but
edit_get_bracket_this() is a new function, and you are supposed to
understand what it does and comment it properly.

The comment for the function can rival the famous "all your base are
belong to us":

   this find the if at the current cursor position or before there is a 
   bracket or not?

I'm not going to apply code that just happens to work, but in fact is a
result of copying the existing code and removing some (not all)
unnecessary parts.

You don't need edit_update_curs_row() in edit_get_bracket_this(), because
your are not using edit->curs_row, unlike it's done in
edit_get_bracket_other().

Looking at edit_get_bracket_other(), I see that you added a new argument,
"cursor", but I have no idea what it does.  The actually used values are
-1 and edit->bracket_this.  I don't see much difference.

I don't quite understand what you did with setting REDRAW_PAGE in 
edit_find_bracket().  Could you please comment this statement:

    if (last_bracket != edit->bracket_this) 
        edit->force |= REDRAW_PAGE;

Sorry, I don't feel safe about applying your patch.

-- 
Regards,
Pavel Roskin




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]