[Top][All Lists]

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

Re: [Nano-devel] Re: Soft wrapping updarte and write permission check

From: Hannes
Subject: Re: [Nano-devel] Re: Soft wrapping updarte and write permission check
Date: Mon, 7 Sep 2009 18:48:45 +0200


On Mon, 7 Sep 2009 00:36:53 -0400
Chris Allegretta <address@hidden> wrote:

> On Fri, Sep 4, 2009 at 11:08 AM, Hannes<address@hidden>
> wrote:
> > here is another small issue I discovered (rv4408): searching for a
> > string (Ctrl+W) will send the cursor to a line a few lines above of
> > where the string has actually been found. If the string has been
> > within the viewport all along, it works correctly, though,
> > regardless of softwrapped lines above or below.
> So you search for text off-screen, with soft-wrapping enabled, and it
> puts the cursor in the wrong place?  Hmm, does your starting cursor
> position before you do the search matter?   Any sample text you could
> mention for me to try and reproduce?

Ok, I experimented some more with this, and indeed my initial
description was off a little.

What actually happens for me is that when I search for off-screen text
(regardless of where the cursor was before), the cursor does jump to
the *right* spot (as indicated by the status line), but the *viewport*
doesn't update itself correctly.

When searching the normal way (forward, i.e. down from cursor position),
the last line to be shown will be exactly "n" lines above the position
where the term has been found, "n" being the number of soft-wrapped
lines currently within the viewport. So if there are four soft-wrapped
lines not far from the search term, the viewport will move four lines
too few.

Then I can use cursor up four times to get the cursor into the viewport
again (without the viewport being updated). Cursor left and right will
not update the viewport, either, but the status line shows it moving.
Alternatively, using cursor down, the cursor does go down, and the
viewport scrolls down by one line, too (though the relative error
remains the same - the cursor's virtual position is still out of view).

All this time, nano actually shows "a" cursor in the very last line to
be shown. That is what confused me at first. However, that is
apparantely not the actual cursor position, but just graphical display.
Typing anything will insert the characters at the position shown in the
status line (off-screen).

So the error doesn't seem to be in the function moving the cursor to
the search term, but in the routine moving the viewport.


reply via email to

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