Skip to content

Commit

Permalink
remove read-only mode
Browse files Browse the repository at this point in the history
The reason it existed was speed now normal mode is just as fast, better use a proper pager like less
  • Loading branch information
ikozyris committed Oct 4, 2024
1 parent 3309837 commit 1ba3bea
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ int main(int argc, char *argv[])
"License: GNU GPL v3\n");
puts("Usage:\n"
" --help, -h Show this help\n"
"<file> --read-only, -ro Just read, like a pager\n"
"<file> Open file and allow edits\n"
"- Ask for file name on save\n\n"
"Keybindings:\n"
Expand Down Expand Up @@ -275,40 +274,6 @@ int main(int argc, char *argv[])
break;
}
}
//*/ readonly mode
ro:
wclear(ln_win);
do {
switch (ch) {
case UP:
if (ppi >= previndx || ppi >= buf_indx)
ppi = 0;
else
ppi = previndx;
printed = print_text_w(ppi);
if (buf_indx > printed)
previndx = buf_indx - printed;
else
previndx = 0;
break;
case DOWN:
previndx = buf_indx - printed;
printed = print_text_w(buf_indx);
break;
case EXIT:
goto stop;
}
#ifdef HIGHLIGHT
for (unsigned i = 0; i < maxy - 1; ++i)
apply(i);
#endif
mvwprintw(ln_win, 1, 0, "%3u", buf_indx);
mvwprintw(ln_win, 3, 0, "%3u", printed);
mvwprintw(ln_win, 5, 0, "%3u", previndx);
mvwprintw(ln_win, 7, 0, "%3u", ppi);
wrefresh(ln_win);

} while ((ch = wgetch(text_win)));
stop:
free(lnbuf);
delwin(text_win);
Expand Down

0 comments on commit 1ba3bea

Please sign in to comment.