Browse Source

Fix WordWrap dropping last character of closing tag

Resolves #26.
tablepad
Trevor Slocum 2 years ago
parent
commit
888dcd2560
  1. 3
      CHANGELOG
  2. 2
      util.go

3
CHANGELOG

@ -7,9 +7,10 @@ v1.5.1 (WIP)
- Add SetVisible and GetVisible to all widgets
- Add TextView.SetBytes, TextView.GetBytes and TextView.SetWrapWidth
- Add TableCell.SetBytes, TableCell.GetBytes and TableCell.GetText
- Fix List dividers allowing selection
- Fix List.Transform not calling handler set via SetChangedFunc
- Fix WordWrap bounds out of range
- Fix List dividers allowing selection
- Fix WordWrap dropping last character of closing tag
- Allow modification of scroll bar render text
- Allow scrolling List horizontally
- Clarify that Table rows must each have the same number of columns

2
util.go

@ -554,7 +554,7 @@ func WordWrap(text string, width int) (lines []string) {
}
// Is this a breakpoint?
if breakpointPos < len(breakpoints) && textPos+tagOffset == breakpoints[breakpointPos][0] {
if breakpointPos < len(breakpoints) && textPos+tagOffset == breakpoints[breakpointPos][0]+1 {
// Yes, it is. Set up breakpoint infos depending on its type.
lastBreakpoint = breakpoints[breakpointPos][0] + tagOffset
lastContinuation = breakpoints[breakpointPos][1] + tagOffset

Loading…
Cancel
Save