diff --git a/index.html b/index.html index 11b6eb5..62e0616 100644 --- a/index.html +++ b/index.html @@ -152,10 +152,21 @@
  • ALT-<: Switch to previous active buffer
  • ALT-g: Focus on buffer list filter
  • Esc-Esc: Disconnect (double-tap)
  • -
  • Arrow keys: Navigate history
  • +
  • Arrow keys: Navigate history, or navigate quick search buffer results.
  • Tab: Complete nick
  • The following readline/emacs style keybindings can be enabled with a setting: Ctrl-a, Ctrl-e, Ctrl-u, Ctrl-k, Ctrl-w
  • +

    Pinning buffers

    +

    + The option "Only show buffers with unread messages" is useful when you have a lot of buffers and can't meaningfully look at all of them at the same time. However, often you have a select few buffers that you use more frequently and would like to have displayed permanently. +

    +

    + To pin a buffer, type /buffer set localvar_set_pinned true. Note: Local variables on buffers are not persisted across WeeChat restarts, so either use script buffer_autoset.py to automatically apply that upon buffer creation or use a trigger if you want automatic repinning when buffers get recreated. To unpin, you can use the same command and set anything other than true. +

    +

    + Helpful trigger to automatically repin a buffer (in this instance, irc.freenode.#weechat):

    /trigger add autopin signal "buffer_opened" "${buffer[${tg_signal_data}].full_name} =~ irc.freenode.#weechat" "" "/command -buffer ${buffer[${tg_signal_data}].full_name} * /buffer set localvar_set_pinned true"
    +

    + diff --git a/js/glowingbear.js b/js/glowingbear.js index c4bda15..0ebca25 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -680,6 +680,11 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', if (buffer.fullName === "core.weechat" || (settings.orderbyserver && buffer.type === 'server')) { return true; } + + // Always show pinned buffers + if (buffer.pinned) { + return true; + } return (buffer.unread > 0 || buffer.notification > 0) && !buffer.hidden; } return !buffer.hidden; diff --git a/js/handlers.js b/js/handlers.js index f87376d..2867d8e 100644 --- a/js/handlers.js +++ b/js/handlers.js @@ -306,6 +306,7 @@ weechat.factory('handlers', ['$rootScope', '$log', 'models', 'plugins', 'notific old.server = localvars.server; old.serverSortKey = old.plugin + "." + old.server + (old.type === "server" ? "" : ("." + old.shortName)); + old.pinned = localvars.pinned === "true"; } }; diff --git a/js/models.js b/js/models.js index ba091c6..d650f30 100644 --- a/js/models.js +++ b/js/models.js @@ -95,6 +95,9 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo var plugin = message.local_variables.plugin; var server = message.local_variables.server; + + var pinned = message.local_variables.pinned === "true"; + // Server buffers have this "irc.server.freenode" naming schema, which // messes the sorting up. We need it to be "irc.freenode" instead. var serverSortKey = plugin + "." + server + @@ -335,7 +338,8 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo getHistoryUp: getHistoryUp, getHistoryDown: getHistoryDown, isNicklistEmpty: isNicklistEmpty, - nicklistRequested: nicklistRequested + nicklistRequested: nicklistRequested, + pinned: pinned, }; };