core: add option weechat.look.align_multiline_words #802

Merged
merged 1 commit into from Dec 17, 2016

Projects

None yet

4 participants

@arza-zara
Contributor

See #411.

@torhve
Contributor
torhve commented Sep 20, 2016

I have tested this, and seems to work as advertised.

@flashcode
Member

Could you please make a screenshot of weechat with option enabled and disabled, to see the difference?
I'm not sure to understand exactly what does the action by reading the code.

@arza-zara
Contributor
arza-zara commented Oct 11, 2016 edited

On (current behaviour and default):
off
Off:
on

When the option is off, alignment and prefix_suffix is disabled when the beginning of a line is in the middle of a word. git diff -w shows it simply:

+            /* in the beginning of a word or in the middle of a word with multiline word align */
+            if ((chars_displayed == 0)
+                || CONFIG_BOOLEAN(config_look_align_multiline_words))
+            {
                 window->win_chat_cursor_x += length_align;
+
                 if ((CONFIG_INTEGER(config_look_align_end_of_lines) == CONFIG_LOOK_ALIGN_END_OF_LINES_MESSAGE)
                     && (CONFIG_INTEGER(config_look_prefix_align) != CONFIG_LOOK_PREFIX_ALIGN_NONE)
                     && CONFIG_STRING(config_look_prefix_suffix)
                     && CONFIG_STRING(config_look_prefix_suffix)[0]
                     && line->data->date > 0)
                 {
                     if (!simulate)
                     {
                         gui_window_save_style (GUI_WINDOW_OBJECTS(window)->win_chat);
                         gui_window_set_weechat_color (GUI_WINDOW_OBJECTS(window)->win_chat,
                                                       GUI_COLOR_CHAT_PREFIX_SUFFIX);
                         gui_window_current_emphasis = 0;
                     }
                     chars_displayed += gui_chat_display_word_raw (window, line,
                                                                   CONFIG_STRING(config_look_prefix_suffix),
                                                                   0, simulate,
                                                                   apply_style_inactive,
                                                                   nick_offline);
                     window->win_chat_cursor_x += gui_chat_strlen_screen (CONFIG_STRING(config_look_prefix_suffix));
                     chars_displayed += gui_chat_display_word_raw (window, line,
                                                                   str_space,
                                                                   0, simulate,
                                                                   apply_style_inactive,
                                                                   nick_offline);
                     window->win_chat_cursor_x += gui_chat_strlen_screen (str_space);
                     if (!simulate)
                         gui_window_restore_style (GUI_WINDOW_OBJECTS(window)->win_chat);
                 }
+            }
@flashcode
Member

Thanks, I'll test and merge that soon.

@flashcode flashcode removed the waiting info label Oct 13, 2016
@resilar
resilar commented Dec 13, 2016

Please merge this. The multiline-URL problem is the only thing keeping me switching from irssi (and oh god I hate that inflexible piece of shit software).

@flashcode flashcode merged commit 592810c into weechat:master Dec 17, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@flashcode flashcode self-assigned this Dec 17, 2016
@flashcode flashcode added this to the 1.7 milestone Dec 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment