Skip to content

Commit

Permalink
Fixed extra spaces before separator
Browse files Browse the repository at this point in the history
  • Loading branch information
Wansmer committed Feb 27, 2023
1 parent dae056c commit 094a0df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/treesj/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,9 @@ end
function M.get_whitespace(tsj)
local p = tsj:parent():preset('join')
local s_count = p and p.space_separator or 1
local is_sep = (p and p.separator ~= '') and tsj:text() == p.separator

if tsj:is_first() then
if tsj:is_first() or is_sep then
s_count = 0
elseif (not p or tsj:is_omit()) and is_on_same_line(tsj:prev(), tsj) then
s_count = get_sibling_spacing(tsj:prev(), tsj)
Expand Down

0 comments on commit 094a0df

Please sign in to comment.