apps/ircc: drop color handling from text_nextline (line scanner only)

text_insert_newlines already inserts soft newlines into the buffer, so
text_nextline normally just finds them; its column-count path only fires
on a spaceless line wider than the textbox. Handling mIRC colors there -
especially in the backward scroll scan - added complexity for a
negligible edge and desynced forward/backward width. Color skipping
stays in text_insert_newlines (wrapping) and draw_channel_text (render).
This commit is contained in:
Burer committed 2026-07-02 15:29:22 +03:00
1 parent 9ebd6fa97d
commit bdd00201c8
1 file changed
-19
-19
View File
@@ -84,10 +84,6 @@ text_nextline:
je .done
cmp al, 13
je .done
cmp al, 3 ; mIRC color escape - skip args without counting width
je .skip_color
cmp al, 0x20 ; other control char - skip without counting
jb .loop
and al, 0xc0
cmp al, 0x80
je .loop ; This byte is the second, third or fourth byte of a multi-byte UTF8 char
@@ -95,21 +91,6 @@ text_nextline:
jnz .loop
.done:
ret
.skip_color:
; In backward scans (called with DF set from draw_channel_text scroll loop),
; color args precede \x03 in buffer and have already been counted as plain
; chars. Forward-parsing them here would corrupt esi, so fall back to the
; pre-PR behavior of treating \x03 as a regular 1-width character.
pushfd
pop eax ; AL is reloaded by lodsb on .loop re-entry
test eax, 1 shl 10 ; DF set = backward direction
jnz .skip_color_backward
call skip_mirc_color_args
jmp .loop
.skip_color_backward:
dec ecx
jnz .loop
ret ; ecx hit 0: same as .done fallthrough
;----------------------------------
; print string