lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev Re: [dev16] Cleanup patch for TEXTAREA edit


From: Kim DeVaughn
Subject: lynx-dev Re: [dev16] Cleanup patch for TEXTAREA edit
Date: Wed, 10 Feb 1999 10:23:46 -0800

On Wed, Feb 10, 1999, Leonid Pauzner (address@hidden) said:
|
| >  3. The editor's cursor is now positioned on the same line in the
| >     edit file, as it was on when the editor was invoked (relative
| >     to the beginning of the TEXTAREA).  At least for those editors
| >     that lynx knows support initial positioning (emacs, vi, pico,
| >     jove, and jed for non-VMS platforms; sedt for VMS).

| > +    if (((entry_line - start_line) > 0) && editor_can_position())
| > +#ifdef VMS
| > +       sprintf (ed_offset, "-%d", ((entry_line - start_line) + 1));
| > +    HTSprintf0 (&tbuf, "%s %s %s", editor, ed_temp, ed_offset);
| > +#else
| > +       sprintf (ed_offset, "+%d", ((entry_line - start_line) + 1));
| > +    HTSprintf0 (&tbuf, "%s %s %s", editor, ed_offset, ed_temp);
| > +#endif

| Now you lost the "else" case, when the editor cannot (or need not) position,
| should be:
|
|         if (((entry_line - start_line) > 0) && editor_can_position()) {
| #ifdef VMS
|                 sprintf (ed_offset, "-%d", ((entry_line - start_line) + 1));
|                 HTSprintf0 (&tbuf, "%s %s %s", editor, ed_temp, ed_offset);
| #else
|                 sprintf (ed_offset, "+%d", ((entry_line - start_line) + 1));
|                 HTSprintf0 (&tbuf, "%s %s %s", editor, ed_offset, ed_temp);
| #endif
|         } else {
|                 HTSprintf0 (&tbuf, "%s %s", editor, ed_temp);
|         }

Not required.

The sprintf() is executed iff the if() is TRUE.

When it is FALSE, the HTSprintf0() is executed directly.  The ed_offset
string is initialized to a NULL string, which then *effectively* results
in a "%s %s" format (as opposed to a real "%s %s %s" format).

/kim

reply via email to

[Prev in Thread] Current Thread [Next in Thread]