Community
    • 登入

    Indent & unindent problem while replace tab with spaces

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

      When I use default tab for indent/unindent functions, it seems like the shortcuts ‘tab’ and ‘shift + tab’ works perfectly.

      But when I try to use different tab settings (use 4 spaces replace 1 tab), the shortcut ‘tab’ still works well, but the ‘shift + tab’ is not working.

      When I try to input ‘shift + tab’, only the input icon go back 4 spaces, and the 4 space characters still exist.

      Is there any fix about this problem?

      Claudia FrankC 1 條回覆 最後回覆 回覆 引用 0
      • Claudia FrankC
        Claudia Frank @饒彥章
        最後由 編輯

        @饒彥章

        afaik this only happens if at least one char is in front of the “tab/spaces”.
        So, if you have (the dot represents the space)

        foo....bar
        

        the cursor is in front of bar and you press shift+tab, only the cursor
        jumps back but the spaces do not get deleted.
        But if you have only

        ....bar
        

        then the spaces do get deleted.

        If this is the case on your side as well, then this isn’t a bug or problem
        as it is how SCI_BACKTAB, the underlying message used, works.

        Cheers
        Claudia

        1 條回覆 最後回覆 回覆 引用 1
        • 饒彥章饒
          饒彥章
          最後由 編輯

          Hi Claudia,

          Thanks for reply, it is just the case on my side!
          So here’s another question, how can I change the setting if I need the “shift+tab” function works when there is at least one char in front of the “tab/spaces”?
          Is it possible for Notepad++?

          Claudia FrankC 1 條回覆 最後回覆 回覆 引用 0
          • Claudia FrankC
            Claudia Frank @饒彥章
            最後由 編輯

            @饒彥章

            there is no setting to change the behavior of SCI_BACKTAB you need to change the code.
            Whether there is another solution depends on what exactly you try to achieve.

            Cheers
            Claudia

            1 條回覆 最後回覆 回覆 引用 0
            • 第一個貼文
              最後的貼文
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors