lynx-dev
[Top][All Lists]
Advanced

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

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


From: Leonid Pauzner
Subject: Re: lynx-dev [dev16] Cleanup patch for TEXTAREA edit
Date: Wed, 10 Feb 1999 20:29:18 +0300 (MSK)

10-Feb-99 03:22 Kim DeVaughn wrote:
(white space changes may be sent directly to TD in a zipped form -
mail software may expand tabs into spaces etc.
so the open text is not safe in this context)

>  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).

see below:

> +    CTRACE(tfp, "GridText: invoking editor (%s) on tempfile\n", editor);

>      /*
> -     *       Go edit the TEXTAREA temp file.
> +     *       Go edit the TEXTAREA temp file, with the initial editor line
> +     *  corresponding to the TEXTAREA line the cursor is on (if such
> +     *  positioning is supported by the editor [as lynx knows it]).
>       */
> -    HTSprintf0 (&tbuf, "%s %s", editor, ed_temp);
> +    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

> -    LYSystem (tbuf);
> +    LYSystem (tbuf);   /* finally the editor is called */


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);
        }



reply via email to

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