On 10/13/07, Bram Moolenaar wrote:
> Yeah, it appears it's currently only possible to delete characters
> within a line or delete 2 lines or more.  Quite strange.  I wonder how
> this ever worked with the actual Netbeans.
>
> I think we should change it to the proper solution:
> 1. If less than one line, delete characters in one line
> 2. otherwise:
>         a. Delete characters in the starting line (if not a whole line)
>         b. Delete whole lines (if at least one)
>         c. Delete characters in the ending line (if not a whole line)

I am trying to do the following patch.
What do you think ?

=================
algorithm:
  next is position of first byte (if exists) after deleted section
  partial 1st line if:
    first->col != 0 or (next != NULL and first->lnum == next->lnum)
  partial last line if:
    first->lnum != last->lnum and next != NULL and last->lnum  == next->lnum
  delete full lines:
    if partial 1st line: from = first + 1 else first
    if partial last line: to = last - 1 else last
    if to >= from:
       move cursor to from
       delete to:from

remove all uses of netbeansSuppressNoLines: not needed
fix incorrect use of pointer returned by ml_get to readonly data
whenreplacing partial line
remove wasChanged: seems to be not needed
=================


Xavier

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui