Detached lines in Notepad++
The default text style in Notepad++ v6.6 and its past versions (as far as I remember) adds an inconspicuous amount of white space between each line, preventing the block characters in each line to connect to the ones on the top or bottom. This problem also appears with two of the other themes, namely “Hello Kitty” and “Viberant Ink” but not in any other theme.
I normally wouldn’t care for a slight amount of space as I am not a consumer of ASCII art and don’t use table characters in my source codes either. But as with any other curious human, I wanted to know why, just out of curiousity and not because of practical need. So, I set out to investigate.
Notepad++ is an advanced plain text and source code editor. One of its features is syntax highlighting; when the user is editing a source code, written in one of the programming/scripting/markup languages that it knows of, it automatically shows keywords, variables, values, parameters and comments in different colors, sizes, font weights, font styles or typefaces. For example, it is possible to display known keywords in bold black 10pt font and braces in red 12pt font. (“Points” or “pt” for short is a measure of font size, equal to 1/72 inches.)
So, in the example above, what happens if both known keywords and braces are in one line? Naturally, Notepad++ must adjust the line height to accomodate a 12pt font. But what if there is only a keyword in one line (whose character sizes are 10pt)? What if the line is entirely blank?
The answer is: The line would still be 12pt tall. Notepad++ uses a fixed line height equal to the tallest character that can be on that line. How did I discover this? Well, I started comparing height-related elements between “Ruby Blue” and “Default” theme and discovered that “Default” has set the font size to 12pt for “Brace highlight style” while “Ruby Blue” has not set a font size for this value.
- Open Notepad++
- Open “Settings” menu and click on “Style Configurator…”
- At the top of the dialog box, select the theme that you’d like to fix from “Select theme” drop-down box. (“Default”, “Hello Kitty” or “Viberant Ink”.)
- In the leftmost list, titled “Language”, make sure “Global Styles” is selected.
- From the list to its immediate right, titled “Style”, select “Brace highlight style”.
- From the right side of the dialog box, open the “Font size” drop-down box and clear the font size. (Select the first item on the list, which is empty.)
- Press “Save & Close” button.
Repeat these steps for other themes if you wish.
In the Style Configurator dialog box, you can specifiy which programming language is associated with which filename extension. By default, “XML” language is associated with
wsdl extensions. But if you like, you can add
svg to the list too. SVG files are written in XML language.