Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Regression in braces completion



On Oct 11,  9:32pm, Bart Schaefer wrote:
}
} On Oct 11, 10:32pm, Vin Shelton wrote:
} }
} } $ ls abc{d<TAB>  ==>
} } $ ls abcdef{
} } 
} } which is not correct.
} 
} : _main_complete:62:then elif; [[ abcdef != */* && a == \~ ]]
} 
} That's $PREFIX on line 62 and the curly brace is already missing.

Turns out that's a red herring, it was that way in the older version
as well.

As nearly as I can track it down, the problem is with:

	* 25130 slightly tweaked for typos:
	Completion/Unix/Type/_path_files: changes to use -U flag
	to compadd so that spelling corrections in non-final
	path segments are accepted.

If I remove the -U option from all the calls to compadd in _path_files,
the old behavior is restored.

(That took *way* longer to track down than it should have, because I
didn't realize just how *many* calls to "compadd -U" there are, and I
missed the crucial one the first time and ended up chasing a different
red herring for an hour.  Oy.)

Removing the -U *only* from the compadd on line 634 of _path_files is
sufficient to fix this particular example, but I wonder if it should be
removed from all three of the compadd calls in the "we are listing, or
something" branch (see comment line 605), or if it needs to be omitted
based on some other condition ... or if we need to know when spelling
correction has been done so we can only add -U when we have to, or some
even more complicated set of conditions.



Messages sorted by: Reverse Date, Date, Thread, Author