~leon_plickat/nfm

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH nfm] Quote brackets in insertQuotedSliceAtCursor()

Details
Message ID
<20221122120722.29959-1-mail@hmachet.com>
DKIM signature
missing
Download raw message
Patch: +9 -1
---
Needed for file like `foo(1).txt`

 src/EditableUTF8String.zig | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/EditableUTF8String.zig b/src/EditableUTF8String.zig
index 01e3a2446b1e..532c8d0c0726 100644
--- a/src/EditableUTF8String.zig
+++ b/src/EditableUTF8String.zig
@@ -407,7 +407,7 @@ pub fn insertQuotedSliceAtCursor(self: *Self, in: []const u8) !void {
    var escaped: bool = false;
    for (in) |byte| {
        switch (byte) {
            ' ', '\t', '\n', '\'' => quoted = true,
            ' ', '\t', '\n', '\'', '(', ')' => quoted = true,
            '"' => escaped = true,
            else => {},
        }
@@ -453,6 +453,14 @@ test "EditableUTF8String: insertQuotedSliceAtCursor()" {
        try std.testing.expectEqualSlices(u8, "word \"'j'\"", a.buffer.items);
        a.deinit();
    }

    {
        const str = "word";
        var a = try Self.from(str);
        try a.insertQuotedSliceAtCursor("(1");
        try std.testing.expectEqualSlices(u8, "word\"(1)\"", a.buffer.items);
        a.deinit();
    }
}

pub fn insertCodepointAtCursor(self: *Self, cp: u21) !void {
-- 
2.38.1
Details
Message ID
<CPH1WMZ25U4V.18HISEYCQQNJ7@kasten>
In-Reply-To
<20221122120722.29959-1-mail@hmachet.com> (view parent)
DKIM signature
missing
Download raw message
Turns out I applied this a month ago and never told you...
Thanks!


Friendly greetings,
Leon Henrik Plickat
Reply to thread Export thread (mbox)