Permalink
Browse files

Merge branch 'db_in_settings_dir' of https://github.com/fjl/BufferScroll

  • Loading branch information...
2 parents 6f7b59d + 0cf9e24 commit 6cf317ac679f3ecde30dced4a805d6e5ae8c00cd @titoBouzout committed Jul 5, 2012
Showing with 11 additions and 1 deletion.
  1. +11 −1 BufferScroll.py
View
@@ -12,7 +12,7 @@
db = {}
-database = sublime.packages_path()+'/User/BufferScroll.bin.gz'
+database = sublime.packages_path()+'/../Settings/BufferScroll.bin.gz'
if lexists(database):
try:
gz = GzipFile(database, 'rb')
@@ -25,6 +25,16 @@
# upgrade
from os import remove, rename
+ # database in User package -> Database in Settings dir
+ if lexists(sublime.packages_path()+'/User/BufferScroll.bin.gz'):
+ try:
+ gz = GzipFile(sublime.packages_path()+'/User/BufferScroll.bin.gz')
+ db = load(gz)
+ gz.close()
+ remove(sublime.packages_path()+'/User/BufferScroll.bin.gz')
+ except:
+ db = {}
+
# from version 6 to 7
if lexists(sublime.packages_path()+'/User/BufferScroll.bin'):
try:

0 comments on commit 6cf317a

Please sign in to comment.