• Login
Community
  • Login

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

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
9 Posts 3 Posters 4.8k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R
    Roger Sealy
    last edited by Apr 8, 2016, 10:04 PM

    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
    Cog08

    C 1 Reply Last reply Apr 9, 2016, 1:13 AM Reply Quote 0
    • C
      Claudia Frank @Roger Sealy
      last edited by Apr 9, 2016, 1:13 AM

      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)

      Good-morning-everybody
      

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

      ----Good----morning-everybody
      

      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.

      Cheers
      Claudia

      1 Reply Last reply Reply Quote 0
      • R
        Roger Sealy
        last edited by Apr 11, 2016, 4:04 PM

        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.

        1 Reply Last reply Reply Quote 0
        • C
          Claudia Frank
          last edited by Apr 11, 2016, 4:16 PM

          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
          2->Col2
          \t->Col3-6
          X->Col7

          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
          2->Col2
          \t->Col3-4 (because 4 is the next tab stop)
          X->Col5

          Am I still on the wrong way?

          Cheers
          Claudia

          1 Reply Last reply Reply Quote 0
          • D
            DaveyD
            last edited by Apr 11, 2016, 6:14 PM

            @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).

            Regards,
            Davey

            1 Reply Last reply Reply Quote 0
            • C
              Claudia Frank
              last edited by Claudia Frank Apr 11, 2016, 9:38 PM Apr 11, 2016, 9:37 PM

              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.

              Cheers
              Claudia

              1 Reply Last reply Reply Quote 0
              • D
                DaveyD
                last edited by Apr 13, 2016, 3:20 AM

                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!

                Regards,
                Davey

                1 Reply Last reply Reply Quote 0
                • R
                  Roger Sealy
                  last edited by Apr 13, 2016, 2:43 PM

                  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.

                  Thanks
                  Roger

                  C 1 Reply Last reply Apr 13, 2016, 7:40 PM Reply Quote 0
                  • C
                    Claudia Frank @Roger Sealy
                    last edited by Apr 13, 2016, 7:40 PM

                    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.

                    Cheers
                    Claudia

                    1 Reply Last reply Reply Quote 0
                    9 out of 9
                    • First post
                      9/9
                      Last post
                    The Community of users of the Notepad++ text editor.
                    Powered by NodeBB | Contributors