Commits

Matija Polajnar committed 15cf939

Darwin (OS X) support.

  • Participants
  • Parent commits 850f8e3

Comments (0)

Files changed (1)

File src/gui_vim.py

 from subprocess import Popen, PIPE
 import os
+import platform
 import glob
 import re
 import sqlite3
 
 import ref
 
+XDG_OPEN = ['xdg-open', 'open'][platform.system=="Darwin"]
 
 def search_documents(query):
     global last_select_cmd
 
 def open_document():
     filename = selected_document()['filename']
-    Popen(['xdg-open', os.path.join(ref.DOCUMENT_DIR, filename)], stderr=PIPE, stdout=PIPE)
+    Popen([XDG_OPEN, os.path.join(ref.DOCUMENT_DIR, filename)], stderr=PIPE, stdout=PIPE)
 
 
 def add_document(fname):