Help save net neutrality! Learn more.

unwanted line space (newbie)

  • brynn

    brynn - 2014-06-29

    Hi Friends,
    I am not someone who writes code very often. I made a simple HTML webpage with Notepad++, which I keep updated. And occassionally I need to edit code in other files (for my website). So I'm a super newbie, compared to you all. And there's likely a simple answer to this question.

    Ok, I'm using version 6.5, which undoubtedly could be updated. But without knowing if this problem is a bug, I don't know if updating will solve it. And I'm on Win7, 64-bit.

    The problem is that sometimes when I use the Tab key, to indent a line, it inserts an extra line space, along with the indent. Sort of like a double-space + indent. It's not consistent, afaict. I don't see anything similar among the many instances. Sometimes it happens and sometimes it doesn't.

    Do you need to see an example? I don't see any way to attach a file or image here. But I could give you a link to an image, if it would be helpful.

    I've looked through Preferences, and experimented with some settings that sound like they might affect the indent. But none of them fixed the problem.

    OH!! I just realized this! It only happens when I try to indent lines that have been wrapped. Maybe that will make it even easier for you to find a solution!

    Ok, lmk if you need any more info. And thank you very much!

    All best,

    PS - more info
    If I maximize the window, the extra line space disappears. When I un-maximize it (restore down), the space reappears.

    Now knowing that, I'm guessing there will be no solution. But if there is, I'd be happy to know about it :-) TA

    But an extra line space isn't added when indenting ALL wrapped lines. It looks like it's only happening in the <style></style> section of the CSS part of my HTML file. Later down in the html section, there doesn't seem to be a problem. (I forget the name of it, but this is the kind where CSS is in the same file as the HTML. Not in a separate file.) TA

    Last edit: brynn 2014-06-29
  • Zen

    Zen - 2014-06-30

    perhaps you have alot of whitespace that is wrapping?

  • Andreas Jonsson

    Andreas Jonsson - 2014-06-30

    N++ can indent either

    1) solely using spaces, or
    2) using a combination of tabs and spaces.

    It does not have a mode which indents solely using tabs (this is probably the reason why the check box in Settings -> Tab settings is called "Replace by space", and not "Replace by tabs" which I personally would've found more intuitive).

    The reason N++ doesn't have such a mode is because Scintilla (the editor component used by N++) doesn't have it. I looked at the indenting code in Scintilla and it's easy to see that it is possible for it to indent using tabs + spaces in certain situations, but I can't say exactly when it happens.

    "SCI_SETUSETABS determines whether indentation should be created out of a mixture of tabs and spaces or be based purely on spaces."

  • Thomas

    Thomas - 2014-06-30

    Moin, moin,

    Because you said that the white space will disappear when maximizing the windows I guess it is shown because of your indention settings.

    When you look at the attached screen shot you can see that line 2 is too long to fit in a single line. Therefore it is split - you can recognize this because the second part of line 2 doesn’t have a line number (area marked red). The behavior of wrapped lines can be configured (area marked green).

    Line wrapping can be switch on or off by the appropriate entry of the view menu (second screen shot - marked pink).


  • brynn

    brynn - 2014-07-01

    Thanks for all your comments.

    I didn't understand much of Andreas Jonsson's comments, which may be directed more towards regular members/devs.

    Thomas, I tried changing the settings that you showed in the green box. None of those setting would get rid of the extra line space when window is restored down. I didn't change the wrap setting, because I want the lines to wrap. (Although I'll be glad to try it, if it would be of interest for troubleshooting, for you.)

    Here I made a screenshot, which I'll try to attach. You can see in the first red box where I indented line 8, and it gets a whole blank line + the indent. If I maximize the window, that blank line disappears.

    And you can see in the 2nd red box, where I indented line 19, and it gets a whole blank line + indent. And then you can see in the black box, where any line that isn't wrapped, is indented as expected.

    Now, that is all in the style part of the CSS part of the file. In the 2nd screenshot, which is further down in the same file, you can see where there is no problem with indenting wrapped lines.

    At first I was thinking that this indenting behavior was related to whatever kind of code I had typed. It seems like that, because the problem is in the CSS part, and not in the HTML part. But I don't really know.

    All indenting in this file is done with the Tab key. Let me try spacing instead of TAb..... Ok, the same thing happens with a space. I get a whole blank line + space, or + however many spaces I put.

    Let me know if I can provide any further info. And especially if you know how to solve this problem. I guess I will try upgrading anyway, just hoping it will help. What is the current stable version now?

    Thanks again :-)

    PS - I can attach 1 file, but it's not clear how to attach a 2nd. Maybe after I post I will see how to do it. Or else I'll just post another comment with the 2nd image.

  • brynn

    brynn - 2014-07-01

    Yeah, sorry, I just don't see how to do it. Here's the 2nd screenshot.

  • Thomas

    Thomas - 2014-07-01

    Moin, moin,

    How to attach more than one file from a single directory to your post: Navigate to the directory and hold down the CTRL key while clicking the files you want to attach.

    I think you have found a bug: The empty line is inserted, because there in no space (or TAB) character in the beginning of the line. It can be reproduced by some text without white space (more characters than fitting on a single line). If you then insert white space in the beginning of the line an empty line will be inserted. In the attached screen shot this behavior can be seen in line two and line four. In the lines five and six everything looks OK because there are some white space characters after the first character.

    Unfortunately this behavior already exist in SciTE (I tested version 3.4.1).


  • brynn

    brynn - 2014-07-01

    Ooohh, I see. It's because the lines that wrap have no spaces in them. They are long, long string of code, with no spaces. (I guess being such a newbie with css/html, I don't write the code in the kind of format that most people do. I guess it's why no one found it before now, lol.) (Or maybe most people use it in maximized window?)

    When you say "Unfortunately this behavior already exist in SciTE (I tested version 3.4.1)." do you mean that the bug exists in the current version of Notepad++ (whatever it is)?

    Can you take care of reporting the bug for me? Because I don't expect I'll be participating in this project, in the future, unless I stumble on another problem someday. But it's really quite unlikely.

    Thank you very much for all your help :-)

  • Thomas

    Thomas - 2014-07-02

    Moin, moin,

    I am reffering to SciTE because it also uses the editor component Scintilla like Notepad++ does. I assume that this bug is related to Scintilla.


  • brynn

    brynn - 2014-07-05

    Ok, thanks :-)