Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete editor macro results in infinite loop #4391

Closed
mc-butler opened this issue Jul 22, 2022 · 6 comments
Closed

Delete editor macro results in infinite loop #4391

mc-butler opened this issue Jul 22, 2022 · 6 comments
Assignees
Labels
area: mcedit mcedit, the built-in text editor prio: medium Has the potential to affect progress
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/4391
Reporter sxmboer2 (sxmboer@….com)
Keywords macro, edit

Since version 4.8.27 removing an existing macro results in an infinite loop that dumps a repeating series of array assertion error.

To reproduce:
create a macro, e.g. CTRL-R abc CTRL-R a
remove that macro, e.g. CTRL-R CTRL-R a (or use the menu to delete that macro)

The problem was introduced because of the split of the macro functions with some rewrites and optimizations. I am including a patch that also gets rid of the unnecessary resorting of the macro array. The glib function called keeps the array sorted.
Another thought is that the while construction can be replaced with a single if. In principle it is impossible to have more than one macro with the same hotkey.

Note

Original attachments:

@mc-butler
Copy link
Author

Changed by sxmboer2 (sxmboer@….com) on Jul 22, 2022 at 2:05 UTC

this patch fixes the mis-placed bracket in the while loop leading to infinite looping

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jul 22, 2022 at 13:04 UTC (comment 1)

  • Status changed from new to accepted
  • Owner set to andrew_b

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jul 22, 2022 at 13:24 UTC (comment 2)

  • Branch state changed from no branch to on review

Thanks!

I've split your patch to two commits.

Branch:4391_edit_delete_macro
Initial [c90840d5c7f577f453f8cc810527d078080e41e9]

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jul 27, 2022 at 16:20 UTC (comment 3)

  • Votes set to andrew_b
  • Branch state changed from on review to approved

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jul 27, 2022 at 16:22 UTC (comment 4)

  • Status changed from accepted to testing
  • Votes changed from andrew_b to committed-master
  • Branch state changed from approved to merged
  • Resolution set to fixed

Merged to master: [1c31e57].

git log --pretty=oneline 82da1e88c..1c31e57c7

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jul 27, 2022 at 16:24 UTC (comment 5)

  • Status changed from testing to closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: mcedit mcedit, the built-in text editor prio: medium Has the potential to affect progress
Development

No branches or pull requests

2 participants