File src/ui/ui.c changed (mode: 100644) (index 538173942..3e4baafa5) |
... |
... |
static WINDOW *lborder; |
150 |
150 |
static WINDOW *mborder; |
static WINDOW *mborder; |
151 |
151 |
static WINDOW *rborder; |
static WINDOW *rborder; |
152 |
152 |
|
|
|
153 |
|
static void set_ruler_text(const char val[], int lazy_redraw); |
153 |
154 |
static int init_pair_wrapper(int pair, int fg, int bg); |
static int init_pair_wrapper(int pair, int fg, int bg); |
154 |
155 |
static int pair_content_wrapper(int pair, int *fg, int *bg); |
static int pair_content_wrapper(int pair, int *fg, int *bg); |
155 |
156 |
static int pair_in_use(int pair); |
static int pair_in_use(int pair); |
|
... |
... |
ui_ruler_update(view_t *view, int lazy_redraw) |
219 |
220 |
expanded = expand_ruler_macros(view, cfg.ruler_format); |
expanded = expand_ruler_macros(view, cfg.ruler_format); |
220 |
221 |
expanded = break_in_two(expanded, getmaxx(ruler_win), "%="); |
expanded = break_in_two(expanded, getmaxx(ruler_win), "%="); |
221 |
222 |
|
|
222 |
|
ui_ruler_set(expanded); |
|
223 |
|
if(!lazy_redraw) |
|
224 |
|
{ |
|
225 |
|
ui_refresh_win(ruler_win); |
|
226 |
|
} |
|
227 |
|
|
|
|
223 |
|
set_ruler_text(expanded, lazy_redraw); |
228 |
224 |
free(expanded); |
free(expanded); |
229 |
225 |
} |
} |
230 |
226 |
|
|
231 |
227 |
void |
void |
232 |
228 |
ui_ruler_set(const char val[]) |
ui_ruler_set(const char val[]) |
|
229 |
|
{ |
|
230 |
|
update_statusbar_layout(); |
|
231 |
|
set_ruler_text(val, /*lazy_redraw=*/1); |
|
232 |
|
} |
|
233 |
|
|
|
234 |
|
/* Sets text to be displayed on the ruler and updates the ruler on the screen |
|
235 |
|
* (possibly lazily). */ |
|
236 |
|
static void |
|
237 |
|
set_ruler_text(const char val[], int lazy_redraw) |
233 |
238 |
{ |
{ |
234 |
239 |
const int x = getmaxx(ruler_win) - strlen(val); |
const int x = getmaxx(ruler_win) - strlen(val); |
235 |
240 |
|
|
236 |
241 |
werase(ruler_win); |
werase(ruler_win); |
237 |
242 |
mvwaddstr(ruler_win, 0, MAX(x, 0), val); |
mvwaddstr(ruler_win, 0, MAX(x, 0), val); |
238 |
|
wnoutrefresh(ruler_win); |
|
|
243 |
|
if(lazy_redraw) |
|
244 |
|
{ |
|
245 |
|
update_window_lazy(ruler_win); |
|
246 |
|
} |
|
247 |
|
else |
|
248 |
|
{ |
|
249 |
|
ui_refresh_win(ruler_win); |
|
250 |
|
} |
239 |
251 |
} |
} |
240 |
252 |
|
|
241 |
253 |
int |
int |