Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Show how far you are in a long message

Addresses most of ticket #119 - it shows how far you are in a long
message, but not in a message that you're typing.  The display style
I've somewhat arbitrarily chosen is to replace <truncated> with
<truncated: $num_lines_through/$total_lines>.

Additionally, the <truncated> part of sepbar has been moved to be next
to 'SCROLL', which it is most similar to.
  • Loading branch information...
commit 6eb3ed9ee6c4b94d35628e5b6b2bbaeccca565a9 1 parent 6476c0e
Jason Gross JasonGross authored andersk committed
Showing with 11 additions and 8 deletions.
  1. +11 −8 sepbar.c
19 sepbar.c
View
@@ -15,6 +15,7 @@ static void sepbar_redraw(owl_window *w, WINDOW *sepwin, void *user_data)
const owl_view *v;
int x, y, i;
const char *foo, *appendtosepbar;
+ int cur_numlines, cur_totallines;
ml=owl_global_get_msglist(&g);
v=owl_global_get_current_view(&g);
@@ -49,14 +50,6 @@ static void sepbar_redraw(owl_window *w, WINDOW *sepwin, void *user_data)
if (strcmp(foo, owl_global_get_view_home(&g)))
wattron(sepwin, A_REVERSE);
- if (owl_mainwin_is_curmsg_truncated(owl_global_get_mainwin(&g))) {
- getyx(sepwin, y, x);
- wmove(sepwin, y, x+2);
- wattron(sepwin, A_BOLD);
- waddstr(sepwin, " <truncated> ");
- wattroff(sepwin, A_BOLD);
- }
-
i=owl_mainwin_get_last_msg(owl_global_get_mainwin(&g));
if ((i != -1) &&
(i < owl_view_get_size(v)-1)) {
@@ -89,6 +82,16 @@ static void sepbar_redraw(owl_window *w, WINDOW *sepwin, void *user_data)
wattroff(sepwin, A_BOLD);
}
+ if (owl_mainwin_is_curmsg_truncated(owl_global_get_mainwin(&g))) {
+ getyx(sepwin, y, x);
+ wmove(sepwin, y, x+2);
+ wattron(sepwin, A_BOLD);
+ cur_numlines = owl_global_get_curmsg_vert_offset(&g) + 1;
+ cur_totallines = owl_message_get_numlines(owl_view_get_element(v, owl_global_get_curmsg(&g)));
+ wprintw(sepwin, " <truncated: %d/%d> ", cur_numlines, cur_totallines);
+ wattroff(sepwin, A_BOLD);
+ }
+
if (owl_global_get_curmsg_vert_offset(&g)) {
getyx(sepwin, y, x);
wmove(sepwin, y, x+2);
Please sign in to comment.
Something went wrong with that request. Please try again.