| 4 Feb 2026 | |||
| japhb | o/ lizmat | 17:57 | |
| lizmat | japhb o/ | 17:58 | |
| japhb | Exactly what lizmat said | ||
| Geth | Terminal-Widgets/main: f6911a6722 | (Patrick Böker)++ | lib/Terminal/Widgets/WrappableBuffer.rakumod Fix clicking below the last line in a wrappable buffer |
18:17 | |
| Terminal-Widgets/main: 47a7a596aa | (Geoffrey Broadwell)++ (committed using GitHub Web editor) | lib/Terminal/Widgets/WrappableBuffer.rakumod Merge pull request #37 from patrickbkr/fix-set-cursor Fix clicking below the last line in a wrappable buffer; needs one additional fix after this. |
|||
| Terminal-Widgets/main: 9c5042d28c | (Geoffrey Broadwell)++ | lib/Terminal/Widgets/WrappableBuffer.rakumod Follow-up fix for merged PR |
18:20 | ||
| Terminal-Widgets/main: dbf76b4c85 | (Geoffrey Broadwell)++ | lib/Terminal/Widgets/WrappableBuffer.rakumod Clarify wrap-prefix references, since other prefix types are coming |
18:25 | ||
| Terminal-Widgets/main: 77d2feb6a9 | (Geoffrey Broadwell)++ | lib/Terminal/Widgets/WrappableBuffer.rakumod Allow WrappableBuffer users to reserve some line width |
18:39 | ||
| japhb | patrickb: This ^^ allows you to mark some of the horizontal space of a WrappableBuffer as reserved-width, which will be subtracted from line wrap width automatically. That's the space in which you can stuff your line numbers, breakpoint markers, etc. (You can also override the calculation of available-wrap-width if you want to do some dynamic magic.) | 18:41 | |
| Commented on #35; let me know if I can close it now. | 18:45 | ||
| Geth | ¦ Terminal-Widgets: japhb self-assigned How to create a source view widget with line numbers? github.com/japhb/Terminal-Widgets/issues/35 | ||
| patrickb | oh wow, that was fast! | 19:10 | |
| I think I still need a bit more help Re span-line-start. Is it oblivious about wrapping? Because as a user of the class I wouldn't know how to account for the dynamics wrapping brings in. | 19:11 | ||
| What is $start exactly? The logical first line of the chunk? (i.e. the line number of the input text?) | 19:12 | ||
| If so, it's trivial, if I happen to know that line-groups equal lines. | 19:13 | ||
| So just given line group index equals line number, I can just return `($start, 0)`? | 19:14 | ||
| patrickb tries | 19:15 | ||
| Returning $start, $start makes it work. I think I need to return the line-group index (which equals the line number) and the logical line number of the first line of that line group. (also equals to the requested line number) | 19:37 | ||
| I think I won't be able to get the `span-line-start` optimization to work. `$pos` is the *display* line number of the first visible line. So $pos needs to take wrappings into account. To calculate tha value, I'd have to iterate through `%wrapped-lines` and sum up the line counts. That defeats the optimization as that's exactly what `span-line-chunk` does already. | 20:24 | ||
| Actually this issue is closely related to the discussion about the line number prefix thing. | 20:42 | ||
| github.com/japhb/Terminal-Widgets/...3849642095 | |||
| Both of these revolve around the issue of having the hard line number of the first visible line number available. | 20:43 | ||
| japhb | You always have the buffer's hard line count available (that's updated at insert time). Wouldn't you want to base the space you need on that number, since it is by definition the widest the number could be in the current buffer? | 22:14 | |
| patrickb: Are you going to do syntax highlighting of the Raku source? If so, using what library? | 22:33 | ||
| patrickb | syntax highlighting is already in. | 22:34 | |
| Uses Rainbow. | |||
| The debugger was the sole reason for me to create Rainbow. :-P | |||
| I want to have the widest number that can possibly be lu | 22:36 | ||
| in the visible screen area. | 22:37 | ||
| that's why I'm interested in the first hard line number on the screen. I can then add the widget height and take the width of that line number. | 22:38 | ||
| japhb | But that means that as you scroll back and forth across lines 10, 100, 1000 you'll cause the display to twitch. Which, if you're following execution path, will happen with great regularity. | ||
| patrickb | That's true. Maybe a bad idea. But at least most graphical editors do it this way... | 22:39 | |
| japhb pulls up Rainbow to take a look at that too .... | 22:40 | ||
| I think we should (between us) go for "works" before "ideal". I already have enough trouble fighting my instincts to overdo it. :-) | 22:41 | ||
| patrickb | Agreed. But my gut feeling is, that the "give me the topmost visible hard line number" is actually a really good thing to have. | 22:42 | |
| Given that I currently have 3 issues in mind that all hinge on this. | 22:43 | ||
| 1. the line number thing | |||
| 2. the optimization of span-line-start | 22:44 | ||
| 3. keeping the scroll position stable in light of the width and thus the wrapping changes | 22:45 | ||
| 4. I'd like to persist the scroll position when switching between different files and even restarts. That should really be a hard line position and not a display line position I'm persisting. | 22:46 | ||
| I'm off to bed. Good night! | 22:48 | ||
| Geth | Terminal-Widgets/main: 8a6159ea97 | (Geoffrey Broadwell)++ | lib/Terminal/Widgets/WrappableBuffer.rakumod Discuss refreshes in WrappableBuffer.clear.WHY |
22:51 | |
| Terminal-Widgets/main: 1d4902de8d | (Geoffrey Broadwell)++ | lib/Terminal/Widgets/WrappableBuffer.rakumod Make several formerly-private WrappableBuffer attributes visible |
|||
| japhb | Good night! | 22:54 | |
| Did you do the grammar in git.sr.ht/~patrickb/Rainbow/tree/m...ar.rakumod by hand? | 23:10 | ||
| 5 Feb 2026 | |||
| patrickb | Yes I wrote that grammar by hand. | 05:57 | |
| japhb | You are an absurdly patient man, in that case. | 06:57 | |
| japhb wanders off towards his turn at sleep | |||
| patrickb | Sleep well! | 06:58 | |