summaryrefslogtreecommitdiff
path: root/src/completion.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2025-02-19 22:08:11 +1100
committerMaxime Coste <mawww@kakoune.org>2025-02-19 23:02:03 +1100
commitb3f95ee69b4cf8b5ad643647f96adb5cdf0f3997 (patch)
treea8b2020dbfdd1088913f7a08f3a4716c7cc7e82f /src/completion.cc
parentf910d6cb657ff39df5c536929e4146f88acda93f (diff)
Slight style tweaks
Diffstat (limited to 'src/completion.cc')
-rw-r--r--src/completion.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/completion.cc b/src/completion.cc
index d1e10f08..1544f6a7 100644
--- a/src/completion.cc
+++ b/src/completion.cc
@@ -70,9 +70,7 @@ CandidateList complete_command(StringView prefix, ByteCount cursor_pos)
{
Vector<String> files;
list_files(dirname, [&](StringView filename, const struct stat& st) {
- bool executable = (st.st_mode & S_IXUSR)
- | (st.st_mode & S_IXGRP)
- | (st.st_mode & S_IXOTH);
+ bool executable = st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH);
if (S_ISDIR(st.st_mode) or (S_ISREG(st.st_mode) and executable))
files.push_back(filename.str());
});
@@ -109,9 +107,7 @@ CandidateList complete_command(StringView prefix, ByteCount cursor_pos)
{
cache.commands.clear();
list_files(dirname, [&](StringView filename, const struct stat& st) {
- bool executable = (st.st_mode & S_IXUSR)
- | (st.st_mode & S_IXGRP)
- | (st.st_mode & S_IXOTH);
+ bool executable = st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH);
if (S_ISREG(st.st_mode) and executable)
cache.commands.push_back(filename.str());
});