Code Monkey home page Code Monkey logo

Comments (13)

aserowy avatar aserowy commented on August 13, 2024 2

Heho,

currently on small vacation with the family. I'll soon get home and look into the issue and the pr asap.

Kind regards
Alexander

from tmux.nvim.

aserowy avatar aserowy commented on August 13, 2024 1

@twidxuga
i made it a little bit more strict:

value = value:gsub("next%-", "")

all specs added for the next- release :D

from tmux.nvim.

aserowy avatar aserowy commented on August 13, 2024 1

Cool, ty for using my work! means much to me!
Closing the issue.

from tmux.nvim.

twidxuga avatar twidxuga commented on August 13, 2024 1

Just tested and confirmed it works.

Cheers, much appreciated!

from tmux.nvim.

twidxuga avatar twidxuga commented on August 13, 2024

This issue affects me as well. I am using tmux next-3.3.

from tmux.nvim.

twidxuga avatar twidxuga commented on August 13, 2024

One possible fix, that works for me (and possibly for everyone else) is to change lua/tmux/version/parse.lua to:

local log = require("tmux.log")

local function get_order(char)
    if char == nil or char == "" then
        return 0
    end
    return string.byte(char) - string.byte("a") + 1
end

local M = {}
function M.from(value)
    if value == nil then
        log.error("nil could not get parsed!")
        return {}
    end

    value = value:sub(value:find("%d"),value:find("$"))

    if value:match("^%d+%.%d+[a-z]?$") == nil then
        log.error(value .. " could not get parsed!")
        return {}
    end

    local index_dot = value:find("%.")
    local index_patch = value:find("[a-z]")

    local minor
    if index_patch == nil then
        minor = tonumber(value:sub(index_dot + 1))
    else
        minor = tonumber(value:sub(index_dot + 1, index_patch - 1))
    end

    local patch = 0
    if index_patch ~= nil then
        patch = get_order(value:sub(index_patch))
    end

    return {
        major = tonumber(value:sub(1, index_dot - 1)),
        minor = minor,
        patch = patch,
    }
end

return M

Note the additional value = value:sub(value:find("%d"),value:find("$")) at the beginning of function M.from()

from tmux.nvim.

b0o avatar b0o commented on August 13, 2024

Thank you Alexander, no hurry on my end. Please enjoy your vacation with your family!

from tmux.nvim.

aserowy avatar aserowy commented on August 13, 2024

Heho,

can you please try the fix?

Kind regards

from tmux.nvim.

twidxuga avatar twidxuga commented on August 13, 2024

Perfect, thank you!

from tmux.nvim.

twidxuga avatar twidxuga commented on August 13, 2024

Actually, I was just testing this. It doesn't work with:

value = value:gsub("next%-", "")

Because the '-' is not in the value argument to function M.from(value)

Suggest just removing the %- from the expression. So this should work:

value = value:gsub("next", "")

Thanks again!

from tmux.nvim.

aserowy avatar aserowy commented on August 13, 2024

ok, i hope we got it now :D

from tmux.nvim.

aserowy avatar aserowy commented on August 13, 2024

Nice, thanks for the support

from tmux.nvim.

b0o avatar b0o commented on August 13, 2024

It's working for me too, thank you! 🎉

from tmux.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.