Skip to content
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

fix: properly handle if shiftwidth = 0 #270

Merged
merged 1 commit into from
Jun 18, 2024
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
5 changes: 4 additions & 1 deletion lua/typescript-tools/protocol/text_document/did_open.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ local function configure(params)

local bo = vim.bo[vim.uri_to_bufnr(text_document.uri)]
local tab_size = bo.tabstop or 2
local indent_size = bo.shiftwidth or tab_size
local indent_size = bo.shiftwidth
if indent_size == 0 or not indent_size then
indent_size = tab_size
end
local convert_tabs_to_spaces = bo.expandtab or true
local new_line_character = get_eol_chars(bo)

Expand Down
Loading