summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2010-03-03 22:19:51 +0100
committerSebastien Helleu <flashcode@flashtux.org>2010-03-03 22:19:51 +0100
commit4faa3c772b801c44fd59bac2b77021b52381b07e (patch)
tree7659ff484da7a028828c3d4a52dab0061bd6c279 /src
parentd1950311cfc7f28940ef3810fda84c2c56841656 (diff)
downloadweechat-4faa3c772b801c44fd59bac2b77021b52381b07e.zip
Add new option weechat.look.read_marker_always_show
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-config.c6
-rw-r--r--src/core/wee-config.h1
-rw-r--r--src/gui/curses/gui-curses-chat.c2
-rw-r--r--src/gui/curses/gui-curses-window.c6
4 files changed, 14 insertions, 1 deletions
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index 3a96c5f23..eeb603dcf 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -100,6 +100,7 @@ struct t_config_option *config_look_prefix_buffer_align_max;
struct t_config_option *config_look_prefix_buffer_align_more;
struct t_config_option *config_look_prefix_suffix;
struct t_config_option *config_look_read_marker;
+struct t_config_option *config_look_read_marker_always_show;
struct t_config_option *config_look_save_config_on_exit;
struct t_config_option *config_look_save_layout_on_exit;
struct t_config_option *config_look_scroll_amount;
@@ -1406,6 +1407,11 @@ config_weechat_init_options ()
N_("use a marker (line or char) on buffers to show first unread line"),
"none|line|dotted-line|char",
0, 0, "dotted-line", NULL, 0, NULL, NULL, &config_change_read_marker, NULL, NULL, NULL);
+ config_look_read_marker_always_show = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "read_marker_always_show", "boolean",
+ N_("always show read marker, even if it is after last buffer line"),
+ NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_save_config_on_exit = config_file_new_option (
weechat_config_file, ptr_section,
"save_config_on_exit", "boolean",
diff --git a/src/core/wee-config.h b/src/core/wee-config.h
index 0c3e4fb5a..398de7c77 100644
--- a/src/core/wee-config.h
+++ b/src/core/wee-config.h
@@ -115,6 +115,7 @@ extern struct t_config_option *config_look_prefix_buffer_align_max;
extern struct t_config_option *config_look_prefix_buffer_align_more;
extern struct t_config_option *config_look_prefix_suffix;
extern struct t_config_option *config_look_read_marker;
+extern struct t_config_option *config_look_read_marker_always_show;
extern struct t_config_option *config_look_save_config_on_exit;
extern struct t_config_option *config_look_save_layout_on_exit;
extern struct t_config_option *config_look_scroll_amount;
diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c
index 3a907656f..9fe17aab7 100644
--- a/src/gui/curses/gui-curses-chat.c
+++ b/src/gui/curses/gui-curses-chat.c
@@ -926,7 +926,7 @@ gui_chat_display_line (struct t_gui_window *window, struct t_gui_line *line,
}
}
- if (marker_line && gui_line_get_next_displayed (line))
+ if (marker_line)
{
gui_chat_display_horizontal_line (window, simulate);
gui_chat_display_new_line (window, num_lines, count,
diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c
index 94ccb8276..b5030362e 100644
--- a/src/gui/curses/gui-curses-window.c
+++ b/src/gui/curses/gui-curses-window.c
@@ -586,6 +586,12 @@ gui_window_switch_to_buffer (struct t_gui_window *window,
ptr_bar_window->bar->bar_refresh_needed = 1;
}
+ if (CONFIG_BOOLEAN(config_look_read_marker_always_show)
+ && set_last_read && !window->buffer->lines->last_read_line)
+ {
+ window->buffer->lines->last_read_line = window->buffer->lines->last_line;
+ }
+
hook_signal_send ("buffer_switch",
WEECHAT_HOOK_SIGNAL_POINTER, buffer);
}