[Solved] WordWrap on TMemo not working on Linux lazarus / 32-Linux ---------------------------------------------------------------------- Tim S · 2025-09-27 03:34 This 'should' be a simple problem to fix I just cannot find a solution. I'm using version 4.2 of Lazarus on Ubuntu but have tried in the past with earlier versions of Lazarus; and Ubuntu and other flavors of Linux. I've also tried on Windows and it just works there. I've tried changing things like scrollbars with no joy. I've messed around with crlf (#13#10) but that shouldn't be part of the problem. The line that gets wordwrapped doesn't have crlf's in it after the word wrapping. Any help or suggestions would be greatly appreciated! ---------------------------------------------------------------------- Hartmut · 2025-09-27 07:52 Welcome to the Forum! I use TMemo.WordWrap on Ubuntu 18.04 .. 24.04 without problems with different Lazarus versions up to 3.4.0. You should always give us more details when you have problems. Quote from: Tim S on September 27, 2025, 05:34:17 amI've tried changing things like scrollbars with no joy. How is this related to your WordWrap problem? QuoteThe line that gets wordwrapped doesn't have crlf's in it after the word wrapping. Does this mean: you get a wordwrap where you don't expect one? Please show us the source code of this line and a screenshot of your Memo. The best would be to see your whole code or - more better - to provide a compilable project for us. But at least please show us the complete configuration of your Memo. Either it's source code or it's *.lfm file. ---------------------------------------------------------------------- Tim S · 2025-09-28 03:16 Thanks  for the response Hartmut, and for the welcome :-) I'll try to explain myself again. I seem to have failed the first time. My apologies! . I create a project with a Form. . I place a memo on the form. (No changes to the default ... WordWrap = True in the Object Inspector) . I run the project. When the project is running I type in the memo. Wordwrap has no effect. Following is the contents of .lfm file. object Form1: TForm1   Left = 314   Height = 229   Top = 177   Width = 313   Caption = 'Form1'   ClientHeight = 229   ClientWidth = 313   LCLVersion = '4.2.0.0'   object Memo1: TMemo     Left = 56     Height = 98     Top = 64     Width = 208     Lines.Strings = (       'Memo1'     )     TabOrder = 0     OnChange = Memo1Change   end end . I have upload the  whole project and two .jpg files: . The first .jpg (MemoTest1.jpg) j shows text added just prior to the point that I would Wordwrap to take effect. . The second .jpg (MemoTest2.jpg) shows after three more characters are added. They keep getting added to the and of the line and the beginning of the line goes out of view. Wodwrap does not take effect (I compared the same project created from scratch on Windows and the .lpm file is identical.) .    If I turn WodWarp = False the following line is added to the .lfm file          WordWrap = False .    If I manually edit the .lfm file to change Wordwrap = True it has no effect ---------------------------------------------------------------------- Thaddy · 2025-09-28 08:16 Never edit the lfm file manually. It can be done, but only if you really know what you are doing (expert). Consider the lfm read-only and change the properties through the object inspector or in code. Beginners should NOT touch the lfm. ---------------------------------------------------------------------- Martin_fr · 2025-09-28 08:55 My first question would have been: gtk2? gtk3? qt5? qt6? .... But, looking at your image, the text you typed has no spaces, it consists of ONE very long word. With that, I do get the same (non wrap) behaviour (gtk2). But as soon as I put in spaces it will wrap at the spaces. I don't know if that is indented. I haven't tested on Windows or other OS, or WidgetSets. So I can't tell if it should or should not break the ONE very long word. Can you confirm, that the issue is indeed affecting "single very long words"? Or does it also fail for you, if you have spaces in the text (and no single word is longer than the available widths)? ---------------------------------------------------------------------- Hartmut · 2025-09-28 17:02 I ran your project on Ubuntu 24.04 with Lazarus 3.4.0 / FPC 3.2.2 and everything works as it should. The default for TMemo.WordWrap is True. When I type in a couple of words - separated by blanks - as soon as a line is full, the next word is broken to a new line. But if I type in words, which are longer than the line, they are *not* broken and you need to scroll horizontally. Because WordWrap, as the name says, breaks only at word boundaries. This all is the correct behavior. If I change TMemo.WordWrap to be False, no wordwrap occurs. If I type in more characters, than the line is long, there is no wordwrap, even if there are blanks and I need to scroll horizontally. But I can force a new line by pressing ENTER. This also is a correct behavior. If you want you can configure automatic scrollbars. Do you have another behavior? If yes, please describe it detailed that we can halp you. ---------------------------------------------------------------------- Tim S · 2025-09-29 03:52 Thanks for all the replies. I fell like a bit of a goose. It does indeed wrap on smaller words! I was fooled perhaps by the behavior on windows which does wrap the long line with no spaces. ---------------------------------------------------------------------- Hartmut · 2025-09-29 10:01 Don't worry, we all sometimes happen to enter a wrong path... Especially a couple of differences in the behavior of Controls between Windows an Linux can make our life complicated. If your question is now solved, it would be kind to mark your Topic accordingly. Most users do this by modifying their 1st post (you must login before) and place a [SOLVED] at the beginning of the subject. Have fun with FPC / Lazarus ;-) ---------------------------------------------------------------------- Martin_fr · 2025-09-29 11:45 I don't know about "its intended to to words only". If on Windows it does force mid-word wrapping... Well, then it depends. 1) Is it on Windows handled by the OS or the LCL ? (need to be checked in the code) 2) Is it on Linux (and others / actually Gtk or QT, Cocoa) handled by the OS or LCL E.g. it may be handled by OS/WS code, but some may not support it, and then LCL my emulate it. If in any case it is emulated by the LCL, and if in that case it does not do as observed on Windows, then maybe that case should be improved.... But that is a lot of "if"s. Btw, other edits with word wrap do exist, depending what you need. I should guess that AtSynEdit supports it (with forced mid word wrap, but I don't know). And TSynEdit does, but only in 4.99, and you need to create the plugin in code.... (and docs are still missing) ---------------------------------------------------------------------- Zvoni · 2025-09-29 12:11 What he's probably looking for is this "LineBreak" (or whatever it's called - german Windows here) we know from NotePad on Windows (NOT NOtepad++!!) Usually found in Menu "Format" ---------------------------------------------------------------------- myisjwj · 2025-10-22 12:47 Try setting scrollbars:=ssautoboth