Community
    • Login

    How to set tab size for user defined language?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    bibtexudl tabsize
    3 Posts 3 Posters 1.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.
    • Mario ValleM
      Mario Valle
      last edited by

      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 Reply Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse
        last edited by

        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 Reply Last reply Reply Quote 2
        • PeterJonesP
          PeterJones @Mario Valle
          last edited by 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 Reply Last reply Reply Quote 3
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors