mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Return arrays with line indices from WrapViewLinesToWidth
This makes it easy to convert an original line index to a wrapped line index, or vice versa.
This commit is contained in:
@ -57,7 +57,7 @@ func (self *ConfirmationHelper) DeactivateConfirmationPrompt() {
|
||||
}
|
||||
|
||||
func getMessageHeight(wrap bool, message string, width int) int {
|
||||
wrappedLines := utils.WrapViewLinesToWidth(wrap, message, width)
|
||||
wrappedLines, _, _ := utils.WrapViewLinesToWidth(wrap, message, width)
|
||||
return len(wrappedLines)
|
||||
}
|
||||
|
||||
@ -276,7 +276,7 @@ func (self *ConfirmationHelper) layoutMenuPrompt(contentWidth int) int {
|
||||
var promptLines []string
|
||||
prompt := self.c.Contexts().Menu.GetPrompt()
|
||||
if len(prompt) > 0 {
|
||||
promptLines = utils.WrapViewLinesToWidth(true, prompt, contentWidth)
|
||||
promptLines, _, _ = utils.WrapViewLinesToWidth(true, prompt, contentWidth)
|
||||
promptLines = append(promptLines, "")
|
||||
}
|
||||
self.c.Contexts().Menu.SetPromptLines(promptLines)
|
||||
|
Reference in New Issue
Block a user