1
0

more stuff to the wind

This commit is contained in:
Deven Blake 2021-05-11 14:19:56 -04:00
parent 742839139e
commit 2098d06185

View File

@ -99,17 +99,6 @@ cleanup(void)
XCloseDisplay(dpy);
}
static char *
cistrstr(const char *s, const char *sub)
{
size_t len;
for (len = strlen(sub); *s; s++)
if (!strncasecmp(s, sub, len))
return (char *)s;
return NULL;
}
static int
drawitem(struct item *item, int x, int y, int w)
{
@ -241,33 +230,6 @@ insert(const char *str, ssize_t n)
match();
}
static size_t
nextrune(int inc)
{
ssize_t n;
/* return location of next utf8 rune in the given direction (+1 or -1) */
for (n = cursor + inc; n + inc >= 0 && (text[n] & 0xc0) == 0x80; n += inc)
;
return n;
}
static void
movewordedge(int dir)
{
if (dir < 0) { /* move cursor to the start of the word*/
while (cursor > 0 && strchr(worddelimiters, text[nextrune(-1)]))
cursor = nextrune(-1);
while (cursor > 0 && !strchr(worddelimiters, text[nextrune(-1)]))
cursor = nextrune(-1);
} else { /* move cursor to the end of the word */
while (text[cursor] && strchr(worddelimiters, text[cursor]))
cursor = nextrune(+1);
while (text[cursor] && !strchr(worddelimiters, text[cursor]))
cursor = nextrune(+1);
}
}
static void
paste(void)
{
@ -455,7 +417,7 @@ int
main(int argc, char *argv[])
{
XWindowAttributes wa;
int i, fast = 0;
int i;
for (i = 1; i < argc; i++)
/* these options take no arguments */