[SOLVED] "Persistent block" and "Classic" keyboard scheme: pressing TAB deletes lazarus / 11-Options ---------------------------------------------------------------------- oh_ha · 2020-04-15 10:33 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 · 2020-04-15 15:12 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 · 2020-04-15 15:32 Thanks for your reply. I tried the change, but the problem persisted. I have opened a bug report (#0036917). ---------------------------------------------------------------------- Martin_fr · 2020-04-15 16:24 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 · 2020-04-15 21:56 This works now. Thank you very much for fixing this so fast! Regards, Olaf ---------------------------------------------------------------------- Martin_fr · 2020-04-19 00:23 I changed the fix https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/ components/synedit/synedit.pp?root=lazarus&r1=63014&r2=63013&pathrev=6 3014 The previous fix would go wrong in overwrite mode / Usually toggled by the "insert" key. Note that tabs actually do not overwrite the existing text. (except selection). But with the wrong fix, exactly one existing char would get deleted/replaced. ---------------------------------------------------------------------- oh_ha · 2020-04-19 07:26 Thanks again for your efforts!