Forum > Options

[SOLVED] "Persistent block" and "Classic" keyboard scheme: pressing TAB deletes

(1/2) > >>

oh_ha:
Hello,

I have enabled "Persistent block" with the "Classic" keyboard scheme. The option "Tab indents block" is not active.
If I have a block of text selected and press the [Tab] key, the selected text gets deleted, which is unwanted.

Is there a way to change this behavior to the way it is in Delphi: pressing [Tab] inserts a tab at the current cursor position and leaves the selection intact.

EDIT: I use Lazarus v2.0.6.

Thanks in advance, Olaf

Martin_fr:
Just checked, that is a bug.
Please report on our Bugtracker.

You may try the following (untested) workaround:

Open components/synedit/synedit.pp
line 8599 (may differ in your version) -> it is towards the end of procedure TCustomSynEdit.DoTabKey;
It currently has the code
    SetSelTextExternal(Spaces);
replace this with
    ExecuteCommand(ecChar, Spaces, nil);

Then recompile the IDE : Menu Tools > Build IDE

oh_ha:
Thanks for your reply. I tried the change, but the problem persisted. I have opened a bug report (#0036917).

Martin_fr:
Ok some more changes, all in the same procedure

line 8565 (3 lines below the "try")
    SelText := '';
changes to
    if SelAvail and (not FBlockSelection.Persistent) and (eoOverwriteBlock in fOptions2) then
      SelText := '';

and surrounding the change from my previous post are 2 lines (one slightly above, one below the ExecuteCommand)
    OldCaretX := CaretX;
    CaretX := OldCaretX + i;
which both need to be removed / commented out.

Then it should work.

For the final fix, I need do to some refactor, and more testing.

oh_ha:
This works now.
Thank you very much for fixing this so fast!

Regards, Olaf

Navigation

[0] Message Index

[#] Next page

Go to full version