Community
    • 登入

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

    已排程 已置頂 已鎖定 已移動 Help wanted · · · – – – · · ·
    9 貼文 3 Posters 5.0k 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • Roger SealyR
      Roger Sealy
      最後由 編輯

      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

      Claudia FrankC 1 條回覆 最後回覆 回覆 引用 0
      • Claudia FrankC
        Claudia Frank @Roger Sealy
        最後由 編輯

        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 條回覆 最後回覆 回覆 引用 0
        • Roger SealyR
          Roger Sealy
          最後由 編輯

          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 條回覆 最後回覆 回覆 引用 0
          • Claudia FrankC
            Claudia Frank
            最後由 編輯

            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 條回覆 最後回覆 回覆 引用 0
            • DaveyDD
              DaveyD
              最後由 編輯

              @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 條回覆 最後回覆 回覆 引用 0
              • Claudia FrankC
                Claudia Frank
                最後由 Claudia Frank 編輯

                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 條回覆 最後回覆 回覆 引用 0
                • DaveyDD
                  DaveyD
                  最後由 編輯

                  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 條回覆 最後回覆 回覆 引用 0
                  • Roger SealyR
                    Roger Sealy
                    最後由 編輯

                    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

                    Claudia FrankC 1 條回覆 最後回覆 回覆 引用 0
                    • Claudia FrankC
                      Claudia Frank @Roger Sealy
                      最後由 編輯

                      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 條回覆 最後回覆 回覆 引用 0
                      • 第一個貼文
                        最後的貼文
                      The Community of users of the Notepad++ text editor.
                      Powered by NodeBB | Contributors