Skip to content

Commit

Permalink
Merge pull request #27 from jghauser/fix_windows_detection
Browse files Browse the repository at this point in the history
Fix windows detection
  • Loading branch information
jghauser authored Nov 25, 2023
2 parents 31e7e72 + 319c900 commit cbcecff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion doc/papis.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*papis.txt* For NVIM v0.8.0 Last change: 2023 August 16
*papis.txt* For NVIM v0.8.0 Last change: 2023 November 25

==============================================================================
Table of Contents *papis-table-of-contents*
Expand Down
15 changes: 11 additions & 4 deletions lua/papis/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,16 @@ local os_name = vim.loop.os_uname().sysname

local log = require("papis.logger")

local is_windows = os_name == "Windows"
local is_macos = os_name == "Darwin"
local is_linux = os_name == "Linux"
local is_windows
local is_macos
local is_linux
if os_name == "Linux" then
is_linux = true
elseif os_name == "Darwin" then
is_macos = true
elseif os_name:match("Windows") then
is_windows = true
end

local M = {}

Expand Down Expand Up @@ -225,7 +232,7 @@ function M.do_clean_format_tbl(format_table, entry, remove_editor_if_author)
-- format table or the value in the format table is "empty_line"
if entry[v[1]] or v[1] == "empty_line" then
table.insert(clean_format_table, v)
-- don't add editor if there is author and use_author_if_editor is true
-- don't add editor if there is author and use_author_if_editor is true
elseif remove_editor_if_author and v[1] == "author" and entry["editor"] then
table.insert(clean_format_table, v)
end
Expand Down

0 comments on commit cbcecff

Please sign in to comment.