~funvit

Recent activity

Re: [PATCH gio 0/1] [PATCH gio v2] ui/widget: password-mode for editor (io.Reader) 20 days ago

From Виталий Ф. to ~eliasnaur/gio-patches

Sourcehut bugged and lost part 2. Adding it manually...

diff --git a/widget/buffer.go b/widget/buffer.go
index c62ff34..5fbd7ef 100644
--- a/widget/buffer.go
+++ b/widget/buffer.go
@@ -13,8 +13,14 @@ const bufferDebug = false

 // editBuffer implements a gap buffer for text editing.
 type editBuffer struct {
- // caret is the caret position in bytes.
+ // Caret is the caret position in bytes.
+ //
+ // WARNING: use move() for caret moving, do not change value directly.

Re: [PATCH gio] ui/widget: password-mode for editor 27 days ago

From Виталий Ф. to ~eliasnaur/gio-patches

Short resume after some research with io.Reader:
1. Easy to implement masked reader
2. BUT caret begins to bugging

More info for #2:
- No such bug before io.Reader usage was introduced.
- Caret moves by wrong amount of runes (ex: when entering Russian
symbols on macos).

Due to i didn't know what is a "gap" for (editBuffer), and how to
handle caret (replacing position calculation with custom func for
masking mode can leads to bugs in future changes) – i'm cant suggest
new patch version...