aboutsummaryrefslogtreecommitdiffstats
path: root/noice.c
diff options
context:
space:
mode:
authordok <dok@grehack.fr>2019-01-06 16:38:13 +0100
committersin <sin@2f30.org>2019-01-19 17:08:40 +0000
commit3ae2cb00d7db3a1aec7d0687bdc32c814d96581a (patch)
tree2f98ee40aa4874f9b12866ce1e0a561b8262f07f /noice.c
parent383abc8aa9265f3a81142973106dcaeaded63e85 (diff)
downloadnoice-3ae2cb00d7db3a1aec7d0687bdc32c814d96581a.tar.gz
Add case insensitive comparison
Diffstat (limited to 'noice.c')
-rw-r--r--noice.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/noice.c b/noice.c
index 4040855..67b14d9 100644
--- a/noice.c
+++ b/noice.c
@@ -66,6 +66,7 @@ enum action {
SEL_CDHOME,
SEL_TOGGLEDOT,
SEL_MTIME,
+ SEL_ICASE,
SEL_REDRAW,
SEL_RUN,
SEL_RUNARG,
@@ -271,7 +272,10 @@ entrycmp(const void *va, const void *vb)
if (mtimeorder)
return b->t - a->t;
- return strcmp(a->name, b->name);
+ if (icaseorder)
+ return strcasecmp(a->name, b->name);
+ else
+ return strcmp(a->name, b->name);
}
void
@@ -797,6 +801,12 @@ nochange:
if (ndents > 0)
mkpath(path, dents[cur].name, oldpath, sizeof(oldpath));
goto begin;
+ case SEL_ICASE:
+ icaseorder = !icaseorder;
+ /* Save current */
+ if (ndents > 0)
+ mkpath(path, dents[cur].name, oldpath, sizeof(oldpath));
+ goto begin;
case SEL_REDRAW:
/* Save current */
if (ndents > 0)
Un proyecto texto-plano.xyz