Commits

Evgeny Podjachev committed 020d0e2

Fast fix for python 2.x

Comments (0)

Files changed (1)

plugin/fastfileselector/gen_file_list.py

 from os.path import join, isfile, abspath, split
 from fnmatch import fnmatch
 
+import sys
+
 import vim
 
 if int(vim.eval("g:FFS_ignore_case")):
 	
 fileList = scan_dir(path, vim.eval("g:FFS_ignore_list"))
 
+if sys.version_info[0] < 3:
+	fileList = [(x[0].encode('utf-8'), x[1].encode('utf-8')) for x in fileList]
+	path = path.encode('utf-8')
+
 vim.command('let s:base_path_length=%d' % len(path))
 vim.command('let s:file_list=[]')
 for i in fileList:
-	vim.command('let s:file_list+=[["%s","%s"]]' % (str(i[0]).replace('\\', '\\\\'), (str(i[1]).replace('\\', '\\\\'))))
+	vim.command('let s:file_list+=[["%s","%s"]]' % (i[0].replace('\\', '\\\\'), (i[1].replace('\\', '\\\\'))))
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.