Recent

Author Topic: Trying to fix bugs or customize  (Read 3414 times)

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Trying to fix bugs or customize
« on: May 06, 2013, 03:11:48 pm »
I have 2 main improvements in mind for Lazarus, that i'd really want to see fixed. I'm willing to fix them myself if needed, but i need some tips to get started. I did some research with the Lazarus sources already for these, but not real progress.

1) http://bugs.freepascal.org/view.php?id=23891
This bug that when you're dragging a component on form, it might instantly fly out of the form. Not following the cursor at all. I suspect this is in the core of Object Inspector, i haven't found any files about it.

2) When i have 2 source windows open, and then use jump command (ctrl+click, ctrl+shift+down), it is possible that it changes to other window where that file is already open, instead of opening that file in active window. The whole point of 2 source windows is to have 2 separate "workspaces". When it opens target in the other window, i lose whatever is open there, and it is very irritating.

What i tried is edit sourceeditor.pp, after line 8531:
Code: [Select]
function TSourceEditorManagerBase.SourceEditorIntfWithFilename(
  const Filename: string): TSourceEditorInterface;
Make the function always return nil. Nothing was changed after rebuilding Lazarus. Basically only possible SourceEditor that any function should use is active SourceEditor and that only.

Now i suspect i need to find the behavior for the code jump in some other unit, not directly related to sourceeditor... i don't know. Is this codetools?

Using latest FPC 2.7.1 and Lazarus 1.1 SVN, last updated both today.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11290
  • Debugger - SynEdit - and more
    • wiki
Re: Trying to fix bugs or customize
« Reply #1 on: May 06, 2013, 03:34:46 pm »
About 2:

There is a config in the options (editor/pages and window), how editors are chosen.

It does not currently support the scenario.

The code that deals with it is here: (main.pp)
Code: [Select]
function TMainIDE.GetAvailableUnitEditorInfo(AnUnitInfo: TUnitInfo;
  ACaretPoint: TPoint; WantedTopLine: integer = -1): TUnitEditorInfo;


That is the place to go.

And the option page: It may need new entries to the list (like "Editor in current window only")
And maybe the ability to re-order the list (not sure)

Actually I am not sure, why unchecking all the "existing editors" and only leaving "new editor in same win" does not work. But there may be a reason why that was done.

-------------------
More complex, will be the fact that there also is only one jump history. And the scenario with one jump history for all windows must be kept as default option.

------
Instead of adding more to "pages and window" maybe a global option "one workspace per win" ....


---------------------
More later


http://lazarus-dev.blogspot.co.uk/2010/04/page-locking-or-multiply-editor-windows.html

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: Trying to fix bugs or customize
« Reply #2 on: May 06, 2013, 04:21:30 pm »
Thanks, 2) seems to be solved with dirty edit. I copied code over from "eoeaNewTabInExistingWindowOnly".
main.pp 6293:
Code: [Select]
begin
  Result := nil;
  // Check for already open Editor. If there is none, then it must be opened in DoOpenEditorFile
  if AnUnitInfo.OpenEditorInfoCount = 0 then exit;

            // ******** Dirty edit
            w := AvailSrcWindowIndex;
            if w >= 0 then
              if SourceFileMgr.OpenFileInSourceEditor(AnUnitInfo.GetClosedOrNewEditorInfo,
                                                        -1, w, []) = mrOk then
                Result := AnUnitInfo.OpenEditorInfo[0]; // newly opened will be last focused
            exit;
            // ********

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4571
  • I like bugs.
Re: Trying to fix bugs or customize
« Reply #3 on: May 06, 2013, 05:03:37 pm »
1) http://bugs.freepascal.org/view.php?id=23891
This bug that when you're dragging a component on form, it might instantly fly out of the form. Not following the cursor at all. I suspect this is in the core of Object Inspector, i haven't found any files about it.

Indeed. Strange I did not notice it earlier myself.
It does not depend on widgetset. There is some nasty interaction with events to/from the property editor.
Long time ago I made a patch because ComboBoxes in OI got too many updates:
 #15883: Object Inspector updates ValueComboBox control many times

It is not directly related to your issue but maybe gives ideas.
You may have to dive into designer code to find the reason.
Happy debugging. :)

About 2): An option is needed. The current behavior is good for some work-flows.
I am only worried about the number of choices in the options dialog. Not all of them make valid combinations. Editor options / codetools options is one problematic area, this multi-window editor may be another.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

 

TinyPortal © 2005-2018