editor: Show "Toggle Excerpt Unfold" tooltip when buffer is fold (#43626)

Xiaobo Liu and Danilo Leal created

Release Notes:

- N/A

---------

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>

Change summary

crates/editor/src/element.rs | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

Detailed changes

crates/editor/src/element.rs 🔗

@@ -3969,9 +3969,14 @@ impl EditorElement {
                                         .children(toggle_chevron_icon)
                                         .tooltip({
                                             let focus_handle = focus_handle.clone();
+                                            let is_folded_for_tooltip = is_folded;
                                             move |_window, cx| {
                                                 Tooltip::with_meta_in(
-                                                    "Toggle Excerpt Fold",
+                                                    if is_folded_for_tooltip {
+                                                        "Unfold Excerpt"
+                                                    } else {
+                                                        "Fold Excerpt"
+                                                    },
                                                     Some(&ToggleFold),
                                                     format!(
                                                         "{} to toggle all",