Community
    • 登入

    last modified date in status bar?

    已排程 已置頂 已鎖定 已移動 General Discussion
    40 貼文 5 Posters 21.8k 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • dailD
      dail @Claudia Frank
      最後由 編輯

      @Claudia-Frank

      Ah. Thanks for clarifying.

      1 條回覆 最後回覆 回覆 引用 0
      • SalviaSageS
        SalviaSage
        最後由 SalviaSage 編輯

        @dail
        Nice, I will be using your script then.
        When is the release of the next version of luascript?

        Thanks.

        1 條回覆 最後回覆 回覆 引用 0
        • dailD
          dail
          最後由 編輯

          Not sure. You can download a prelease though.

          • 32 bit
          • 64 bit

          Just drop the DLL in with the other plugins. Edit the startup script with Plugins > LuaScript > Edit startup script and put the above code in there, save, and restart Notepad++.

          1 條回覆 最後回覆 回覆 引用 2
          • SalviaSageS
            SalviaSage
            最後由 編輯

            Thanks. the code works.

            1 條回覆 最後回覆 回覆 引用 0
            • patrickdrdP
              patrickdrd
              最後由 patrickdrd 編輯

              I think I’ve found a bug:

              I had around 10 tabs opened in npp, and my work shift is close to the end so I decided to close npp, so I pressed the x in the top right corner to find out that:

              there was a file open which was attached to an email,
              it was opened as read-only originally,
              I clicked on edit -> clear read-only and I edited it,
              I never saved it,

              the date on the bottom left corner is updated continuously/ every minute that passes (on the clock), even though I’m not saving it (I can see a star on the top left corner - the star that means that the file is not saved),
              I opened the containing folder and the file doesn’t exist there,
              I’m using autosave plugin to run every time focus is switched off
              from the current file as well

              edit: more likely its an autosave bug

              Claudia FrankC 1 條回覆 最後回覆 回覆 引用 0
              • Claudia FrankC
                Claudia Frank @patrickdrd
                最後由 Claudia Frank 編輯

                @patrickdrd

                something is strange here - how can python get a modified timestamp if the file doesn’t exist at all??
                The autosave plugin could explain why you see the continuous update of the timestamp
                but only if there is a file which can be saved.
                Sorry, but, are you really sure that the file doesn’t exist?

                Cheers
                Claudia

                1 條回覆 最後回覆 回覆 引用 0
                • patrickdrdP
                  patrickdrd
                  最後由 編輯

                  yes, I checked in windows explorer, it should be easy to reproduce it yourself

                  1 條回覆 最後回覆 回覆 引用 0
                  • patrickdrdP
                    patrickdrd
                    最後由 編輯

                    I’m also using the lua script too, not the python one

                    1 條回覆 最後回覆 回覆 引用 0
                    • dailD
                      dail
                      最後由 編輯

                      @patrickdrd

                      The Lua I posted above simply askes the operating system (i.e. Windows) when the file was last modified. Even if the file isn’t being saved from Notepad++, it would appear something else is changing the file’s modification timestamp.

                      1 條回覆 最後回覆 回覆 引用 2
                      • SalviaSageS
                        SalviaSage
                        最後由 編輯

                        @dail

                        Hi dail, I just tested your script today and it is not working anymore on notepad++ v7.5.8

                        Can you please also check it and maybe we can come up with a fix.

                        File:8: attempt to index a nil value (global 'winfile')
                        stack traceback:
                            File:8: in function <File:3>
                        Lua 5.3.4  Copyright (C) 1994-2017 Lua.org, PUC-Rio
                        
                        1 條回覆 最後回覆 回覆 引用 0
                        • patrickdrdP
                          patrickdrd
                          最後由 編輯

                          lua script implementation works fine with 7.5.8

                          1 條回覆 最後回覆 回覆 引用 1
                          • SalviaSageS
                            SalviaSage
                            最後由 編輯

                            It does, but this particular code does not work for me as of this date. I fear windows OS might have changed something, since this script calls something from the OS.

                            npp.AddEventHandler({"OnSave", "OnSwitchFile", "OnLangChange"}, function()
                                -- Make sure it is a "real" file first
                                if npp:GetCurrentDirectory() == "" then
                                    return
                                end
                            
                                local text = npp.LanguageDescription[npp.BufferLangType[npp.CurrentBufferID]] .. " - " .. os.date('%d/%m/%Y %H:%M', winfile.attributes(npp:GetFullCurrentPath(), "modification"))
                                npp.StatusBar[STATUSBAR_DOC_TYPE] = text
                            end)
                            
                            1 條回覆 最後回覆 回覆 引用 0
                            • dailD
                              dail
                              最後由 編輯

                              My guess is that since it is reporting winfile as null then you do not have a version of LuaScript that supports this. The official v0.7.1 available via the plugin manager will not work. You have to grab one of the versions listed above.

                              1 條回覆 最後回覆 回覆 引用 1
                              • SalviaSageS
                                SalviaSage
                                最後由 編輯

                                dail, I can see that the latest beta version of your plugin is v0.7.1.23

                                But, there isn’t a built .dll file for this, so I downloaded the source and the MSVS told me that I don’t have the xp v14.00 tools installed or something. So, I launched the MSVS installer and installed that under c++ tools. And then, when I tried to build it I got a whole bunch of errors.

                                Here is a screenshot of the errors: https://i.imgur.com/FRGtDej.png

                                So… Can you please give me more instructions on how to build this or you can release a .dll of v0.7.1.23

                                Simply opening LuaScript.sln in MSVS and pressing f7 does not do anything like you say in your description page.
                                Can you please update that area which deals with how to build LuaScript from source?

                                Thanks man…

                                1 條回覆 最後回覆 回覆 引用 1
                                • dailD
                                  dail
                                  最後由 編輯

                                  But, there isn’t a built .dll file for this

                                  There are no official releases yet but there are some one Appveyor.

                                  Can you please give me more instructions on how to build this or you can release a .dll of v0.7.1.23

                                  Not really because I’m not sure what is causing those errors. There seems to be some configuration issues beyond anything LuaScript related because it is not finding platform toolsets or even “windows.h” header files. Also I’m not quite ready to create any official releases as there are still some problems I need to address before then.

                                  Can you please update that area which deals with how to build LuaScript from source?

                                  No because that is all that needs done assuming MSVC is configured correctly. The Appveyor script is simply calling msbuild and it compiles it.


                                  So…did you try one of the releases above I suggested using? If so did they work for you?

                                  1 條回覆 最後回覆 回覆 引用 1
                                  • SalviaSageS
                                    SalviaSage
                                    最後由 編輯

                                    Yea, those builds worked.

                                    It was my own fault, I copied an earlier .dll by accident which doesn’t have that feature. Your guess was right.

                                    Also, I am looking forward to the next release. Let me know if you need a tester or very simple code work, I would love to be of help : ) : )

                                    See ya,

                                    dailD 1 條回覆 最後回覆 回覆 引用 2
                                    • dailD
                                      dail @SalviaSage
                                      最後由 編輯

                                      @SalviaSage

                                      Testing is always appreciated in case there are any bugs that show up.

                                      The plugin itself is mostly stable as far as the set of features it has, so theres no immediate plans to add new functionality but that doesn’t others may have ideas I’ve never thought of.

                                      1 條回覆 最後回覆 回覆 引用 0
                                      • 第一個貼文
                                        最後的貼文
                                      The Community of users of the Notepad++ text editor.
                                      Powered by NodeBB | Contributors