Community
    • Login

    Need to set tab STOPS, not spacing.

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    22 Posts 9 Posters 2.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.
    • Lycan ThropeL
      Lycan Thrope @Coises
      last edited by Lycan Thrope

      @Coises said in Need to set tab STOPS, not spacing.:

      If what you want is for the tab key to insert a number of spaces, depending on the position of the cursor and following a simple rule, I suggest creating a script that implements that rule, then using the Shortcut mapper to remove the Tab key from SCI_TAB and assign it to your script. (You could even make the script smart enough to position the cursor at the next column if there is already text there, and only insert space when it’s at the end of a line.)

      If someone wanted to write a plugin, it could include the ability to specify the exact tabstops for different file types and activate based on the file extension and/or the language. I don’t know if that degree of complexity is practical in a script.

      If I knew what I was doing and was more familiar with the editor and the Scintilla messages, etc, I would probably start with the existing feature Settings->Preferences...->Margins/Border/Edge->Vertical Edge Settings and depending on where the cursor is, hitting tab would take it to the next set Vertical Edge. Since those are set apparently by column number, however NPP calculates that to be, it would seem the logical place to look to use as reference for where to tab to. For instance, I try to keep my text to 80 columns (as in this screenshot):

      ATabSolutionPossibly.PNG

      …so it doesn’t extend beyond the dBASE editor’s windows boundaries so I don’t have to scroll back and forth reading code in that Editor.

      Just a thought, if I was a more capable NPP plugin or Python coder. :-)

      1 Reply Last reply Reply Quote 4
      • Alan KilbornA
        Alan Kilborn @Coises
        last edited by

        @Coises said :

        If what you want is for the tab key to insert a number of spaces,

        I guess we’re still unsure of what the posters that showed interest really want…

        include the ability to specify the exact tabstops for different file types and activate based on the file extension and/or the language. I don’t know if that degree of complexity is practical in a script.

        It’s certainly not a problem to script something like that.

        1 Reply Last reply Reply Quote 1
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors