I have a document open in Notepad++, and for some reason the horizontal scrollbar is tiny. It looks like the width of the text area is over 7000 characters. The document does have a (single) long line, about 1000 characters long, but it's of course much smaller than the area reserved for it.

Is there a way to reset the horizontal size in Notepad++? It's a pain to scroll with a bar so small, especially since the used area is only 10-20% of the total.

  • 2
    Why not enable wordwrap? From the toolbar, the 7th group, 1st icon. – LPChip Jul 7 '16 at 21:05
  • or by menu: view->word wrap – Putnik Jul 8 '16 at 15:35
  • @Putnik: I don't want to wrap, just to get the width right. – Charles Jul 8 '16 at 15:36
  • @LPChip: I don't want to wrap -- I want the long lines to stay long. I'd just like the width to be (about) the same as the width of the longest line, not 5-10 times larger. – Charles Jul 8 '16 at 15:36
  • 1
    @Charles then you found a bug :) report it! – Putnik Jul 8 '16 at 20:01

This is not possible.

Notepad++ uses the Scintilla editor component which doesn't provide this feature. Yes, it will increase the horizontal scroll range but it won't reduce it.

Here's the relevant part from the documentation (emphasis mine):

If scroll width tracking is enabled then the scroll width is adjusted to ensure that all of the lines currently displayed can be completely scrolled. This mode never adjusts the scroll width to be narrower.

Scintilla developer Neil Hodgson has repeatedly said that this feature will not be implemented due to the performance cost of dynamically determining the current widest line.

If your longest line is about 1000 characters but your scrolling range is greater, you can always close and re-open the file to reset the range to your longest line.

| improve this answer | |

There's no way to have it reset automatically, but it is possible to manually reset it. Based on a response to this reported issue, you can use a scripting plugin to modify the scintilla horizontal scroll width. I was able to get it to work using the Python Script plugin with the following 1 line script:


If the scroll bar needs to be longer, you will see it shrink too much then the horizontal scroll tracking will immediately expand to the necessary width.

| improve this answer | |

An easy solution if this only bothers you sometimes and you don't want to deal with installing a scripting plugin is to just close and re-open the file in Notepad++.

This resets the horizontal scrollbar to the proper width.

| improve this answer | |

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.