Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Login

    Need to set tab STOPS, not spacing.

    Help wanted · · · – – – · · ·
    6
    16
    1.1k
    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.
    • EkopalypseE
      Ekopalypse
      last edited by

      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.

      Alan KilbornA Carl D. GoldinC 2 Replies Last reply Reply Quote 1
      • Alan KilbornA
        Alan Kilborn @Ekopalypse
        last edited by

        @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.

        EkopalypseE 1 Reply Last reply Reply Quote 2
        • EkopalypseE
          Ekopalypse @Alan Kilborn
          last edited by Ekopalypse

          @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 :-)

          Alan KilbornA 1 Reply Last reply Reply Quote 2
          • Alan KilbornA
            Alan Kilborn @Ekopalypse
            last edited by

            @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. :-)

            1 Reply Last reply Reply Quote 2
            • Carl D. GoldinC
              Carl D. Goldin @Ekopalypse
              last edited by Carl D. Goldin

              @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?
              EkopalypseE 1 Reply Last reply Reply Quote 1
              • EkopalypseE
                Ekopalypse @Carl D. Goldin
                last edited by

                @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.

                Paul WormerP 1 Reply Last reply Reply Quote 3
                • Paul WormerP
                  Paul Wormer @Ekopalypse
                  last edited by

                  @ekopalypse What happened to this thread? Did somebody manage to define variable widths between tab stops? For the older fixed-format languages (dating back to punch cards) it would be a very useful feature.

                  Alan KilbornA 1 Reply Last reply Reply Quote 1
                  • Alan KilbornA
                    Alan Kilborn @Paul Wormer
                    last edited by Alan Kilborn

                    @paul-wormer said in Need to set tab STOPS, not spacing.:

                    What happened to this thread?

                    I think what happened is that the OP didn’t respond and express continued interest, so @Ekopalypse didn’t continue expending effort on it.

                    I would like to see such a thing, but where no tab characters are used (only spaces). I think I could put that to some good use, but until I see it I won’t know for sure.

                    Lycan ThropeL 1 Reply Last reply Reply Quote 2
                    • Lycan ThropeL
                      Lycan Thrope @Alan Kilborn
                      last edited by

                      @alan-kilborn
                      If I’m correctly understanding the problem the OP was asking for, it sounds like the old ways we were able to setup a wordprocessor like WordPerfect and such, so that you set the tab stops at predefined areas you wanted to start sections at instead of having auto indents setting of so many spaces. When I see Tabs in a menu option, I personally expect to see that kind of a reference (tab stops) rather than shortcuts to choose a different tab (window/folder). :-)

                      I suspect, the implementation may be difficult since you have the column editing ability, and that may conflict with tabbing as a formatting tool?

                      Lee

                      Alan KilbornA 1 Reply Last reply Reply Quote 0
                      • Alan KilbornA
                        Alan Kilborn @Lycan Thrope
                        last edited by

                        @lycan-thrope said in Need to set tab STOPS, not spacing.:

                        instead of having auto indents setting of so many spaces

                        Yes, I do realize my desire is somewhat “against the grain” of the OP’s request (the title of this thread, after all, is Need to set tab STOPS, not spacing).

                        But, for it (the general concept of a proposed solution) to be useful to me, it would have to consider spaces, because tab characters in my files are not allowed.

                        Lycan ThropeL 1 Reply Last reply Reply Quote 0
                        • Lycan ThropeL
                          Lycan Thrope @Alan Kilborn
                          last edited by

                          @alan-kilborn ,

                          Yep, which is why the option of choosing the number of spaces to substitute for a tab was implemented in those old word processors. :-) They were, at the time, the best multi-tool we had, until syntax-highlighting became a desired tool for programmers and the editors took different directions at that point, for the most part, as I remember it. :-)

                          Lee

                          Alan KilbornA 1 Reply Last reply Reply Quote 0
                          • Alan KilbornA
                            Alan Kilborn @Lycan Thrope
                            last edited by

                            A little experimentation on my own shows that the Scintilla functions for this only work when true tab characters are used, and I have zero interest in that, so… I’m out.

                            Michael VincentM 1 Reply Last reply Reply Quote 0
                            • Michael VincentM
                              Michael Vincent @Alan Kilborn
                              last edited by

                              @alan-kilborn said in Need to set tab STOPS, not spacing.:

                              when true tab characters are used

                              but after they’re inserted, can’t you have N++ set to convert to space?

                              Cheers.

                              Alan KilbornA 1 Reply Last reply Reply Quote 0
                              • Alan KilbornA
                                Alan Kilborn @Michael Vincent
                                last edited by Alan Kilborn

                                @michael-vincent said in Need to set tab STOPS, not spacing.:

                                but after they’re inserted, can’t you have N++ set to convert to space?

                                My experiment was:

                                • create new file tab with Ctrl+n
                                • execute Pythonscript editor.clearTabStops(0) in console
                                • execute Pythonscript editor.addTabStops(0, 100) in console
                                • move focus to editor (on line 1 since empty file); press Tab key a few times (observe insertion of four space characters each time)
                                • go to Preferences, change Default file type setting to not replace with spaces
                                • move focus back to editor line 1; delete previously entered spaces; press Tab key a few times; observe:

                                e91bd4eb-998d-464e-bd07-c56b7f67b082-image.png

                                So I do see an effect, but only when tab characters are used. (Another thing to note is that the “indent lines” don’t seem to respect tab stops that are not regular).

                                Thus I don’t see how to achieve anything with only space characters. Or maybe you had some other idea?

                                Michael VincentM 1 Reply Last reply Reply Quote 1
                                • Michael VincentM
                                  Michael Vincent @Alan Kilborn
                                  last edited by

                                  @alan-kilborn said in Need to set tab STOPS, not spacing.:

                                  Or maybe you had some other idea?

                                  No, that about sums up my thoughts on the matter :-) Thanks for the testing explanation.

                                  Cheers.

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