Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions scripts/panvimdoc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ function string.ends_with(str, ends)
return ends == "" or str:sub(-#ends) == ends
end

local function empty(s)
return s == nil or #s == 0
end

-- Character escaping
local function escape(s, in_attribute)
return s
Expand Down Expand Up @@ -97,18 +101,18 @@ local function renderTitle()
local vim_doc_title = PROJECT .. ".txt"
local vim_doc_title_tag = "*" .. vim_doc_title .. "*"
local project_description = DESCRIPTION or ""
if not project_description or #project_description == 0 then
if empty(project_description) then
local vim_version = VIMVERSION
if vim_version == nil then
if empty(vim_version) then
vim_version = osExecute("nvim --version"):gmatch("([^\n]*)\n?")()
if string.find(vim_version, "-dev") then
vim_version = string.gsub(vim_version, "(.*)-dev.*", "%1")
end
if vim_version == "" then
if empty(vim_version) then
vim_version = osExecute("vim --version"):gmatch("([^\n]*)\n?")()
vim_version = string.gsub(vim_version, "(.*) %(.*%)", "%1")
end
if vim_version == "" then
if empty(vim_version) then
vim_version = "vim"
end
elseif vim_version == "vim" then
Expand Down
Loading