How to get word wrap to not split last word of each line?

For most of the time that I have been using Komodo IDE, it always did a good job of wrapping the words of any line that exceeded the maximum width of the Komodo window. At the end of each such line, whatever word does not have enough room to stay on that same line, would simply be wrapped to the next line, which would begin with that word. This typically would result in a few blank spaces at the end of the first line, but that was never a problem. As long as none of the words themselves were split, then everything was okay.

Sometime during the past few months, perhaps when I upgraded to version 12, Komodo is no longer keeping that “wrapped word” in one piece, but instead breaking it in order to fit the maximum number of non-blank characters on the first line, and then starting the second line with the leftover characters of that wrapped word. Please see the screenshot for an example. How can I stop Komodo from doing this? I have looked through the preferences and have not found any setting that appears applicable to this problem.

Morning @mjross,

That’s odd. The preference for this is in Edit menu > Preferences > Editor > Smart Editing: Word wrap lines by. Hopefully that fixes the issue.

Good morning, @careyh. Thanks for your reply. I should have mentioned in my previous post that upon noticing the problem, the first thing I did was to check those settings. “Wrap long lines by” was set to “Character”, which seemed odd to me because when I first installed Komodo and went through all of its settings, one of the first things I did was to change that to “Word”. But changing it back to “Word” this time, had no effect upon the text. But then, after reading your reply just now, I remembered that there are file-specific settings – something I sometimes forget because this is the first IDE I’ve worked with that has that feature. Sure enough, for that specific HTML file that I was looking at, the file-specific value was set to “Character”.

So here’s what I think happened: Ever since I started using Komodo, back with version 11, I had it set to “Word”, and thus every time I created a new file, that file inherited the general setting as part of its file-specific setting. However, either when I upgraded to version 12 or more recently when I used that darn State Tool and it appeared to wipe out my settings, at that point my general setting was switched back to “Character”, unbeknownst to me. Then, when I created this particular HTML file just a couple days ago, it inherited that (incorrect) setting.

So we can mark this particular question as answered. Thanks!

The file level prefs shouldn’t be set unless you manually set them. I wouldn’t think of prefs as being inherited. No exists for a file unless you opened the prefs dialog for that particular file, otherwise the prefs system looks up the tree to projects then global prefs.

BUT, that still works with your theory. The only note I’d make is that at some point, while the global pref was set to char, you had opened the prefs dialog for that particular file then when you closed/applied the changes it saved the word wrap pref too.

Thanks for the clarification regarding global and file-specific preferences.

As to the specific HTML file, the only time I looked at its specific preferences was today, when I remembered that they even existed and was curious as to what they were set to. I guess the bottom line is that, somehow, the global preferences for word wrap was changed to “Character”, which is not a change I would’ve ever made. The more I think about it, the more convinced I am that it happened when I upgraded to version 12, because I saw a couple other instances of wrapping on character, prior to doing anything with the State Tool, but was too busy (with travel and other stuff) to have time to look into it.

Anyway, thanks again for your insight and help!