[Lazarus] [fpc-pascal] Persistent blocks in Lazarus

Hans-Peter Diettrich DrDiettrich1 at aol.com
Wed Jul 22 17:40:25 CEST 2009


Andreas Berger schrieb:
> Persistent blocks:
>  Keyboard:
>   - Ctrl-K + B or Ctrl-K + Ctrl-B will define the beginning of the 
> block. If it is before the end of the block the block is shown even if 
> it was hidden before.
>   - Ctrl-K + K or Ctrl-K + Ctrl-K will define the end of the block. If 
> it is after the end of of the block the block is shown even if it was 
> hidden before.

IMO there is no requirement that ^BB must reside before ^BK in the text 
(equivalent to the mouse UI).

>   - Ctrl-K + H or Ctrl-K + Ctrl-H will hide\unhide the block.
>   - Shift-Up / Shift-Left / Shift-PgUp / Shift-Ctrl-Home / 
> Shift-Ctrl-Left / Shift-Home:
>      1) If the cursor was not at the beginning of the block then a new 
> block is defined and the old one removed. The block end is at the 
> original cursor position and the block beginning is at the new cursor 
> position.
>      2) If the cursor WAS at the beginning of the block then the block 
> is extended by placing the block beginning at the new cursor position.
>   - Shift-Down / Shift-Right / Shift-PgDn / Shift-Ctrl-End / 
> Shift-Ctrl-Right / Shift-End
>      1) If the cursor was not at the end of the block then a new block 
> is defined and the old one removed. The block start is at the original 
> cursor position and the block end is at the new cursor position.
>      2) If the cursor WAS at the end of the block then the block is 
> extended by placing the block ending at the new cursor position.

IMO it is (or should be) much simpler: When the cursor was not on ^BK, 
the ^BB is set to the old cursor position. Then ^BK is set to the new 
cursor position.


> 
>  Mouse:
> - The mouse works similarly. Dragging the mouse with the left button 
> pressed will either define a new block if the start position was not at 
> the block start (up) or end (down). If the drag start position was at 
> the block start when moving up or at the block end when moving down the 
> the block is extended.

IMO the same as with the keyboard, i.e. depending on the previous 
position of ^BK. ^BB is set when the mouse button is pressed without 
Shift (new block), else ^BB is unchanged. Then ^BK follows the mouse, 
until the button is released.

DoDi





More information about the Lazarus mailing list