Better blank file

This commit is contained in:
neauoire 2021-01-10 12:15:18 -08:00
parent 7bc0833241
commit f84b620cc8
4 changed files with 8 additions and 19 deletions

3
.gitignore vendored
View File

@ -3,4 +3,5 @@
*png~
*gif~
theme.svg
left
left
untitled.txt

View File

@ -23,4 +23,4 @@ then
fi
# run
./left example.txt
./left example.txt

View File

@ -1,13 +1,4 @@
ajdfka
a
Tabbed
2Tabbed
int
int
int
int
/* comment */
comment

11
left.c
View File

@ -412,7 +412,7 @@ drawdecor(Uint32 *dst)
drawicon(dst, HOR * 8 - 7, y * 8, icons[view.y >= ls * y ? 5 : 4], selected >= ls * y ? 1 : 4, 0);
if(GUIDES) /* ruler */
drawicon(dst, RULER * 8, y * 8, icons[0], 4, 0);
if(lineid < lmax) { /* line number */
if(lineid <= lmax) { /* line number */
drawicon(dst, 0 * 8, y * 8, font[lineid < 100 ? '.' - 32 : '0' + ((lineid / 100) % 10) - 32], lineid == selected ? 2 : 3, 0);
drawicon(dst, 1 * 8, y * 8, font[lineid < 10 ? '.' - 32 : '0' + ((lineid / 10) % 10) - 32], lineid == selected ? 2 : 3, 0);
drawicon(dst, 2 * 8, y * 8, font['0' + (lineid % 10) - 32], lineid == selected ? 2 : 3, 0);
@ -596,15 +596,12 @@ selectoption(int option)
void
newtxt(void)
{
sel.from = 0;
sel.to = 0;
doc.text = (char *)malloc(TEXTSZ);
doc.text[0] = '\n';
doc.text[1] = '\0';
doc.len = 2;
doc.text[0] = '\0';
doc.len = 0;
scpy("untitled.txt", doc.name, 256);
printf("Created: %s\n", doc.name);
redraw(pixels);
setselection(0, -1);
}
int