Merge pull request #315 from zhaocai/feature/slash

[filename_completer] Append '/' to [DIR] automatically
This commit is contained in:
Val Markovic 2013-05-11 12:15:09 -07:00
commit 1a2ff2c1af

View File

@ -126,7 +126,8 @@ def GetPathsStandardCase( path_dir ):
def GenerateCandidatesForPaths( absolute_paths ): def GenerateCandidatesForPaths( absolute_paths ):
def GenerateCandidateForPath( absolute_path ): def GenerateCandidateForPath( absolute_path ):
is_dir = os.path.isdir( absolute_path ) is_dir = os.path.isdir( absolute_path )
return { 'word': os.path.basename( absolute_path ), basename = os.path.basename( absolute_path )
return { 'word': basename + '/' if is_dir else basename ,
'dup': 1, 'dup': 1,
'menu': '[Dir]' if is_dir else '[File]' } 'menu': '[Dir]' if is_dir else '[File]' }