src/nnn.c | 18 ++++++++++-------- diff --git a/src/nnn.c b/src/nnn.c index 22aec1365f5f48523839d8788c23505be929513e..6e7725812d95f24e6f13b592ff40695e1814fbf2 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -5726,6 +5726,14 @@ if (cfg.cursormode) tocursor(); } +static inline void markhovered(void) +{ + if (cfg.showdetail && ndents) { /* Reversed block for hovered entry */ + tocursor(); + addch(' ' | A_REVERSE); + } +} + static int adjust_cols(int n) { /* Calculate the number of cols available to print entry name */ @@ -5777,10 +5785,7 @@ /* Must reset e.g. no files in dir */ if (dir) attroff(COLOR_PAIR(cfg.curctx + 1) | A_BOLD); - if (cfg.showdetail) { /* Reversed block for hovered entry */ - tocursor(); - addch(' ' | A_REVERSE); - } + markhovered(); statusbar(path); } @@ -5904,10 +5909,7 @@ move(xlines - 2, 0); addch('v'); } - if (cfg.showdetail) { /* Reversed block for hovered entry */ - tocursor(); - addch(' ' | A_REVERSE); - } + markhovered(); statusbar(path); }