Browse Source

sublsess: added info and badproject variable, to easily change which window+project to clear fromthe session file

dev
bud 5 months ago
parent
commit
dc72cfc2d3
1 changed files with 14 additions and 6 deletions
  1. +14
    -6
      scripts/sublsess

+ 14
- 6
scripts/sublsess View File

@@ -1,12 +1,20 @@
#!/bin/bash

f=~/.config/sublime-text-3/Local/Session.sublime_session
badproject=not

# this script will remove windows from the session
# file where the active project matches the variable
# $badproject . If this script is in $PATH, it will
# get executed from "sublaunch" whenever a new sublime
# window is created.

# in the "windows": list, print all entries
# not containing the line: "project": "not.sublime-project"
# "workspaces" is the key after "windows":
# this script is only useful if one uses a multiwindow
# sublime setup.

f=~/.config/sublime-text-3/Local/Session.sublime_session

awk '
awk -v badp=$badproject '
BEGIN {re="^\\s*\"project\": \"" badp ".sublime-project\".*"}

/^\s*"workspaces":/ {
print "["
@@ -28,7 +36,7 @@ awk '
if (/^\s*"auto_complete":/)
save=1

if (/^\s*"project": "not.sublime-project".*/) {
if ($0 ~ re) {
bad=dontprint
}



Loading…
Cancel
Save