Skip to content

fix(renderer): no_next_padding to fix indentation set to 1 #977

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

Merged
merged 2 commits into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion lua/neo-tree/sources/common/components.lua
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,11 @@ M.indent = function(config, node, state)
end
end

table.insert(indent, { text = char .. string.rep(" ", spaces_count), highlight = highlight })
table.insert(indent, {
text = char .. string.rep(" ", spaces_count),
highlight = highlight,
no_next_padding = true,
})
end

return indent
Expand Down
2 changes: 1 addition & 1 deletion lua/neo-tree/ui/renderer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ local prepare_node = function(item, state)
padding = " "
end
data.text = padding .. data.text
should_pad = data.text:sub(#data.text) ~= " "
should_pad = data.text:sub(#data.text) ~= " " and not data.no_next_padding

actual_width = actual_width + vim.api.nvim_strwidth(data.text)
line:append(data.text, data.highlight)
Expand Down