| Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
suggested in [0] since it will be help for latex
[0]: https://github.com/martanne/vis/commit/dac6a7e#comments
|
|
{w,}ctype(3) character classes are essentially broken for non-ascii
text. 711447a tried to fix this for words surrounded by blanks but forgot
the use case of completing function and variable names in source code.
Instead of relying on the terrible ctype interface we can hand pick
a set that is good enough for both source code completion and writing
prose. This set is consistent with the old [:alnum:] behaviour for ascii
text but also supports words with single width non-ascii characters.
fixes 711447a: vis-complete: handle non-ascii text
closes #1132: Source code completion are broken
|
|
The '[:alnum:]' set does not include non-ascii text which results in
the non-ascii text being replaced with newlines. Using the '[:blank:]'
set with no complement flag fixes this issue.
|
|
|
|
This commit combines 3 commits:
- vis-open: `local' is not part of POSIX
(Author: Tom Schwindl <schwindl@posteo.de>)
- More POSIXisation.
(Author: Matěj Cepl <mcepl@cepl.eu>)
- Clean up of vis-complete as well.
(Author: Matěj Cepl <mcepl@cepl.eu>)
|
|
The previous commit would generate duplicate entries when files with the
same name exist in more than one directory.
|
|
|
|
Move the "case $PATTERN" block inside "if $COMPLETE_WORD" to make it
clear that it is specific only to the "else" branch.
Eliminate the $START variable - it was used only once, and using
dirname(1) directly is obvious enough.
Remove the comments inside the "case" block (explaining the "what") and
replaced them with a single comment explaining the "why".
|
|
See also discussion in #402.
|
|
|
|
Instead of trying to filter out path-segments-beginning-with-dot from the
entire path (including the prefix, which would be perfectly legitimate),
tell find to prune hidden directories and ignore hidden file as it walks
the tree.
|
|
Because we're completing text from the document, we can't assume it's
going to be a sensible regex pattern, or glob pattern, let alone both,
so we should quote the pattern before we hand it off to helper tools
like grep and find.
|
|
|
|
Previously, vis-complete built up a command-line by repeated subtitution
into a shell variable, then executing that shell variable in a subshell.
I'm not entirely sure what shell-meta-character mischief would have been
possible, but now we just do all the piping in the same shell which is
much safer.
|
|
|
|
This is to avoid issues when handling file paths
|
|
The shell script should be reviewed for quoting issues, currently
it allows command injections as in:
$ vis-complete "'; rm -f some-file; echo "
However it is intended for interactive usage and from within vis
it is only ever called with a valid completion prefix.
The file name completion logic now supports nested directories.
Close #347
|