Download raw

diff --git a/src/dialogxml/widgets/message.cpp b/src/dialogxml/widgets/message.cpp
index 2005c35d..79533b72 100644
--- a/src/dialogxml/widgets/message.cpp
+++ b/src/dialogxml/widgets/message.cpp
@@ -207,10 +207,18 @@ void cTextMsg::draw(){
 			style.lineHeight = 12;
 			to_rect.left += 3;
 			win_draw_string(*inWindow,to_rect,lbl,eTextMode::LEFT_BOTTOM,style);
-		}else {
+		} else if(cache.empty()) {
 			style.lineHeight = textSize + 2;
 			to_rect.inset(4,4);
-			win_draw_string(*inWindow,to_rect,lbl,eTextMode::WRAP,style);
+			// Last argument is unused because second-last is empty, so just pass whatever
+			cache = draw_string_sel(*inWindow, to_rect, lbl, style, {}, draw_color);
+		} else for(const auto& line : cache) {
+			style.lineHeight = textSize + 2;
+			to_rect.top = line.at.y;
+			to_rect.left = line.at.x;
+			to_rect.bottom = frame.bottom - 4;
+			to_rect.right = frame.right - 4;
+			win_draw_string(*inWindow,to_rect,line.text,eTextMode::LEFT_TOP,style);
 		}
 	}
 }
diff --git a/src/dialogxml/widgets/message.hpp b/src/dialogxml/widgets/message.hpp
index 0d142b16..ec160b5d 100644
--- a/src/dialogxml/widgets/message.hpp
+++ b/src/dialogxml/widgets/message.hpp
@@ -21,6 +21,7 @@
 /// A simple static text message.
 /// This class can also create a frame for grouping controls or a clickable area.
 class cTextMsg : public cControl {
+	std::vector<snippet_t> cache;
 public:
 	std::string parse(ticpp::Element& who, std::string fname);
 	void setFormat(eFormat prop, short val) throw(xUnsupportedProp);