Community
    • 登入

    How to set tab size for user defined language?

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

      I have a user defined language for BiBTeX.

      I want to set tab size equal 2 but where can it be set?

      Under Settings > Preference > Language the Tab Settings list does not list bibtex (or bib).

      Thanks for your help!
      mario

      PeterJonesP 1 條回覆 最後回覆 回覆 引用 0
      • EkopalypseE
        Ekopalypse
        最後由 編輯

        Afaik you can’t define it per UDL with npp builtin functionality.
        One workaround might be to set it as default and reconfigure it
        for builtin languages. Obviously works only if this UDL is the only one.
        Another option would be to use some “scripting” language if you want
        to go that way.

        1 條回覆 最後回覆 回覆 引用 2
        • PeterJonesP
          PeterJones @Mario Valle
          最後由 PeterJones 編輯

          @Mario-Valle ,

          As far as I know, there isn’t a native way in Notepad++ to change the tab setting on a per-UDL basis.

          That would be nice, and in theory, you could put in a feature request. Unfortunately, the UDL system doesn’t often get bug fixes, let alone feature requests.

          However, there may be a workaround; the underlying Scintilla library has a SCI_SETTABWIDTH message, which you can access through a variety of means, including the PythonScript plugin (editor.setTabWidth(2) will change it to two spaces per tab). With some logic, you could write a PythonScript that determines whether the active editor is editing a BiBTeX-UDL-based file, and if so, run that PythonScript setting. If you have PythonScript, or are willing to install it, someone here should be able to give you pointers on how to implement that logic.

          <edit> You might also need to change SCI_SETTABINDENTS, depending on your Settings > Preferences > Language > Tab Settings > [Default] settings </edit>

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