Add scr.heightfix

This commit is contained in:
pancake 2013-08-29 05:42:50 +02:00
parent e25567cb09
commit 1168998743
3 changed files with 11 additions and 0 deletions

View File

@ -108,6 +108,7 @@ R_API RCons *r_cons_new () {
I.line = r_line_new ();
I.event_interrupt = NULL;
I.blankline = R_TRUE;
I.heightfix = 0;
I.widthfix = 0;
I.event_resize = NULL;
I.data = NULL;
@ -441,6 +442,8 @@ R_API int r_cons_get_size(int *rows) {
if (ioctl (1, TIOCGWINSZ, &win) == 0) {
I.columns = win.ws_col;
I.rows = win.ws_row-1;
if (I.heightfix)
I.rows--;
} else {
I.columns = 80;
I.rows = 23;

View File

@ -43,6 +43,11 @@ static int config_hexcols_callback(void *user, void *data) {
return R_TRUE;
}
static int config_heightfix_callback(void *user, void *data) {
RConfigNode *node = (RConfigNode *) data;
r_cons_singleton ()->heightfix = node->i_value;
return R_TRUE;
}
static int config_widthfix_callback(void *user, void *data) {
RConfigNode *node = (RConfigNode *) data;
r_cons_singleton ()->widthfix = node->i_value;
@ -832,6 +837,8 @@ r_config_set (cfg, "asm.arch", R_SYS_ARCH);
r_config_desc (cfg, "hex.cols", "Configure the number of columns in hexdump");
r_config_set_cb (cfg, "scr.html", "false", &config_scrhtml_callback);
r_config_desc (cfg, "scr.html", "If enabled disassembly use HTML syntax");
r_config_set_cb (cfg, "scr.heightfix", "false", &config_widthfix_callback);
r_config_desc (cfg, "scr.heightfix", "Workaround for Linux TTY");
r_config_set_cb (cfg, "scr.widthfix", "false", &config_widthfix_callback);
r_config_desc (cfg, "scr.widthfix", "Workaround for Prompt iOS ssh client");
r_config_set (cfg, "search.in", "file");

View File

@ -135,6 +135,7 @@ typedef struct r_cons_t {
char *pager;
int blankline;
int widthfix;
int heightfix;
int truecolor; // 1 = rgb 256), 2 = truecolor (16M)
RConsPalette pal;
struct r_line_t *line;