Need to set tab STOPS, not spacing.



  • The “Tab Settings” feature only allows specifying a fixed distance between tab stops. This is not very useful. What is needed is the ability to set custom tab stops for various programming languages.
    Cobol: 1, 7,12,16,20,24,28,32,36,40,44,48,52,56,60,73
    Assembler: 1,11,18,40,79



  • So you are looking for something like this
    b159be9d-e5e1-4fca-97f6-334190e7995a-image.png

    Does only work with fixed-spaced font, doesn’t it?
    From short testing it seems that it must be assigned to each line
    and reapplied if buffer get reactivated.
    To summarize, I think, more or less, this can be achieved by using
    a scripting language plugin.



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

    So you are looking for something like this

    I don’t think so. I think the OP is looking for the same (inconsistent width) tab stops on every line of a file, but different for different file types.

    So, every line of an .asm file would have tabstops at 1,11,18,40,79, for example.



  • @Alan-Kilborn

    This was just an example to show how it might look like
    but I understand that for cobol one layout and for asm the other layout should be done. Just unsure what else needs to be checked.
    Haven’t done anything in this area yet.

    Edit: btw - I’ve pinged back :-)



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

    but I understand

    Okay, from your screenshot it seemed apparent that you DIDN’T understand. But now I DO think you understand. :-)

    BTW, ping echo received…next packet being formulated. :-)



  • @Ekopalypse

    1. Yes, I am looking for something like what you’ve pictured
    2. Yes, it would only be used with fixed-spaced fonts. Why would anyone need or want a proportional font with program source code?
    3. Short testing? Assigned to each line? Reapplied if buffer get(s) reactivated? Please explain. Have you actually done this, tested it, etc.?
    4. If it can be achieved with a scripting language plugin, does such a plugin exist? If not, where are the specifications for writing such a plugin?


  • @Carl-D-Goldin

    Yes, it would only be used with fixed-spaced fonts. Why would anyone need or want a proportional font with program source code?

    No idea, but who knows :-)

    Short testing? Assigned to each line? Reapplied if buffer get(s) reactivated? Please explain. Have you actually done this, tested it, etc.?

    If it can be achieved with a scripting language plugin, does such a plugin exist? If not, where are the specifications for writing such a plugin?

    Scintilla, the underlying control npp uses, provides functions which seem to do what you try to achieve.
    I used PythonScript to give it a quick test to see if it is possible at all and it looks like it is. (tabs in my screenshot were created by using PythonScript)

    To my knowledge there are currently a python, lua, javascript and an activex (not sure if this still works)
    scripting plugins available which can be used to manipulate scintilla/notepad++.

    But a dedicated plugin doing the same can be developed as well.

    What I’ve found out, what needs to be done so far is the following

    1. determine the pixel size of the current used font
    2. on_buffer_activated callback (is called on open doc or when switching from another doc) apply the tabstops to every line of code
    3. on_update_ui (is called whenever something change in the current document) do the same or find a clever algo to identify the changed/new lines

    I can try to create a pythonscript, which means you have to install the pythonscript plugin,
    but don’t expect it to work without errors as I haven’t done anything related to tabstops yet.


Log in to reply