Need to set tab STOPS, not spacing.
-
@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):…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. :-)