Recent

Author Topic: Possible Macro Key assignment bug  (Read 500 times)

440bx

  • Hero Member
  • *****
  • Posts: 5814
Possible Macro Key assignment bug
« on: June 02, 2025, 10:15:08 pm »
Hello,

In any test program record a macro, a macro that puts a comment on a line will do just fine. 

Once the macro has been recorded, bring up the View->Editor Macros window, select the "Recorded" tab, click the "Move to:" IDE.

Optional: rename the macro to make it easier to identify.

Select the macro (by clicking on its name) and click on the "Edit Key" button.  Select "Grab Key" and press ctrl-shift-I, a popup window will appear letting you know that the key combination is currently in use and giving the option to re-assign it to the new macro.  _ACCEPT_ the option to reassign the key combination, IOW, ctrl-shift-I should now perform the action in the macro instead of whatever it was before.  Test that is the case.

Create a new macro, repeat all of the above steps except assign the key ctrl-shift-F12 (or some other key combination that is currently _unused_ in your installation.)  Ensure ctrl-shift-F12 performs the action specified in the macro.

Now, quit Lazarus, saving anything that needs to be saved.

Restart Lazarus, re-open the project where you defined the above macros.  Open the "Editor Macros" window, go to the IDE tab/button and notice that the ctrl-shift-I assignment is _gone_ while the ctrl-shift-F12 is still there.

IOW, if you assign a macro a key combination that was previously used for something else, the assignment does not last in spite of the fact that you were given the option to re-assign the key combination to the macro.

Looks like a bug.

Thank you for reading.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11812
  • Debugger - SynEdit - and more
    • wiki
Re: Possible Macro Key assignment bug
« Reply #1 on: June 02, 2025, 10:19:54 pm »
I will need to try and reproduce later.
I guess, it probably doesn't save the "un-assignment" to the editoroptions.xml

Please report on the bug tracker. Thanks.

440bx

  • Hero Member
  • *****
  • Posts: 5814
Re: Possible Macro Key assignment bug
« Reply #2 on: June 02, 2025, 10:40:26 pm »
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11812
  • Debugger - SynEdit - and more
    • wiki
Re: Possible Macro Key assignment bug
« Reply #3 on: June 02, 2025, 10:50:31 pm »
As a workaround, try to unassign the key first.

It may even work, if you unassign it by assigning the macro key, but then open the options, make any change in the editor section (to trigger saving it), and press ok.

440bx

  • Hero Member
  • *****
  • Posts: 5814
Re: Possible Macro Key assignment bug
« Reply #4 on: June 02, 2025, 11:49:25 pm »
As a workaround, try to unassign the key first.
That works if done a specific way.

I first tried using "Find Key Combination" pressing ctrl-shift-I then double clicking on the entry found, then removing the checkmarks for ctrl and shift and setting the key to unknown, then clicking on "ok", "Apply" and "ok" to ensure the key combination was now free for something else.

That did not work, ending and restarting Lazarus made ctrl-shift-I be back to what it was previously assigned to.

Repeating the above step but, instead of double clicking on the entry found, clicking on the "clear" button on the "selected command mapping's" line did work.  That made the key combination available for something else and it stayed with the new assignment after re-starting Lazarus.

I think it should have worked using either way but, it only worked using the second way.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018