feedback: indicate an anchor with a "+" in the line-number margin

master
Benno Schulenberg 2020-04-13 11:48:36 +02:00
parent e86180119e
commit 9bb9a747e2
2 changed files with 8 additions and 1 deletions

View File

@ -983,6 +983,8 @@ void put_or_lift_anchor(void)
{ {
openfile->current->has_anchor = !openfile->current->has_anchor; openfile->current->has_anchor = !openfile->current->has_anchor;
update_line(openfile->current, openfile->current_x);
if (openfile->current->has_anchor) if (openfile->current->has_anchor)
statusbar(_("Placed anchor")); statusbar(_("Placed anchor"));
else else

View File

@ -2395,7 +2395,12 @@ void draw_row(int row, const char *converted, linestruct *line, size_t from_col)
#endif #endif
mvwprintw(edit, row, 0, "%*zd", margin - 1, line->lineno); mvwprintw(edit, row, 0, "%*zd", margin - 1, line->lineno);
wattroff(edit, interface_color_pair[LINE_NUMBER]); wattroff(edit, interface_color_pair[LINE_NUMBER]);
wprintw(edit, " "); #ifndef NANO_TINY
if (line->has_anchor && from_col == 0)
wprintw(edit, "+");
else
#endif
wprintw(edit, " ");
} }
#endif #endif