Auto sort tabs (real-time)
-
looks like auto-sort is really a rocket science…
-
@Maxitrol-Mat said in Auto sort tabs (real-time):
looks like auto-sort is really a rocket science…
Why do you say that?
-
Regardless of other’s sense of entitlement, I certainly appreciate the free software of notepad++ :D
@alan-kilborn, I have a couple of questions:
-
How could I modify this to work so I can get my tabs to sort by ‘creation date’ since I accidentally sorted by ‘Name’ when I hit that ‘Sort Tabs’ button in the existing feature? … Maybe there is a simpler method since I’m not in need of automation?
-
Also, how does one run a script for notepad++?
Btw, there is another post for my particular request by @Ashil-Krishnan here, but no solution. However, @PeterJones referenced this post, which brought me here to inquire.
Thanks!
-
-
-
@daniel-tomberlin said in Auto sort tabs (real-time):
sort by ‘creation date’
This may be problematic as tabs unsaved into the filesystem, with names such as
new 1
,new 3
, etc. make determining a “creation date/time” difficult. -
@daniel-tomberlin said in Auto sort tabs (real-time):
how does one run a script for notepad++?
Well presuming you mean a PythonScript, and thus that you have that plugin installed, and a script file created and saved, the most basic way of running it is to pull down this menu structure and select your desired script:
You can also bind a script running to a keycombination for easier execution.
-
@alan-kilborn, I see. I presume it would be the same for ‘modified date’ too. Well, I’ll keep my eye out in case you feel like conducting another “mental exercise.” ;)
Btw, thanks for the script tip!
-
@daniel-tomberlin said in Auto sort tabs (real-time):
Well, I’ll keep my eye out in case you feel like conducting another “mental exercise.”
Unlikely because I never work with unsaved tabs (such as the mentioned
new 1
, etal). I did the original script because I thought it might be of some use to me. I don’t tend to code “complicated things” for others if I have no use for them. -
@alan-kilborn, ah, I understand.
Just an FYI, I did notice that the sessions.xml file in the Notepad++ folder under …\AppData\Roaming\ path does have a date at the end of the “backupFilePath” parameter. So the end of the path reads “…\new1@yyyy-mm-dd_123456,” however, saved file paths do not have anything populated in that parameter. There are also the parameters “originalFileLatModiTimestamp” and “originalFileLatModiTimestampHigh” that are “0” in the “new” tab, but have 8 numbers in the saved file, one negative and the other positive respectively. I may be able to figure out a way to manually sort my tabs by modifying the startPos=“2488” and endPos=“2488” in this file if I figure out what those numbers mean, including the number at the end of the aforementioned “backupFilePath” parameter too.
Btw, below is an example of what I’m seeing in case anyone has any answers here, but maybe answer on the other post as it is more appropriate.
<File firstVisibleLine="0" xOffset="0" scrollWidth="9423" startPos="120" endPos="120" selMode="0" offset="0" wrapCount="1" lang="SQL" encoding="-1" userReadOnly="no" filename="\\mypath\myfilename.sql" backupFilePath="" originalFileLastModifTimestamp="-386892058" originalFileLastModifTimestampHigh="30736076" mapFirstVisibleDisplayLine="-1" mapFirstVisibleDocLine="-1" mapLastVisibleDocLine="-1" mapNbLine="-1" mapHigherPos="-1" mapWidth="-1" mapHeight="-1" mapKByteInDoc="1140719616" mapWrapIndentMode="-1" mapIsWrap="no" /> <File firstVisibleLine="6" xOffset="0" scrollWidth="3990" startPos="2488" endPos="2488" selMode="0" offset="0" wrapCount="18" lang="SQL" encoding="-1" userReadOnly="no" filename="new 1" backupFilePath="C:\Users\username\AppData\Roaming\Notepad++\backup\new 1@2020-09-01_101742" originalFileLastModifTimestamp="0" originalFileLastModifTimestampHigh="0" mapFirstVisibleDisplayLine="-1" mapFirstVisibleDocLine="-1" mapLastVisibleDocLine="-1" mapNbLine="-1" mapHigherPos="-1" mapWidth="-1" mapHeight="-1" mapKByteInDoc="0" mapWrapIndentMode="-1" mapIsWrap="no" />
Anyway, thanks for the reply.
-
Are you posting the exact same comment in TWO threads? If so I’d say “Why?” and also “That’s not a great idea”.
-
@alan-kilborn, not exactly. One is speaking to you with reference to the other post. I’m basically cross posting the code part since it’s related.
-
@daniel-tomberlin said in Auto sort tabs (real-time):
since I accidentally sorted by ‘Name’ when I hit that ‘Sort Tabs’ button in the existing feature?
It’s funny that you mention this.
I did the same thing once.
As a warning to myself for the future, I changed the text on that sort button:The first thought is that it will only change the ordering on the list on this window, NOT the real tab ordering.
-
@daniel-tomberlin said in Auto sort tabs (real-time):
I’m basically cross posting the code part since it’s related.
Please don’t. The regulars all read posts from all (or most) of the categories (I will admit: I filter out the “Boycott” section and a handful of other specific “ignore” settings, as reading those is not good for my blood pressure; other than that, I read every post; I am guessing others of the regulars are similar).
All you have succeeded in doing is splitting your conversation into three different chunks, and people who are interested in your topic now have to go to three different locations to see the whole conversation, and to see what pieces have been addressed in which conversation.
To help future readers, the three discussions (hopefully not “and counting”):
- Auto sort tabs (real-time) (this discussion) => this is where the
sessions.xml
sub-discussion started - Sort tabs by creation date => forked to a second discussion, which sometimes has the same content posted in both discussions; in that thread, the
startPos
andendPos
are described - Need Explanation of a few Session.xml Parameters & Values => a brand new discussion to ask what the meaning of the originalFileLastModifTimestamp and originalFileLastModifTimestampHigh attributes, despite that having already been mentioned here in #1 and over in #2 (albeit with misspellings in some of the instances of the attribute names); Alan kindly did some investigation for Daniel, and showed the MS canonical docs that likely correspond to those two entries.
- Auto sort tabs (real-time) (this discussion) => this is where the
-
@peterjones, sorry… I tried my best to not hijack a thread with another issue, which is why I approached it this way since I had 3 different questions to hash out. I don’t see this happening in the future and will just make a new post with my need and only focus on questions related to other posts without expanding outside of the scope… Btw, I couldn’t update that typo because of the 3 minute rule, but since the shared code was correct, I figured it would be figured out.
-
-