Skip to content

Commit

Permalink
Merge pull request #74 from tnorbye/override
Browse files Browse the repository at this point in the history
Fix override line width setting in the IDE plugin
  • Loading branch information
tnorbye authored Jul 29, 2022
2 parents 5b38bd7 + 5166779 commit 6c761a8
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,9 @@ fun createFormattingOptions(
kdoc: PsiComment,
alternate: Boolean
): KDocFormattingOptions {
var maxLineWidth = getLineWidth(file, kdoc)
var maxCommentWidth = getCommentWidth(file)

val configOptions = KDocFormattingOptions(maxLineWidth, min(maxCommentWidth, maxLineWidth))
val lineWidth = getLineWidth(file, kdoc)
val commentWidth = getCommentWidth(file)
val configOptions = KDocFormattingOptions(lineWidth, min(commentWidth, lineWidth))

val state = KDocPluginOptions.instance.globalState
with(configOptions) {
Expand All @@ -378,7 +377,7 @@ fun createFormattingOptions(
maxCommentWidth = state.overrideCommentWidth
}
if (!state.maxCommentWidthEnabled) {
maxCommentWidth = configOptions.maxLineWidth
maxCommentWidth = maxLineWidth
}
}
return configOptions
Expand Down

0 comments on commit 6c761a8

Please sign in to comment.