[PATCH 3/3] feedback: show in mini bar the presence of an anchor on the cursor line
Benno Schulenberg <[email protected]> Mon, 12 May 2025 16:52:52 +0200
| Newsgroups | gmane.editors.nano.devel |
|---|---|
| Message-ID | <[email protected]> |
And as the presence of an anchor is now visible in the mini bar,
the "Placed anchor"/"Removed anchor" messages are no longer needed
when the mini bar is active.
---
src/search.c | 4 ++--
src/winio.c | 6 ++++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/search.c b/src/search.c
index 677b4061..42c95ada 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1009,9 +1009,9 @@ void put_or_lift_anchor(void)
refresh_needed = TRUE;
if (openfile->current->has_anchor)
- statusline(REMARK, _("Placed anchor"));
+ statusline(HUSH, _("Placed anchor"));
else
- statusline(REMARK, _("Removed anchor"));
+ statusline(HUSH, _("Removed anchor"));
}
/* Make the given line the current line, or report the anchoredness. */
diff --git a/src/winio.c b/src/winio.c
index fd7f27b2..fb3cbe39 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -2272,6 +2272,12 @@ void minibar(void)
show_states_at(footwin);
}
+ /* Indicate it when the line has an anchor. */
+ if (openfile->current->has_anchor && namewidth + 7 < COLS)
+ mvwaddstr(footwin, 0, COLS - 5 - padding, openfile->filetop->has_anchor ?
+ (using_utf8() ? "\xEF\xBF\xAD" : "=") :
+ (using_utf8() ? "\xE2\xAC\xA5" : "+"));
+
/* Display how many percent the current line is into the file. */
if (namewidth + 6 < COLS) {
sprintf(location, "%3zi%%", 100 * openfile->current->lineno / openfile->filebot->lineno);
--
2.48.1