Is there any reason, why Notepad++ treats spaces as an average characters and thus pushes it to a new line, instead of "hiding" them at the end of line (when line-breaking mode is of course turned on)?


For over ten years, I've been using another editor, which editor engine is exactly (?) the same as in Notepad++ (Scintilla) and that editor was "hiding" extra spaces at the end of each line, causing each new line to start with a character and never with a spaces.

Notepad for Windows

Word, WordPad, Win Notepad and virtually every other text editor, that I know, does exactly the same. But since they all don't use Scintilla they're out of topic.

Only Notepad++ is a kind (an irritating) exception. I would say, that it is Scintilla's problem, if not for the fact, that for past ten years I've been using another Scintilla-based editor and it "hasn't got that problem".

Is there any way to turn off this... feature?

  • It’s hard to tell from the limited examples you’ve provided, but this doesn’t look like it has anything to do with “pushing space characters to the beginning of the next line”, but of displaying lines right-justified instead of the default (in left-to-right languages) left-justified. – Scott Dec 3 '13 at 21:58

This behavior depends on what setting in the "Language" menu is selected. I don't usually see this behavior in the language modes I use, such as "Normal text". I can observe this behavior with some language modes, such as "Caml". You can create your own mode, or modify the behavior of a supplied mode by selecting it and then adjusting the line wrap setting under Preferences.

  • You're partially right. It seems, that some languages has this "feature" and other doesn't. I can observe this in CSS, Markdown, Javascript, Pascal, Resource, Shell and SQL at my side. So it isn't that rare. But, as I wrote in comment to Ryan, Line Wrap setting in Settings > Preferences > Editing has nothing to do with this. I've switched it to Default and mentioned languages still displays spaces in the beginning. Do you know, which setting is responsible for that, and where to look for it? – trejder Dec 3 '13 at 22:13

I don't seem to have this issue myself with Notepad++.

It looks like you can modify the Line Wrap settings by going to Settings > Preferences > Editing. The section you are looking for is called Line Wrap. You can change the radio buttons and watch the word wrap change live based on the setting you choose.

I hope this helps.

  • Sorry, I was to fast to call-up glorious solution. Neither Line Wrap nor Folder Margin Style are responsible for this behavior. – trejder Dec 3 '13 at 22:07

if you want get a space in the begining of a line in word document, go to word options > advanced> compitability options>layout options>check wrap trailing spaces to next line. your problem is solved. you will get a space begining of each line.

  • WHAT are you talking about? Did you read the question at all and do you understand its meaning? I am talking about removing unnecessary spaces, not adding them. And I am talking about Notepad++ where you must be talking about Word. – trejder Jul 29 '19 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.