commit df114a3730140548cc7c9e76bc96a450e0897caa
parent c812c9f2ba6c81c14435cbb719368a18160e8877
Author: siduck <siduck@tutanota.com>
Date: Tue, 12 Jul 2022 17:27:42 +0530
misc | fix scrolling not working in nvim
Diffstat:
5 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/Makefile b/Makefile
@@ -65,7 +65,7 @@ uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/st-copyout
rm -f $(DESTDIR)$(PREFIX)/bin/st-urlhandler
rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1
- rm -f $(DESTDIR)$(PREFIX)/share/applications/st.desktop
rm -f $(DESTDIR)$(ICONPREFIX)/$(ICONNAME)
+ rm -f $(DESTDIR)$(PREFIX)/share/applications/st.desktop
.PHONY: all options clean dist install uninstall
diff --git a/st.c b/st.c
@@ -288,9 +288,9 @@ xrealloc(void *p, size_t len)
char *
xstrdup(const char *s)
{
- char *p;
+ char *p;
- if ((p = strdup(s)) == NULL)
+ if ((p = strdup(s)) == NULL)
die("strdup: %s\n", strerror(errno));
return p;
@@ -819,7 +819,7 @@ ttynew(const char *line, char *cmd, const char *out, char **args)
if (ioctl(s, TIOCSCTTY, NULL) < 0)
die("ioctl TIOCSCTTY failed: %s\n", strerror(errno));
if (s > 2)
- close(s);
+ close(s);
#ifdef __OpenBSD__
if (pledge("stdio getpw proc exec", NULL) == -1)
die("pledge\n");
@@ -1292,7 +1292,7 @@ tmoveto(int x, int y)
}
void
-tsetchar(Rune u, const Glyph *attr, int x, int y)
+tsetchar(Rune u,const Glyph *attr, int x, int y)
{
static const char *vt100_0[62] = { /* 0x41 - 0x7e */
"↑", "↓", "→", "←", "█", "▚", "☃", /* A - G */
@@ -1577,7 +1577,7 @@ tsetscroll(int t, int b)
}
void
-tsetmode(int priv, int set, const int *args, int narg)
+tsetmode(int priv, int set,const int *args, int narg)
{
int alt; const int *lim;
@@ -1956,7 +1956,7 @@ strhandle(void)
case ']': /* OSC -- Operating System Command */
switch (par) {
case 0:
- if (narg > 1) {
+ if (narg > 1) {
xsettitle(strescseq.args[1]);
xseticontitle(strescseq.args[1]);
}
@@ -2627,7 +2627,7 @@ check_control_code:
if (width == 2) {
gp->mode |= ATTR_WIDE;
if (term.c.x+1 < term.col) {
- if (gp[1].mode == ATTR_WIDE && term.c.x+2 < term.col) {
+ if (gp[1].mode == ATTR_WIDE && term.c.x+2 < term.col) {
gp[2].u = ' ';
gp[2].mode &= ~ATTR_WDUMMY;
}
diff --git a/st.desktop b/st.desktop
@@ -2,7 +2,7 @@
Type=Application
Name=st
Comment=simple-terminal emulator for X
-Icon=utilities-terminal
+Icon=st
Exec=st
Categories=System;TerminalEmulator
StartupWMClass=st-256color
diff --git a/st.h b/st.h
@@ -113,7 +113,7 @@ void tnew(int, int);
void tresize(int, int);
void tsetdirtattr(int);
void ttyhangup(void);
-int ttynew(const char *, char *,const char *, char **);
+int ttynew(const char *, char *, const char *, char **);
size_t ttyread(void);
void ttyresize(int, int);
void ttywrite(const char *, size_t, int);
diff --git a/x.c b/x.c
@@ -110,7 +110,7 @@ typedef struct {
Window win;
Drawable buf;
GlyphFontSpec *specbuf; /* font spec buffer used for rendering */
- Atom xembed, wmdeletewin, netwmname, netwmicon, netwmiconname, netwmpid;
+ Atom xembed, wmdeletewin, netwmname, netwmicon, netwmiconname, netwmpid;
XIM xim;
XIC xic;
Draw draw;
@@ -414,7 +414,8 @@ mousereport(XEvent *e)
} else {
button -= Button1;
if (button >= 3)
- button += 128 - 7;
+ if (button >= 7)
+ button += 128 - 7;
else if (button >= 3)
button += 64 - 3;
}
@@ -862,8 +863,8 @@ xclearwin(void)
void
xhints(void)
{
- XClassHint class = {opt_name ? opt_name : termname,
- opt_class ? opt_class : termname};
+ XClassHint class = {opt_name ? opt_name : "st",
+ opt_class ? opt_class : "St"};
XWMHints wm = {.flags = InputHint, .input = 1};
XSizeHints *sizeh;
@@ -992,7 +993,7 @@ xloadfonts(const char *fontstr, double fontsize)
if (fontstr[0] == '-')
pattern = XftXlfdParse(fontstr, False, False);
else
- pattern = FcNameParse((const FcChar8 *)fontstr);
+ pattern = FcNameParse((const FcChar8 *)fontstr);
if (!pattern)
die("can't open font %s\n", fontstr);
@@ -2295,9 +2296,9 @@ resource_load(XrmDatabase db, char *name, enum resource_type rtype, void *dst)
XrmValue ret;
snprintf(fullname, sizeof(fullname), "%s.%s",
- opt_name ? opt_name : termname, name);
+ opt_name ? opt_name : "st", name);
snprintf(fullclass, sizeof(fullclass), "%s.%s",
- opt_class ? opt_class : termname, name);
+ opt_class ? opt_class : "St", name);
fullname[sizeof(fullname) - 1] = fullclass[sizeof(fullclass) - 1] = '\0';
XrmGetResource(db, fullname, fullclass, &type, &ret);