• Login
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.
  • M
    Mario Valle
    last edited by Nov 9, 2020, 1:52 PM

    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

    P 1 Reply Last reply Nov 9, 2020, 2:20 PM Reply Quote 0
    • E
      Ekopalypse
      last edited by Nov 9, 2020, 2:18 PM

      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
      • P
        PeterJones @Mario Valle
        last edited by PeterJones Nov 9, 2020, 2:23 PM Nov 9, 2020, 2:20 PM

        @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
        1 out of 3
        • First post
          1/3
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors