Commit graph

11 commits

Author SHA1 Message Date
devangpratap
62a4b451d4 Do not offer symlinks to directories as executables in completion
CompleteExecutablesInPath excluded directories with e.IsDir(), but that is false
for a symlink pointing at a directory. Directories are executable in the
access(2) sense, so such a symlink sitting in a PATH entry passed the X_OK check
and was offered as a command. Use the existing is_dir_or_symlink_to_dir helper,
which already makes this distinction elsewhere in the file.
2026-09-16 20:17:32 -04:00
devangpratap
579c735014 Use GuessMimeType for mime based completion
complete_by_mimepat called mime.TypeByExtension directly, so it saw only the
extensions the Go standard library knows about. Everything else in kitty that
needs a mime type goes through utils.GuessMimeType, which also consults the
user's mime.types, kitty's builtin types and KnownExtensions. As a result
files like foo.py or foo.toml were not offered when completing arguments that
ask for text/*, even though kitten pager opens them as text.
2026-09-16 05:43:17 -04:00
devangpratap
ebb41b83da Fix completion of directories containing files with uppercase extensions
Completion patterns are lowercased in make_completer and file names are
lowercased before being matched against them, but the names of files inside
a directory were passed to the matcher unchanged. A directory whose only
matching file was named something like B.CONF was therefore never offered as
a completion candidate for a *.conf pattern, while the same file named
b.conf worked.
2026-09-16 00:43:53 -04:00
devangpratap
04082039be Fix completion of symlinks to directories for directory arguments 2026-09-15 14:09:41 -04:00
devangpratap
fd904d45d8 Fix completion of paths directly under the root directory 2026-09-15 11:15:04 -04:00
Kovid Goyal
6f588a0c29
run modernize 2025-11-11 17:09:37 +05:30
Kovid Goyal
c861259e3b
Rename go module from kitty -> github.com/kovidgoyal/kitty
Makes the code more easily re-useable in other projects
2025-05-16 08:43:39 +05:30
Kovid Goyal
2b66775f45
explicitly ignore a few errors 2022-12-13 16:19:46 +05:30
Kovid Goyal
4fc91dcc03
There should be no trailing space when completing directories for a file match based on patterns 2022-11-21 11:05:36 +05:30
Kovid Goyal
97716fea8b
More work on merging completions with parse tree 2022-11-14 15:42:02 +05:30
Kovid Goyal
bf74413c1f
Work on merging completion tree with parse tree 2022-11-14 15:42:02 +05:30
Renamed from tools/cli/completion/files.go (Browse further)