[Top][All Lists]

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

Re: virtual space?

From: Michael Durland
Subject: Re: virtual space?
Date: Wed, 22 Oct 2003 01:33:05 GMT

"Stefan Monnier" <> wrote in message">
> > Having a virtual cursor would solve the problem.
> Neither is it for me.  At first, it would seem like it'd be very difficult
> to implement, but now that I think about it, I believe it can be done
> in elisp: When going "past the last char" of a line, just add an overlay
> the end of the line with an `after-string' property of "     ".  At least
> here (Emacs-CVS), it seems to move the cursor according to the number of
> spaces you've put, so you can place the cursor where you want on screen
> without modifying the buffer text.  The tricky part will be to make the
> other commands work correctly by replacing the overlay with actual spaces
> before doing an insertion.

This sounds cool!  So is it possible to implement a virtual cursor entirely
as an overlay?  I'm imagining that the real cursor would have to be hidden,
but always follow the virtual cursor where there is text.  Where there isn't
text, the virtual cursor would travel away from the real cursor.  Then when
the virtual cursor got back on to real text, they would sync up again.  If
text was inserted at the virtual cursor, yes whitespace would need to be
added to pad the real cursor out to the virtual cursor, but this is
expected.  I know a little about overlays, but not enough to write one from
scratch.  I'm learning.  Any guidance down this path would be appreciated.


reply via email to

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