mirror of
				https://github.com/wting/autojump
				synced 2025-06-13 12:54:07 +00:00 
			
		
		
		
	Only allow adding of existing directories
This commit is contained in:
		
							parent
							
								
									c391c7f394
								
							
						
					
					
						commit
						9aeee1b9b6
					
				@ -139,6 +139,9 @@ def add_path(data, path, weight=10):
 | 
				
			|||||||
    if path == os.path.expanduser('~'):
 | 
					    if path == os.path.expanduser('~'):
 | 
				
			||||||
        return data, Entry(path, 0)
 | 
					        return data, Entry(path, 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if not os.path.isdir(path):
 | 
				
			||||||
 | 
					        return data, Entry(path, 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    data[path] = sqrt((data.get(path, 0) ** 2) + (weight ** 2))
 | 
					    data[path] = sqrt((data.get(path, 0) ** 2) + (weight ** 2))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return data, Entry(path, data[path])
 | 
					    return data, Entry(path, data[path])
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user