Commit 1e6e062f9716c1a129d71ab98b1844dea0c90711

Authored by Perry Werneck
1 parent 954cd60b

Fixing error on select from keyboard.

Showing 1 changed file with 7 additions and 1 deletions   Show diff stats
src/lib3270/cursor.c
... ... @@ -77,6 +77,8 @@ static int cursor_end(H3270 *hSession);
77 77 */
78 78 LIB3270_EXPORT int lib3270_move_cursor(H3270 *hSession, LIB3270_DIRECTION dir, unsigned char sel)
79 79 {
  80 + int select_from = -1;
  81 +
80 82 FAIL_IF_NOT_ONLINE(hSession);
81 83  
82 84 if(dir < 0 || dir >= LIB3270_DIR_COUNT)
... ... @@ -102,12 +104,16 @@ LIB3270_EXPORT int lib3270_move_cursor(H3270 *hSession, LIB3270_DIRECTION dir, u
102 104 }
103 105 }
104 106  
  107 + if(sel) {
  108 + select_from = (hSession->selected ? hSession->select.start : hSession->cursor_addr);
  109 + }
  110 +
105 111 int rc = calls[dir].exec(hSession);
106 112 if(rc)
107 113 return rc;
108 114  
109 115 if(sel)
110   - lib3270_select_to(hSession,hSession->cursor_addr);
  116 + lib3270_select_region(hSession, select_from, hSession->cursor_addr);
111 117 else if(hSession->selected && !lib3270_get_toggle(hSession,LIB3270_TOGGLE_KEEP_SELECTED))
112 118 lib3270_unselect(hSession);
113 119  
... ...