Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: next3.4 could not get parsed #56

Closed
b0o opened this issue Jan 9, 2022 · 13 comments
Closed

Error: next3.4 could not get parsed #56

b0o opened this issue Jan 9, 2022 · 13 comments
Labels
bug Something isn't working

Comments

@b0o
Copy link

b0o commented Jan 9, 2022

Starting in the latest commit (cb1f401), I get the following error on startup:

Error detected while processing $XDG_CONFIG_HOME/nvim/init.lua:
next3.4 could not get parsed!

next3.4 is my tmux version:

$ tmux -V
tmux next-3.4

I'm using tmux-git from the AUR.

Using the previous commit (6e9597a) works without issue.

@twidxuga
Copy link

twidxuga commented Jan 9, 2022

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

@twidxuga
Copy link

twidxuga commented Jan 9, 2022

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()

@aserowy
Copy link
Owner

aserowy commented Jan 9, 2022

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

@b0o
Copy link
Author

b0o commented Jan 9, 2022

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

@aserowy aserowy closed this as completed in 7aeceac Jan 9, 2022
@aserowy aserowy added the bug Something isn't working label Jan 9, 2022
@aserowy aserowy reopened this Jan 9, 2022
@aserowy
Copy link
Owner

aserowy commented Jan 9, 2022

Heho,

can you please try the fix?

Kind regards

@aserowy
Copy link
Owner

aserowy commented Jan 9, 2022

@twidxuga
i made it a little bit more strict:

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

all specs added for the next- release :D

@twidxuga
Copy link

twidxuga commented Jan 9, 2022

Perfect, thank you!

@aserowy
Copy link
Owner

aserowy commented Jan 9, 2022

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

@aserowy aserowy closed this as completed Jan 9, 2022
@twidxuga
Copy link

twidxuga commented Jan 9, 2022

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!

@aserowy aserowy reopened this Jan 9, 2022
@aserowy aserowy closed this as completed in 2535a67 Jan 9, 2022
@aserowy
Copy link
Owner

aserowy commented Jan 9, 2022

ok, i hope we got it now :D

@aserowy aserowy reopened this Jan 9, 2022
@twidxuga
Copy link

twidxuga commented Jan 9, 2022

Just tested and confirmed it works.

Cheers, much appreciated!

@aserowy
Copy link
Owner

aserowy commented Jan 9, 2022

Nice, thanks for the support

@aserowy aserowy closed this as completed Jan 9, 2022
@b0o
Copy link
Author

b0o commented Jan 10, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants