From b2bd87df81756d4925bf1f4da6962b9dd83a807c Mon Sep 17 00:00:00 2001 From: gavynriebau Date: Sun, 5 Jun 2022 18:49:41 +0800 Subject: Fix crash due to cycles when replaying macros (#2647) In certain circumstances it was possible to get into an infinite loop when replaying macros such as when different macros attempt to replay each other. This commit adds changes to track which macros are currently being replayed and prevent getting into infinite loops.--- helix-view/src/editor.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'helix-view/src') diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index f2fb4301..8e53936a 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -433,6 +433,7 @@ pub struct Editor { pub selected_register: Option, pub registers: Registers, pub macro_recording: Option<(char, Vec)>, + pub macro_replaying: Vec, pub theme: Theme, pub language_servers: helix_lsp::Registry, @@ -503,6 +504,7 @@ impl Editor { count: None, selected_register: None, macro_recording: None, + macro_replaying: Vec::new(), theme: theme_loader.default(), language_servers, debugger: None, -- cgit v1.2.3-70-g09d2