From de8b87138d58bcd560a979a24497196bf2c76a4a Mon Sep 17 00:00:00 2001 From: Caleb Allen Date: Mon, 3 Feb 2025 13:14:50 +0000 Subject: [PATCH 1/3] test each 1.11 patch version --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ed5777f..cf43b10 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -14,7 +14,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - julia-version: ['1.7', '1.8', '1.9', '1.10', '1.11'] + julia-version: ['1.10', '1.11.0', '1.11.1', '1.11.2', '1.11.3'] julia-arch: [x64] os: [ubuntu-latest, windows-latest, macOS-latest] From 03a85d5f536974a79e1b1c70006eadeb5812ae24 Mon Sep 17 00:00:00 2001 From: caleb-allen Date: Fri, 28 Feb 2025 15:42:53 +0000 Subject: [PATCH 2/3] explore buffer issue --- src/buffer.jl | 6 ++++-- src/textutils.jl | 4 ++-- test/command.jl | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/buffer.jl b/src/buffer.jl index 5353447..01e6fe8 100644 --- a/src/buffer.jl +++ b/src/buffer.jl @@ -29,6 +29,7 @@ VimMode(vm::VimMode) = vm Defaults to normal mode. """ function testbuf(s::AbstractString)::VimBuffer + # issue with testbuf! m = match(r"(.*?)\|(?:([ni])\|)?(.*)"s, s) if m === nothing throw(ArgumentError("could not construct VimBuffer with string \"$s\"\n Expecting a string with a pipe `|` indicating cursor position")) @@ -37,6 +38,7 @@ function testbuf(s::AbstractString)::VimBuffer buf = IOBuffer(; read=true, write=true, append=true) cursor_index = write(buf, a) after_cursor = write(buf, b) + @debug "creating testbuf" from=s start=a mode endd=b # @debug "creating testbuf" cursor_index after_cursor seek(buf, cursor_index) @@ -62,8 +64,8 @@ Base.mark(vb::VimBuffer) = mark(vb.buf) Base.peek(vb::VimBuffer, ::Type{T}) where {T} = peek(vb.buf, T) Base.peek(vb::VimBuffer) = peek(vb.buf) Base.reset(vb::VimBuffer) = reset(vb.buf) -Base.read(vb::VimBuffer, ::Type{Char}) = read(vb.buf, Char) -Base.read(vb::VimBuffer, ::Type{String}) = read(vb.buf, String) +Base.read(vb::VimBuffer) = read(vb.buf) +Base.read(vb::VimBuffer, t) = read(vb.buf, t) Base.take!(vb::VimBuffer) = take!(vb.buf) Base.eof(vb::VimBuffer) = eof(vb.buf) Base.skip(vb::VimBuffer, o) = skip(vb.buf, o) diff --git a/src/textutils.jl b/src/textutils.jl index cc3b6b1..e492989 100644 --- a/src/textutils.jl +++ b/src/textutils.jl @@ -204,11 +204,11 @@ function at_junction_type(junc_type, juncs::Set) # TODO nuke this whole thing for junc in juncs if junc isa junc_type - @debug "at_junction_type?" junc_type chars_by_cursor(buf) at_junction_type = true + # @debug "at_junction_type?" junc_type at_junction_type = true return true end end - @debug "at_junction_type?" junc_type chars_by_cursor(buf) at_junction_type = false + # @debug "at_junction_type?" junc_type at_junction_type = false return false end # Text helpers diff --git a/test/command.jl b/test/command.jl index f7b20e7..882396b 100644 --- a/test/command.jl +++ b/test/command.jl @@ -16,11 +16,13 @@ end function run(test_string::String, command)::VimBuffer buf = testbuf(test_string) + @debug "Running command against buffer" command buffer return run(buf, command) end # https://github.com/caleb-allen/VimBindings.jl/issues?q=is%3Aissue+is%3Aopen+label%3Abug @testset "bugs from github" begin + ENV["JULIA_DEBUG"] = "VimBindings" # https://github.com/caleb-allen/VimBindings.jl/issues/48 @test run("b::|Float64", "ciw") == testbuf("b::|i|") From 464468d95c569f1513ed164270d8cca64bbaf11e Mon Sep 17 00:00:00 2001 From: caleb-allen Date: Fri, 28 Feb 2025 17:10:10 +0000 Subject: [PATCH 3/3] Revert buffer methods --- src/buffer.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/buffer.jl b/src/buffer.jl index 01e6fe8..f72fc5a 100644 --- a/src/buffer.jl +++ b/src/buffer.jl @@ -64,8 +64,8 @@ Base.mark(vb::VimBuffer) = mark(vb.buf) Base.peek(vb::VimBuffer, ::Type{T}) where {T} = peek(vb.buf, T) Base.peek(vb::VimBuffer) = peek(vb.buf) Base.reset(vb::VimBuffer) = reset(vb.buf) -Base.read(vb::VimBuffer) = read(vb.buf) -Base.read(vb::VimBuffer, t) = read(vb.buf, t) +Base.read(vb::VimBuffer, ::Type{Char}) = read(vb.buf, Char) +Base.read(vb::VimBuffer, ::Type{String}) = read(vb.buf, String) Base.take!(vb::VimBuffer) = take!(vb.buf) Base.eof(vb::VimBuffer) = eof(vb.buf) Base.skip(vb::VimBuffer, o) = skip(vb.buf, o)