#32 Fix for rectangular overstrike paste

development
closed-fixed
Program (79)
5
2001-12-03
2001-12-02
Nathan Gray
No

Currently block-paste ignores the insert/overstrike
mode. This can be seen by copying a rectangular
selection and then pasting it in both insert and
overstrike mode. Both modes result in insertions.

There is, however, already code to do rectangular
overstrike pasting in NEdit, as can be seen by making
a rectangular selection and then shift-ctrl-dragging
it with the middle mouse button. This patch changes
the InsertClipboard function in textSel.c to respect
the insert/overstrike mode and call BufOverlayRect,
which is the function used when shift-ctrl-dragging.

BufOverlayRect requires a starting and ending column
for the rectangular overlay. Because calculating the
width of a rectangular selection can be difficult due
to tab expansions and other issues, and because there
already exists a static function in textBuf.c,
textWidth(), to do this calculation, the calculation
is deferred to BufOverlayRect() itself (also in
textBuf.c). I considered this a better solution than
exposing textWidth as a new part of textBuf.c's
interface or duplicating the code in textSel.c. If
there is a better solution to this I would be happy
to hear about it.

Cheers,
-Nathan

Discussion

  • Nathan Gray

    Nathan Gray - 2001-12-02

    patch to allow rectangular overstrike paste

     
  • Eddy De Greef

    Eddy De Greef - 2001-12-02

    Logged In: YES
    user_id=73597

    This looks fine to me. Deferring the calculation
    is indeed better. I've applied it to CVS.

    Thanks,

    Eddy

     
  • Alexander Mai

    Alexander Mai - 2001-12-03
    • assigned_to: nobody --> edg
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks