Fix max width handling
This commit is contained in:
parent
8bcf5c31fc
commit
4f5eedaa32
@ -205,9 +205,9 @@ func formatCompletions(completions []Completion, max int) (new []Completion, wid
|
|||||||
|
|
||||||
if diff := max - completionMargin - leftWidth - rightWidth; diff < 0 {
|
if diff := max - completionMargin - leftWidth - rightWidth; diff < 0 {
|
||||||
if rightWidth > diff {
|
if rightWidth > diff {
|
||||||
rightWidth -= diff
|
rightWidth += diff
|
||||||
} else if rightWidth+rightMargin > diff {
|
} else if rightWidth+rightMargin > -diff {
|
||||||
leftWidth += rightWidth + rightMargin - diff
|
leftWidth += rightWidth + rightMargin + diff
|
||||||
rightWidth = 0
|
rightWidth = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user