Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add keybindings inspired from weechat #61

Open
3 tasks
Ekleog opened this issue Oct 11, 2018 · 2 comments
Open
3 tasks

Add keybindings inspired from weechat #61

Ekleog opened this issue Oct 11, 2018 · 2 comments

Comments

@Ekleog
Copy link

Ekleog commented Oct 11, 2018

Hello,

I'm currently using weechat, but have been told that glirc might be a nice replacement. Having skimmed the wiki, here are the things that are blocking me from trying it, hoping you would find them useful too:

  • The go.py plugin for weechat, plugged on Alt-G (or whatever), that starts fuzzy-matching the buffer list looking for a buffer to jump into
  • Alt-U, that jumps to the last message not yet seen (marked by a bar in weechat, can't see it in the screenshot but I guess there's one in glirc too)
  • Alt-N and Alt-P, which jump to next/previous highlight in the current buffer

In addition, something that would be nice to have (but which weechat doesn't have) and that I can't find in the docs either is a way to reset the “last read message” bar to some other position, if one wants to mark a message as unread to come back to it later.

What do you think about these? :)

@glguy
Copy link
Owner

glguy commented Oct 11, 2018

I think the easiest way to tackle fuzzy jumping would be to start with a short command like /j that had dynamic updating like /url does so you could see the match incrementally. This would basically be like a version of /c for changing between channels that simply didn't use an exact match.

For jumping to the unread bar and highlighted messages you can use the importance metadata stored on lines and the marker metadata stored on windows. The hardest part would just be figuring out how many lines of actual scrollback are needed to bring the logical lines to the top.

data WindowLine = WindowLine
{ _wlSummary :: !IrcSummary -- ^ Summary value
, _wlPrefix :: !Image' -- ^ Normal rendered image prefix
, _wlImage :: !Image' -- ^ Normal rendered image
, _wlFullImage :: !Image' -- ^ Detailed rendered image
, _wlImportance :: !WindowLineImportance -- ^ Importance of message
, _wlTimestamp :: {-# UNPACK #-} !PackedTime
}

data Window = Window
{ _winMessages :: !WindowLines -- ^ Messages to display, newest first
, _winMarker :: !(Maybe Int) -- ^ Location of line drawn to indicate newer messages
, _winUnread :: !Int -- ^ Messages added since buffer was visible
, _winTotal :: !Int -- ^ Messages in buffer
, _winMention :: !WindowLineImportance -- ^ Indicates an important event is unread
, _winHideMeta :: !Bool -- ^ Hide metadata messages
}

For manually setting the unread message marker the only tricky part is picking a UI for specifying the right message. Actually moving the bar is just a matter of setting this Int:

, _winMarker :: !(Maybe Int) -- ^ Location of line drawn to indicate newer messages

I'd be happy to work with you on making any of these changes. I'm probably not going to implement features to get someone try using glirc for the first time, but these certainly sound interesting!

@Ekleog
Copy link
Author

Ekleog commented Oct 11, 2018

Thank you for the pointers! Unfortunately I've got a whole lot of projects of my own, and weechat works well enough for my use case… well, I guess maybe I'll come back here in a few years when other projects will be complete and try to implement it?

Leaving this open for the ideas if someone else feels like implementing it, feel free to close :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants