Use compopt -o nospace only for a query prefix
Similarly to long options treatment, suspend space only when completing what looks like a query or account prefix i.e. something ending with a colon (:).
This commit is contained in:
		
							parent
							
								
									797301c3dc
								
							
						
					
					
						commit
						34dbe3b3a8
					
				| @ -97,8 +97,6 @@ _hledger_completion_function() { | ||||
|     esac | ||||
| 
 | ||||
|     # Offer query filters and accounts for the rest | ||||
|     # Do not sort. Keep accounts and query filters grouped separately | ||||
|     compopt -o nosort -o nospace | ||||
|     _hledger_compreply "$(_hledger_compgen "$_hledger_complist_query_filters")" | ||||
|     if [[ -z $cur ]]; then | ||||
|         _hledger_compreply_append "$( | ||||
| @ -110,6 +108,11 @@ _hledger_completion_function() { | ||||
|         )" | ||||
|     fi | ||||
| 
 | ||||
|     # Suspend space on completion of query prefix | ||||
|     # Do not sort, keep accounts and query filters grouped separately | ||||
|     [[ ${COMPREPLY[0]} == *: ]] && compopt -o nospace | ||||
|     compopt -o nosort | ||||
| 
 | ||||
|     return 0 | ||||
| } | ||||
| 
 | ||||
|  | ||||
| @ -97,8 +97,6 @@ _hledger_completion_function() { | ||||
|     esac | ||||
| 
 | ||||
|     # Offer query filters and accounts for the rest | ||||
|     # Do not sort. Keep accounts and query filters grouped separately | ||||
|     compopt -o nosort -o nospace | ||||
|     _hledger_compreply "$(_hledger_compgen "$_hledger_complist_query_filters")" | ||||
|     if [[ -z $cur ]]; then | ||||
|         _hledger_compreply_append "$( | ||||
| @ -110,6 +108,11 @@ _hledger_completion_function() { | ||||
|         )" | ||||
|     fi | ||||
| 
 | ||||
|     # Suspend space on completion of query prefix | ||||
|     # Do not sort, keep accounts and query filters grouped separately | ||||
|     [[ ${COMPREPLY[0]} == *: ]] && compopt -o nospace | ||||
|     compopt -o nosort | ||||
| 
 | ||||
|     return 0 | ||||
| } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user