• Login
Community
  • Login

How can I open timestamps?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
14 Posts 7 Posters 1.2k 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.
  • T
    Tural Nevruzov
    last edited by Apr 30, 2023, 5:26 AM

    Showing which line was written when

    Like this resim_2023-04-30_082357551.png

    P P 2 Replies Last reply Apr 30, 2023, 4:15 PM Reply Quote 0
    • P
      PeterJones @Tural Nevruzov
      last edited by Apr 30, 2023, 4:15 PM

      @Tural-Nevruzov ,

      What do you mean by “opening” a timestamp?

      A T 2 Replies Last reply May 1, 2023, 2:06 PM Reply Quote 1
      • M
        Mark Olson
        last edited by Apr 30, 2023, 8:10 PM

        Does Scintilla even track when edits were made, beyond more coarse-grained questions like “was this edit made before or after the last save”?

        I just glanced through the Scintilla documentation, and I see no reference to such a capability, and I certainly don’t think it’s a feature of Notepad++.

        You could use a scripting plugin like PythonScript to log the current time each time an edit is made, but I don’t see any other way to do that.

        1 Reply Last reply Reply Quote 4
        • M
          Mark Olson
          last edited by Apr 30, 2023, 9:57 PM

          I started working on this because I thought it was an interesting idea, and then I realized that dealing with users deleting lines or inserting lines in the middle of the document would just be a huge headache, and the end result would probably be really unsatisfactory.
          Consider:
          If I delete the second and third lines from

          foo
          bar
          baz
          quz
          

          and get

          foo
          quz
          

          in my mind, the fourth line is now the second line, and I want every line number after the third line to be changed to reflect this.

          The problem is that now the time complexity of updating a file’s timestamps is potentially linear in the number of lines of the document, which means that this sort of operation would be really expensive and probably kill the editor’s responsiveness if there were more than a couple hundred lines.

          M 1 Reply Last reply May 1, 2023, 12:23 AM Reply Quote 1
          • M
            Michael Vincent @Mark Olson
            last edited by May 1, 2023, 12:23 AM

            @Mark-Olson

            started working on this because I thought it was an interesting idea, and then I realized that dealing with users deleting lines or inserting lines in the middle of the document would just be a huge headache

            Agree. I would think something like git blame would be the way to go. Not necessarily time stamps but a way to attribute line changes to some type of “commit”.

            Cheers.

            L 1 Reply Last reply May 1, 2023, 8:07 PM Reply Quote 2
            • P
              Paul Wormer @Tural Nevruzov
              last edited by May 1, 2023, 2:02 PM

              @Tural-Nevruzov I’m also not sure what you mean. But if your question is: how to enter the current date and time at a certain point in a file? then the answer is easy. Go to Settings>Preferences>Multi-instance & Date and define a custom time and date string. Then go to Settings>Shortcut mapper>“Date Time (customized)” and define a shortcut key (I use the Excel key ctrl+;). Place the caret at the point where you want time and date, hit your predefined key and voilà.

              1 Reply Last reply Reply Quote 1
              • A
                Alan Kilborn @PeterJones
                last edited by May 1, 2023, 2:06 PM

                @PeterJones said in How can I open timestamps?:

                What do you mean by “opening” a timestamp?

                I’m pretty sure what the OP wants here is that whenever he makes an edit on a line in his file, the date/time automatically gets filled in for the first columns on the given line.

                P 1 Reply Last reply May 1, 2023, 2:12 PM Reply Quote 2
                • P
                  Paul Wormer @Alan Kilborn
                  last edited by May 1, 2023, 2:12 PM

                  @Alan-Kilborn You are probably right, but if he is editing manually, then hitting ctrl+; before making the edit is a small effort.

                  A 1 Reply Last reply May 1, 2023, 2:34 PM Reply Quote 0
                  • A
                    Alan Kilborn @Paul Wormer
                    last edited by May 1, 2023, 2:34 PM

                    @Paul-Wormer said in How can I open timestamps?:

                    then hitting ctrl+; before making the edit is a small effort

                    Shrug. People want what they want. :-)

                    1 Reply Last reply Reply Quote 1
                    • L
                      Lycan Thrope @Michael Vincent
                      last edited by May 1, 2023, 8:07 PM

                      @Michael-Vincent
                      Agreed, this problem from the scant and non-returning author, suggests it’s a Version Control documenting issue, and not an NPP solvable issue other than opening the VC program to save and open the files.

                      1 Reply Last reply Reply Quote 0
                      • T
                        Tural Nevruzov @PeterJones
                        last edited by May 4, 2023, 10:45 AM

                        @PeterJones I mean is there a plugin that shows which line was changed and when? A separate time display for each line

                        M L 2 Replies Last reply May 4, 2023, 6:28 PM Reply Quote 0
                        • M
                          Mark Olson @Tural Nevruzov
                          last edited by May 4, 2023, 6:28 PM

                          @Tural-Nevruzov
                          As we discussed above, it is not feasible to get a timestamp for when each line was changed. It might be feasible to get a timestamp for the last time a line was saved.

                          If you are working with a log file, and most of the lines are added by some external process, Notepad++ cannot help you because even a hypothetical plugin that checked when lines were added could only tell you when lines were added while the file was open in the editor. Rather, you should find out how the log file is being generated and see if there is a way to make the logger show the time when a line was logged.

                          L 1 Reply Last reply May 4, 2023, 7:40 PM Reply Quote 0
                          • L
                            Lycan Thrope @Tural Nevruzov
                            last edited by May 4, 2023, 7:38 PM

                            @Tural-Nevruzov
                            NO.

                            1 Reply Last reply Reply Quote 0
                            • L
                              Lycan Thrope @Mark Olson
                              last edited by May 4, 2023, 7:40 PM

                              @Mark-Olson ,
                              He still doesn’t get it. He doesn’t get that this is not a wordprocessor which MIGHT record those kind of changes within the meta data of the document. Let’s move on.

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