| 57 | | ui_msg \n$portnotes\n |
| | 57 | # If env(COLUMNS) exists, limit each line's width to this width. |
| | 58 | if {[info exists env(COLUMNS)]} { |
| | 59 | set maxlen $env(COLUMNS) |
| | 60 | |
| | 61 | ui_msg "" |
| | 62 | foreach line [split $portnotes "\n"] { |
| | 63 | set joiner "" |
| | 64 | set lines "" |
| | 65 | set newline "" |
| | 66 | |
| | 67 | foreach word [split $line " "] { |
| | 68 | if {[string length $newline] + [string length $word] >= $maxlen} { |
| | 69 | lappend lines $newline |
| | 70 | set newline "" |
| | 71 | set joiner "" |
| | 72 | } |
| | 73 | append newline $joiner $word |
| | 74 | set joiner " " |
| | 75 | } |
| | 76 | if {$newline ne {}} { |
| | 77 | lappend lines $newline |
| | 78 | } |
| | 79 | ui_msg [join $lines "\n"] |
| | 80 | } |
| | 81 | ui_msg "" |
| | 82 | } else { |
| | 83 | ui_msg \n$portnotes\n |
| | 84 | } |