francostellari / NppPlugins

Other
105 stars 6 forks source link

AutoSave changes ctrl+tab order #3

Closed YakovL closed 3 years ago

YakovL commented 3 years ago

Hi, with current AutoSave plugin and saving on focus loss set, there's a problem with order of ctrl+tab. Since the plugin switches tabs one-by-one in the LTR order and saves each one, once notepad++ is focued, the order of previously opened tabs is changed (say, I worked with 4 tabs and switched between them in the order 1-4-2-3: and after loosing and getting focus, n++ shows the 1-2-4-3 order, suggesting 4 on ctrl tab instead of 2).

Could you please fix this (or alternatively open the source of the plugin)? The fix as I see it is to switch tabs in the "least recently opened" order when saving (1-4-2-3 in the example above).

Best regards, Yakov.

francostellari commented 3 years ago

Hi I understand your problem. Can you point me to a way to determine the order of opening the tabs? I'm not familiar with the tab control command that returns the opening order. Thank you. Franco

On Mon, Apr 5, 2021 at 9:48 AM Yakov Litvin @.***> wrote:

Hi, with current AutoSave plugin and saving on focus loss set, there's a problem with order of ctrl+tab. Since the plugin switches tabs one-by-one in the LTR order and saves each one, once notepad++ is focued, the order of previously opened tabs is changed (say, I worked with 4 tabs and switched between them in the order 1-4-2-3: and after loosing and getting focus, n++ shows the 1-2-4-3 order, suggesting 4 on ctrl tab instead of 2).

Could you please fix this (or alternatively open the source of the plugin)? The fix as I see it is to switch tabs in the "least recently opened" order when saving (1-4-2-3 in the example above).

Best regards, Yakov.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/francostellari/NppPlugins/issues/3, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL5TXISNAR52OVQ2AXHGPITTHG5TBANCNFSM42M2YI3A .

-- Franco

YakovL commented 3 years ago

Right. I'm not familiar with npp internals, but I've searched through dev forums and found this thread with this post which may be a bit helpful. They use NppExec plugin script language, but at least it may give some idea of terms to look into, they get ActiveViewActiveTabIdx from NPPM_GETPOSFROMBUFFERID message. For the moment I understand this too vaguely to provide more specific pointers ..source can tell more, though. I can also ask at dev forums if you are not registered there (like me) about determining the order of opening tabs.

francostellari commented 3 years ago

I check the post but it does not seem useful. I went back and checked the latest plugin interface in case something new was added but I also did not find a way to get the MRU order. I think I can add an option where I issue a SAVEALL but if you have unnamed docs... it will ask for filename.

On Thu, Apr 8, 2021 at 4:30 AM Yakov Litvin @.***> wrote:

Right. I'm not familiar with npp internals, but I've searched through https://community.notepad-plus-plus.org/search?term=tab%20order&in=titlesposts&matchWords=all&categories=5&sortBy=relevance&sortDirection=desc&showAs=posts dev forums and found this thread https://community.notepad-plus-plus.org/topic/20434/auto-sort-tabs-real-time/ with this post https://community.notepad-plus-plus.org/topic/20434/auto-sort-tabs-real-time/8?_=1617869320372&lang=ru which may be a bit helpful. They use NppExec plugin script language, but at least it may give some idea of terms to look into, they get ActiveViewActiveTabIdx from NPPM_GETPOSFROMBUFFERID message. For the moment I understand this too vaguely to provide more specific pointers .. source https://github.com/notepad-plus-plus/notepad-plus-plus/blob/ab5c1d3e2a9718a3cc365c1e44bfae09bb7355bc/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h#L212 can tell more, though. I can also ask at dev forums if you are not registered there (like me) about determining the order of opening tabs.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/francostellari/NppPlugins/issues/3#issuecomment-815566094, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL5TXIUOGFBHR73NSIGT3LDTHVSSTANCNFSM42M2YI3A .

-- Franco

francostellari commented 3 years ago

Please check the new version: https://github.com/francostellari/NppPlugins/blob/main/AutoSave/AutoSave_dll_1v61_x64.zip

Select options: Save all files Overwrite named files Ask unnamed files

Regards,

On Thu, Apr 8, 2021 at 4:30 AM Yakov Litvin @.***> wrote:

Right. I'm not familiar with npp internals, but I've searched through https://community.notepad-plus-plus.org/search?term=tab%20order&in=titlesposts&matchWords=all&categories=5&sortBy=relevance&sortDirection=desc&showAs=posts dev forums and found this thread https://community.notepad-plus-plus.org/topic/20434/auto-sort-tabs-real-time/ with this post https://community.notepad-plus-plus.org/topic/20434/auto-sort-tabs-real-time/8?_=1617869320372&lang=ru which may be a bit helpful. They use NppExec plugin script language, but at least it may give some idea of terms to look into, they get ActiveViewActiveTabIdx from NPPM_GETPOSFROMBUFFERID message. For the moment I understand this too vaguely to provide more specific pointers .. source https://github.com/notepad-plus-plus/notepad-plus-plus/blob/ab5c1d3e2a9718a3cc365c1e44bfae09bb7355bc/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h#L212 can tell more, though. I can also ask at dev forums if you are not registered there (like me) about determining the order of opening tabs.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/francostellari/NppPlugins/issues/3#issuecomment-815566094, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL5TXIUOGFBHR73NSIGT3LDTHVSSTANCNFSM42M2YI3A .

-- Franco

YakovL commented 3 years ago

Hello Franco, thanks for the update! It worked as you explained which is great, however I used the "Save (overwrite) silently here" option for "Unnamed/new files". Is it possible to make this work with that one?

francostellari commented 3 years ago

Hello, unfortunately it is not currently possible with the plugin messages. You can either save all and let npp deal with the unnamed files or save only the current file. I could not figure out a way to work in other buffers. So to implement the feature that you use I have to toggle through the tabs.

On Fri, Apr 30, 2021 at 4:20 PM Yakov Litvin @.***> wrote:

Hello Franco, thanks for the update! It worked as you explained which is great, however I used the "Save (overwrite) silently here" option for "Unnamed/new files". Is it possible to make this work with that one?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/francostellari/NppPlugins/issues/3#issuecomment-830358434, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL5TXIWAQVKDCFBRXOTELDLTLMGH5ANCNFSM42M2YI3A .

-- Franco