diff --git a/programs/src/wordprocessor/document.cpp b/programs/src/wordprocessor/document.cpp index 6dc84c7..944f143 100644 --- a/programs/src/wordprocessor/document.cpp +++ b/programs/src/wordprocessor/document.cpp @@ -1027,17 +1027,18 @@ void wp_toggle_list(WordProcessorState* wp, uint8_t list_type) { para->list_type = PARA_LIST_NONE; changed = true; } - if (para->left_indent == WP_LIST_LEFT && para->first_line_indent == WP_LIST_HANGING) { - para->left_indent = 0; + if (para->first_line_indent == WP_LIST_HANGING && para->left_indent >= WP_LIST_LEFT) { + para->left_indent = (int16_t)(para->left_indent - WP_LIST_LEFT); para->first_line_indent = 0; changed = true; } continue; } - if (para->list_type == PARA_LIST_NONE && - para->left_indent == 0 && para->first_line_indent == 0) { - para->left_indent = WP_LIST_LEFT; + if (para->list_type == PARA_LIST_NONE && para->first_line_indent >= 0) { + int new_left = para->left_indent + WP_LIST_LEFT; + if (new_left > 240) new_left = 240; + para->left_indent = (int16_t)new_left; para->first_line_indent = WP_LIST_HANGING; changed = true; }