X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/f07f9d2d3f47ad933d843129c0d280c1c56ce6a9..refs/heads/uh-backup:/weechat/python/buffer_autoset.py diff --git a/weechat/python/buffer_autoset.py b/weechat/python/buffer_autoset.py index c33d3ad..38dbc4b 100644 --- a/weechat/python/buffer_autoset.py +++ b/weechat/python/buffer_autoset.py @@ -22,6 +22,8 @@ # # History: # +# 2018-04-14, Kim B. Heino: +# version 1.1: on startup apply settings to already opened buffers # 2017-06-21, Sébastien Helleu : # version 1.0: rename command /autosetbuffer to /buffer_autoset # 2015-09-28, Simmo Saan : @@ -48,7 +50,7 @@ SCRIPT_NAME = "buffer_autoset" SCRIPT_AUTHOR = "Sébastien Helleu " -SCRIPT_VERSION = "1.0" +SCRIPT_VERSION = "1.1" SCRIPT_LICENSE = "GPL3" SCRIPT_DESC = "Auto-set buffer properties when a buffer is opened" @@ -328,8 +330,13 @@ if __name__ == "__main__" and import_ok: weechat.hook_config("%s.buffer.*" % CONFIG_FILE_NAME, "bas_config_option_cb", "") - # core buffer is already open on script startup, check manually! - bas_signal_buffer_opened_cb("", "", weechat.buffer_search_main()) + # apply settings to all already opened buffers + buffers = weechat.infolist_get("buffer", "", "") + if buffers: + while weechat.infolist_next(buffers): + buffer = weechat.infolist_pointer(buffers, "pointer") + bas_signal_buffer_opened_cb("", "", buffer) + weechat.infolist_free(buffers) # ==================================[ end ]===================================