Changeset f7a8052 in mainline
- Timestamp:
- 2022-02-08T12:22:28Z (3 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0436aec
- Parents:
- 7eec25fc
- git-author:
- Jiri Svoboda <jiri@…> (2022-02-07 18:22:17)
- git-committer:
- Jiri Svoboda <jiri@…> (2022-02-08 12:22:28)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/clui/tinput.c
r7eec25fc rf7a8052 172 172 } 173 173 174 /** Update text_coord, prompt_coord in case the screen could have scrolled. */ 175 static void tinput_update_origin(tinput_t *ti) 176 { 177 unsigned end_coord = ti->text_coord + ti->nc; 174 /** Update text_coord, prompt_coord in case the screen would scroll 175 * due to @a end_coord being beyond the end of the screen 176 * 177 * @param ti Text input 178 * @param end_coord Linear screen coordinate to which the cursor would 179 * be moved if the screen would not have scrolled 180 */ 181 static void tinput_update_origin_coord(tinput_t *ti, unsigned end_coord) 182 { 178 183 unsigned end_row = LIN_TO_ROW(ti, end_coord); 179 184 … … 188 193 } 189 194 195 /** Update text_coord, prompt_coord in case the screen could have scrolled. */ 196 static void tinput_update_origin(tinput_t *ti) 197 { 198 /* Account for scrolling until the end of the input text */ 199 tinput_update_origin_coord(ti, ti->text_coord + ti->nc); 200 } 201 190 202 static void tinput_jump_after(tinput_t *ti) 191 203 { … … 203 215 204 216 ti->prompt_coord = row0 * ti->con_cols + col0; 217 ti->text_coord = ti->prompt_coord; 218 tinput_display_prompt(ti); 219 220 /* The screen might have scrolled after priting the prompt */ 221 tinput_update_origin_coord(ti, ti->prompt_coord + str_width(ti->prompt)); 222 205 223 ti->text_coord = ti->prompt_coord + str_length(ti->prompt); 206 207 tinput_display_prompt(ti);208 224 tinput_display_tail(ti, 0, 0); 225 226 /* The screen might have scrolled after priting the text */ 227 tinput_update_origin(ti); 228 209 229 tinput_position_caret(ti); 210 230
Note:
See TracChangeset
for help on using the changeset viewer.