Why doesn't the column position change when I make changes?

  • A Tab (’\t’) is set to be equal to 4 spaces.

    include("<--Col is 13 for double quote position with a Tab ('\t') before the word 'include'
    include("<--Col is still 13 with a space before the \t
    include("<--Col is still 13 with 2 spaces before the \t

    12 include("<–Col is still 13 for the double quote with ‘12’ before the \t
    include("<–Col is 13 for the double quote with 4 spaces before the word ‘include’
    include("<–Col is 14 for the double quote with 5 spaces before the word ‘include’ <== Expected

    What is the problem?

    Jesus’ Love

  • Hello @Roger-Sealy,

    the tab gets aligned with your tab/space configuration.
    Let’s assume you write the following text (the hyphen is used to illustrate the spaces in between)


    If you want to add a tab in front of the text and instead of the space(hyphen) then it would look like


    The four spaces in front of Good is expected, as you’ve put in a tab.
    The four spaces between Good and morning are also expected.
    One space between morning and everybody isn’t expected, right?
    Well if we think about how it is done than it might be clear.
    A tab “stop” is after every 4 chars, so at position 5, 9, 13, …
    G is on 5 - good
    m is on 9 - good
    e is on 21 - good, but not expected if you think it will always put 4 spaces in, which it doesn’t.

    I hope I could clarify it a bit.


  • Hi Claudia:

    I don’t think you understand what I am getting at. If you have this line of text:
    \tX marks the spot.”, where ‘\t’ is a Tab and ‘X’ is shown to be at Col 5 in Notepad++

    Check what Npp tells you for the position of ‘X’, after you type 12 in front of the line? i.e.
    12\tX marks the spot.

    Mine tells me 'X" is still at Col 5, which to me should not be.

  • Hello Roger,

    I thought and still assume that I do understand your issue but I might be wrong.

    From your given example I assume that you assume X should be at Col 7, correct?
    12\tX -> which should be
    1-> Col1

    But this isn’t the case as the tab aligns to the next “tab stop” (I’m not sure if this is the correct wording->MS word uses it as well)
    As your configuration is four spaces per tab the chars which get displayed are at Col (multiple of 4)+1.
    So yes, it is expected that X is on 5 as it is like
    1-> Col1
    \t->Col3-4 (because 4 is the next tab stop)

    Am I still on the wrong way?


  • @Claudia, I’m with you - sounds like the correct answer. And the only way to get around it, I think, is to convert tabs to spaces (which can be done automatically).


  • Hi Davey,

    I don’t think this is working.
    Neither having it initially set
    Settings->Preferences->Tab Settings->Replace by space
    nor by using menu operation
    Edit->Blank Operations->Tab to space
    do result in different behavior.

    Or did you find another way to solve this?

    The only way I can think of is using 4 spaces but NOT using the tab key.


  • Hi Claudia, you’re right - it doesn’t work
    I should have wrote ‘not tested’! :)
    Thanks for clarifying that

    By the way, you do an amazing job here! And your knowledge of n++ is really amazing.
    Great to see and a big thanks to you!


  • Hi Claudia:

    I understand you now when you talk about ‘Tab Stops’. I think though that there should be an option in the preferences to enable and disable this feature.

    Where would I have to go to in order to make this suggestion/request.


  • Hello Roger,

    albeit the underlying scintilla control defines the functionality,
    I assume the concrete implementation needs to be done by notepad++.
    So I guess you need to address it here.

    Davey, thanks for the kind words and if I could be more concentrated, it
    would be even more helpful/useful to others.


Log in to reply