Recent

Author Topic: Prevent Lazarus automatically switching tabs in code editor?  (Read 3273 times)

hayanninja

  • New Member
  • *
  • Posts: 45
Prevent Lazarus automatically switching tabs in code editor?
« on: January 08, 2018, 09:40:51 am »
Let's say I have a source code file, "DataObject.pas". I also have a form, "FormDataObjectEditor.pas" (and corresponding LFM).

I want to add various controls to FormDataObjectEditor.lfm in the IDE, but I want to have DataObject.pas open in the code editor window - perhaps so I can refer to it to see what controls I need to add.

However, while I'm doing this, Lazarus seems to keep switching the code editor tab over to that of FormDataObjectEditor.pas, instead of keeping DataObject.pas active.

Is this just an option I need to disable, or is this a bug? If the former, where do I find said option?

(EDIT: Lazarus 1.8.0, running on Windows 10 Pro 64-bit. I *think* I've run into this issue, same Lazarus version, on Mac OSX High Sierra too, but I'm not 100% sure about this.)
« Last Edit: January 08, 2018, 09:42:49 am by hayanninja »

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Prevent Lazarus automatically switching tabs in code editor?
« Reply #1 on: January 08, 2018, 09:50:40 am »
In the IDE right-click on the tab of DataObject.pas and choose "Move to new window".
Place the new window where it does not obscure "FormDataObjectEditor", and continue with designing your form.

hayanninja

  • New Member
  • *
  • Posts: 45
Re: Prevent Lazarus automatically switching tabs in code editor?
« Reply #2 on: January 08, 2018, 10:32:00 am »
Okay, so it's a bug, but a workaround is known. Better than nothing. :)

Bart

  • Hero Member
  • *****
  • Posts: 5288
    • Bart en Mariska's Webstek
Re: Prevent Lazarus automatically switching tabs in code editor?
« Reply #3 on: January 08, 2018, 05:38:24 pm »
It's not a bug.
It is by design.

Bart

hayanninja

  • New Member
  • *
  • Posts: 45
Re: Prevent Lazarus automatically switching tabs in code editor?
« Reply #4 on: January 10, 2018, 07:59:45 am »
Depends on one's definition of "bug". Some would argue that a feature that tries to be smarter than the user, with no direct way to override it, is a bug. At any rate - if it's not a bug, it's a very annoying feature.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9857
  • Debugger - SynEdit - and more
    • wiki
Re: Prevent Lazarus automatically switching tabs in code editor?
« Reply #5 on: January 10, 2018, 12:22:24 pm »
Its probably meant to be a feature, but it is strange.

The idea seems to be, that the code is edited (button added to form declaration), therefore the editor switches to that unit.
(Other edits - such as resizing a button - do not switch)

But, if the feature means to switch to the source that it changed, then it is incomplete. It does not scroll the editor to the changed line.
So it shows some random code in that unit.

 

TinyPortal © 2005-2018