Add a New Comment (Rich Markup)
Done. So the day change is now dynamic and displayed: - before the first line of buffer (if day of first line is different from current date) - between two lines when day changes - after last line (if day of last line is different from current date).
Suggested display pseudo-code for display which should be ok with corner cases (any number of lines), if you want some inspiration, this is how I think it should work to display lines. Totally ignoring how display works at the moment, feel free to completely ignore: display() { time = now() index = buffer.num_lines - 1 while(!window.full() && index >= 0) { line = buffer.lines[index] if (time - line.time() >= 1day) { window.push_back(day_change(line.time(), time)) time = line.time() continue; } window.push_back(line) --index; } display window # window.line[0] is bottom of the screen } day_change(now, before) { from_string = "" if (now - before >= 2days) { from_string = "from %t" % before.date } return "Day changed %s to %t" % (from_string, now.date) }
I +1 for all the ideas here. If the message is displayed only when the buffer is displayed (and then not stored as a line in the buffer), then the filters are not a problem. WeeChat should just check if the date between two messages displayed (ie non filtered) is different and displays "Day changed to XXX" with the date of the second message. And by the way with such feature, the code in logger plugin to display similar message in backlog can be removed too, since it will be automatic.
I'd like this as well. To expand: I have some very inactive buffers, such as highmon, and channels when using smart-filter that have several day-changed messages in a row. It would be very nice to have these contracted to "Day changed from Fri, 16 Aug 2013 to Mon, 19 Aug 2013" between messages, when they're more than one day in between. I'd still like a "day changed" at the bottom of the screen though, if the day has changed , to display that the last message might also be far away in time, even if there's no following message. With these changes in place, per-window, multiple day-changed messages in the merged-servers window shouldn't have to be necessary, only that there's one "Day changed" that doesn't belong to any server, but rather the window displaying them. They would have to update when enabling/disabling filters though, so I'm not sure how this ties in with existing code.
Following on from bug: https://savannah.nongnu.org/bugs/index.php?39826 To expand on the idea; it would be advisable to display a "day changed" notification between two messages displayed in a window when the date has changed. This is to signify that the messages may not be close to each other.
(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)
Attach Files: Comment:
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Only logged-in users can vote.
Please enter the title of George Orwell's famous dystopian book (it's a date):
Follow 5 latest changes.
Copyright © 2023 Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. The Levitating, Meditating, Flute-playing Gnu logo is a GNU GPL'ed image provided by the Nevrax Design Team. Source Code
Powered by Savane 3.11