summaryrefslogtreecommitdiff
path: root/apps/plugins/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lib')
-rw-r--r--apps/plugins/lib/printcell_helper.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/plugins/lib/printcell_helper.c b/apps/plugins/lib/printcell_helper.c
index f34636585e..42de444c57 100644
--- a/apps/plugins/lib/printcell_helper.c
+++ b/apps/plugins/lib/printcell_helper.c
@@ -192,7 +192,9 @@ static inline int calcvisible(int screen, int vp_w, int text_offset, int sbwidth
192 uint16_t *screencolwidth = printcell.colw[screen]; 192 uint16_t *screencolwidth = printcell.colw[screen];
193 int screenicnwidth = printcell.iconw[screen]; 193 int screenicnwidth = printcell.iconw[screen];
194 int offset = 0; 194 int offset = 0;
195 int selcellw = screencolwidth[printcell.selcol] + text_offset; 195 int selcellw = 0;
196 if (printcell.selcol >= 0)
197 selcellw = screencolwidth[printcell.selcol] + text_offset;
196 int maxw = vp_w - (sbwidth + selcellw + 1); 198 int maxw = vp_w - (sbwidth + selcellw + 1);
197 199
198 for (int i = printcell.selcol - 1; i >= 0; i--) 200 for (int i = printcell.selcol - 1; i >= 0; i--)
@@ -304,7 +306,11 @@ static void printcell_listdraw_fn(struct list_putlineinfo_t *list_info)
304 306
305 if (selected_flag & SELECTED_FLAG) 307 if (selected_flag & SELECTED_FLAG)
306 { 308 {
307 printcell.selcol_index = sidx[printcell.selcol]; /* save the item offset*/ 309 if (printcell.selcol >= 0)
310 printcell.selcol_index = sidx[printcell.selcol]; /* save the item offset*/
311 else
312 printcell.selcol_index = -1;
313
308 cursor = Icon_Cursor; 314 cursor = Icon_Cursor;
309 /* limit length of selection if columns don't reach end */ 315 /* limit length of selection if columns don't reach end */
310 int maxw = nx + printcell.totalcolw[screen] + printcell.iconw[screen]; 316 int maxw = nx + printcell.totalcolw[screen] + printcell.iconw[screen];