• Login
Community
  • Login

Two suggestions

Scheduled Pinned Locked Moved General Discussion
32 Posts 7 Posters 7.5k 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.
  • F
    favdish
    last edited by favdish May 18, 2020, 9:54 AM May 18, 2020, 9:53 AM

    I am looking to replace an editor I’ve used for literally decades (called AkelPad). This has been absolutely perfect so far but its heuristic to divine the encoding of a file (CP1252, UTF-8 etc) is broken. And with more and more utf-8 files around I am really looking for a replacement. And so far… NPP look very goods.
    However, there are two things I regularly use with AkelPad that would make NPP even better (well, (IMHO :-/). One is that AP marks any modified line with a small red mark next to its line number. This line marker turns green when the file is next saved, so one look and you see which lines have been modified and saved (green) or modified and not yet saved (red). All other lines have no marker. Sounds like a small cosmetic thing but it really helps me with editing large files.
    The second thing is a small change in Edit>>Column Editor… (the box which opens with Alt-C). Here I can enter a text that is prefixed to the current column selection. How about adding a mode to enter text that is prefixed and suffixed to the selection (say “PREFIX^SUFFIX” with PREFIX being added to each column as prefix and SUFFIX as suffix)? I sometimes have to add stuff to the front and the end of a columnar selection. I can do that in two steps but one step would be better :-).

    Otherwise so far I’m quite happy with NPP. A thank you to Don for his effort.

    E 1 Reply Last reply May 18, 2020, 10:25 AM Reply Quote 0
    • E
      Ekopalypse @favdish
      last edited by May 18, 2020, 10:25 AM

      @favdish

      this is a community driven forum, you get a better chance
      that your feature request get noticed if you open a thread at github.
      See here for more details.

      Concerning the features, if you run 32bit edition then there is a plugin
      called Location Navigate which does the highlighting of changed/saved lines. The second, I assume, hasn’t been addressed yet.
      But I assume, if you install one of the scripting plugins then you will
      be able to solve this as well.

      F 1 Reply Last reply May 18, 2020, 11:19 AM Reply Quote 2
      • F
        favdish @Ekopalypse
        last edited by May 18, 2020, 11:19 AM

        @Ekopalypse Thanks. I’ve just found the plugin you mentioned :-) This indeed solves my first problem (though the plugin’s a bit fiddly to set up)… but only for 32 bit, apparently. Well, that shows it’s doable and perhaps it needs just to be recompiled for 64 bit. I may have a look if I have some more time.

        The second thing… trying to do that via a script is certainly feasible… if the scripting API is powerful enough. I’ve tried to do something similar with the geany editor and its Lua plugin and failed miserably. I have installed NPP’s LuaScript plugin and certainly will have a look.

        Again thanks.

        E 1 Reply Last reply May 18, 2020, 11:58 AM Reply Quote 1
        • E
          Ekopalypse @favdish
          last edited by May 18, 2020, 11:58 AM

          @favdish

          quick info before I have to go back to work.
          Without having tested I would assume you first check
          if it is a rectangular selection, then get all start end end position from that selection and convert that into multiple selections. I’m not a Lua expert but if there is a problem,
          I guess I can show you how this could be solved via python.

          A 1 Reply Last reply May 18, 2020, 12:42 PM Reply Quote 1
          • A
            Alan Kilborn @Ekopalypse
            last edited by May 18, 2020, 12:42 PM

            @favdish @Ekopalypse

            I also am a big fan of changed-line indications, due to some editors I used before Notepad++ having that.
            LocationNavigate is not perfect with its marking but it is way better than nothing.
            I would have a hard time dealing with it if it were suddenly taken away from me somehow.
            It sure seems like the big question is, why isn’t this feature built into Scintilla?

            I think someone attempted to write a script before to do the changed-lines marking.
            It is not a hard algorithm…until you consider undo/redo; then it all goes out the window.

            E D 2 Replies Last reply May 18, 2020, 7:03 PM Reply Quote 2
            • E
              Ekopalypse @Alan Kilborn
              last edited by May 18, 2020, 7:03 PM

              @Alan-Kilborn said in Two suggestions:

              It is not a hard algorithm…until you consider undo/redo; then it all goes out the window.

              :-D Challenge accepted :-)

              Just to be sure what needs to be done.

              • Mark each line that has been changed since the last save.
              • Once saved, mark them differently.
              • Make sure that Undo/Redo changes the marker accordingly
              • Reload document resets everything
              • No persistence, i.e. at Npp startup there is a clean document aka no markers.

              Anything else?

              A 1 Reply Last reply May 18, 2020, 7:11 PM Reply Quote 2
              • A
                Alan Kilborn @Ekopalypse
                last edited by May 18, 2020, 7:11 PM

                @Ekopalypse

                I think that covers everything.

                Don’t you have enough on your plate right now; thinking of:

                • themes stuff
                • PySnack
                • column mode prefix / suffix
                • other stuff I’ve forgotten… perhaps something regarding bookmarks… memory fails me
                1 Reply Last reply Reply Quote 3
                • P
                  PeterJones
                  last edited by May 18, 2020, 7:14 PM

                  @Alan-Kilborn said in Two suggestions:

                  other stuff I’ve forgotten

                  • updating the MESSAGE and NOTIFICATION documentation

                  :-)

                  A 1 Reply Last reply May 18, 2020, 7:16 PM Reply Quote 3
                  • A
                    Alan Kilborn @PeterJones
                    last edited by May 18, 2020, 7:16 PM

                    @Ekopalypse

                    Yea! What Peter said too!

                    But, seriously, if you could make a changed-lines thingy, and have time to, THAT would be an extremely cool and useful thing. And I’ve got to believe others would fall in love with it too.

                    1 Reply Last reply Reply Quote 3
                    • E
                      Ekopalypse
                      last edited by May 18, 2020, 8:09 PM

                      Don’t you have enough on your plate right now; thinking of:

                      :-D you are right and I should stop doing such thing :-)
                      but this one is interesting

                      themes stuff
                      PySnack
                      column mode prefix / suffix
                      other stuff I’ve forgotten… perhaps something regarding bookmarks… memory fails me
                      You’re right, and I should stop doing that :-), but this is interesting.

                      PySnack dies before it’s born. PythonScript
                      with Python3 has its first alpha release and it looks very promising.

                      Bookmarks … hmm … what did I forget … wait … aren’t we
                      waiting for someone else? :-D

                      Themes - yes - I am not finished with the theory yet. :-(

                      MESSAGE and NOTIFICATION documentation - will certainly be finished this week, and if it means I have to do it on Father’s Day, I will do it.

                      A 1 Reply Last reply May 18, 2020, 8:21 PM Reply Quote 1
                      • A
                        Alan Kilborn @Ekopalypse
                        last edited by May 18, 2020, 8:21 PM

                        @Ekopalypse said in Two suggestions:

                        Bookmarks … hmm … what did I forget … wait … aren’t we
                        waiting for someone else? :-D

                        Me?
                        I thought I only promised something for THIS and I am still working on it.

                        E 1 Reply Last reply May 18, 2020, 8:48 PM Reply Quote 0
                        • E
                          Ekopalypse @Alan Kilborn
                          last edited by May 18, 2020, 8:48 PM

                          @Alan-Kilborn said in Two suggestions:

                          Me?

                          No, waiting for the OP. :-)

                          1 Reply Last reply Reply Quote 0
                          • D
                            dail @Alan Kilborn
                            last edited by May 18, 2020, 9:43 PM

                            @Alan-Kilborn

                            It is not a hard algorithm…until you consider undo/redo; then it all goes out the window.

                            I too once tried to create a plugin to do this. It was several years ago and gave up because of this exact reason.

                            E 1 Reply Last reply May 18, 2020, 10:08 PM Reply Quote 3
                            • E
                              Ekopalypse @dail
                              last edited by May 18, 2020, 10:08 PM

                              C’mon @dail , I haven’t even started and you’re already taking the wind out of my sails. :-D
                              I thought memento pattern + deque list = solution.
                              Phew - I guess I’m screwed now. ;-)

                              D 1 Reply Last reply May 18, 2020, 10:16 PM Reply Quote 3
                              • D
                                dail @Ekopalypse
                                last edited by May 18, 2020, 10:16 PM

                                @Ekopalypse My naive approach was keep a counter per line. Increment when a change is made or a redo. Decrement when undo.

                                This partially worked but once you start having to keep track of deleted lines, what to do when lines get merged, split, etc.

                                My next attempt was to use the git diff core code to compute diffs in near real time but I didnt ever finish it.

                                1 Reply Last reply Reply Quote 2
                                • E
                                  Ekopalypse
                                  last edited by May 18, 2020, 10:32 PM

                                  Hmm … I see, what started to be a nice project while waiting on firmware compilation/update is becoming a “don’t walk alone in the dark and do not go into that lonely woodden cabin”

                                  Yes, I have also thought about Python’s difflib and using it together with the stored history of the document to avoid comparing large documents.
                                  Hmm… I will try and probably report in two days that I failed miserably. :-)

                                  1 Reply Last reply Reply Quote 3
                                  • A
                                    Alan Kilborn
                                    last edited by May 18, 2020, 10:41 PM

                                    Any chance to have a look at LocationNavigate source and see how it handles it (undo/redo)?

                                    E M 2 Replies Last reply May 18, 2020, 10:47 PM Reply Quote 0
                                    • E
                                      Ekopalypse @Alan Kilborn
                                      last edited by May 18, 2020, 10:47 PM

                                      @Alan-Kilborn said in Two suggestions:

                                      LocationNavigate

                                      :-D - I’m currently doing this but there are a lot of ???
                                      Author seems to use a different encoding.

                                      1 Reply Last reply Reply Quote 2
                                      • M
                                        Michael Vincent @Alan Kilborn
                                        last edited by Michael Vincent May 18, 2020, 11:32 PM May 18, 2020, 11:32 PM

                                        @Alan-Kilborn said in Two suggestions:

                                        Any chance to have a look at LocationNavigate source and see how it handles it (undo/redo)?

                                        What’s wrong with just using Location Navigate? I didn’t see that was a problem above (except lack of 64-bit version). I this just an attempt to implement with a script, or legitimately fix a problem with Location Navigate implementation?

                                        Just curious before I potentially throw my hat in the ring …

                                        Cheers.

                                        A 1 Reply Last reply May 19, 2020, 12:52 AM Reply Quote 3
                                        • A
                                          Alan Kilborn @Michael Vincent
                                          last edited by Alan Kilborn May 19, 2020, 12:54 AM May 19, 2020, 12:52 AM

                                          @Michael-Vincent

                                          What’s wrong with just using Location Navigate?

                                          Nothing, except:

                                          • It’s overkill for just the changed-lines functionality (I’ve never found any use for the other things – really the advertised main things – that LocationNavigate does)

                                          • It might be easier (says the guy that isn’t doing it) to recreate it than to understand the mass of what is there

                                          • It feels maybe wrong to “take over” someone else’s work (this is a very minor reason)

                                          Your hat is definitely welcome in the ring!

                                          M 1 Reply Last reply May 19, 2020, 1:05 AM Reply Quote 2
                                          9 out of 32
                                          • First post
                                            9/32
                                            Last post
                                          The Community of users of the Notepad++ text editor.
                                          Powered by NodeBB | Contributors