Skip to content

Commit

Permalink
refactor: use or pattern to set default
Browse files Browse the repository at this point in the history
No need to do `vim.tbl_deep_extend`.

 kristijanhusak Nov 2, 2023:
> Doing this should be enough, since nil is considered a falsy value.

Co-authored-by: Kristijan Husak <[email protected]>
  • Loading branch information
PriceHiller and kristijanhusak authored Nov 2, 2023
1 parent 7106e2e commit afdd6a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/orgmode/utils/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ local query_cache = {}
local tmp_window_augroup = vim.api.nvim_create_augroup('OrgTmpWindow', { clear = true })

function utils.readfile(file, opts)
opts = vim.tbl_deep_extend('keep', opts or {}, { raw = false })
opts = opts or {}
return Promise.new(function(resolve, reject)
uv.fs_open(file, 'r', 438, function(err1, fd)
if err1 then
Expand Down

0 comments on commit afdd6a7

Please sign in to comment.