From 3c0fcb0679502f3815f66cf559775d32cfc785c2 Mon Sep 17 00:00:00 2001 From: Nik Revenco <154856872+NikitaRevenco@users.noreply.github.com> Date: Wed, 2 Apr 2025 16:02:40 +0100 Subject: [PATCH] chore: justify welcome! macro with comment --- helix-term/src/ui/editor.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 55d289e91..41506cc82 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -85,6 +85,10 @@ impl EditorView { Center, } + /// Declare the welcome screen declaratively using this macro + /// It avoids the performance overhead of calling `Vec>::flatten` and + /// makes it easy to get the longest line in the center and the left, without + /// having to iterate over the `Vec<_>` again. macro_rules! welcome { ( $([$align:ident] $line:expr, $(if $cond:expr;)?)* $(,)?