add [Ctrl+X] for cut text in 't_edit'

git-svn-id: svn://kolibrios.org@7497 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2018-10-21 20:10:31 +00:00
parent 7650334f5e
commit 17f128e429

View File

@ -1,6 +1,6 @@
; ¬ ªà®á ¤«ï á¨á⥬­®© ¡¨¡«¨®â¥ª¨ box_lib.obj ; ¬ ªà®á ¤«ï á¨á⥬­®© ¡¨¡«¨®â¥ª¨ box_lib.obj
; í«¥¬¥­â TextEditor ¤«ï Kolibri OS ; í«¥¬¥­â TextEditor ¤«ï Kolibri OS
; ä ©« ¯®á«¥¤­¨© à § ¨§¬¥­ï«áï 20.02.2016 IgorA ; ä ©« ¯®á«¥¤­¨© à § ¨§¬¥­ï«áï 21.10.2018 IgorA
; ­  ª®¤ ¯à¨¬¥­¥­  GPL2 «¨æ¥­§¨ï ; ­  ª®¤ ¯à¨¬¥­¥­  GPL2 «¨æ¥­§¨ï
;input: ;input:
@ -275,6 +275,10 @@ proc ted_key, edit:dword, table:dword, control:dword
jne @f jne @f
stdcall ted_but_undo,edi stdcall ted_but_undo,edi
@@: @@:
cmp ah,45 ;Ctrl+X
jne @f
stdcall ted_but_cut,edi
@@:
cmp ah,46 ;Ctrl+C cmp ah,46 ;Ctrl+C
jne @f jne @f
stdcall ted_but_copy,edi stdcall ted_but_copy,edi
@ -609,13 +613,13 @@ align 16
proc ted_sel_start uses eax ecx proc ted_sel_start uses eax ecx
mov eax,ted_scr_h mov eax,ted_scr_h
mov ecx,ted_cur_x mov ecx,ted_cur_x
add ecx,dword[eax+sb_offs_position] add ecx,[eax+sb_offs_position]
mov ted_sel_x0,ecx mov ted_sel_x0,ecx
mov ted_sel_x1,ecx mov ted_sel_x1,ecx
mov eax,ted_scr_w mov eax,ted_scr_w
mov ecx,ted_cur_y mov ecx,ted_cur_y
add ecx,dword[eax+sb_offs_position] add ecx,[eax+sb_offs_position]
mov ted_sel_y0,ecx mov ted_sel_y0,ecx
mov ted_sel_y1,ecx mov ted_sel_y1,ecx
ret ret
@ -630,12 +634,12 @@ proc ted_sel_move
push eax ecx push eax ecx
mov ecx,ted_cur_x mov ecx,ted_cur_x
mov eax,ted_scr_h mov eax,ted_scr_h
add ecx,dword[eax+sb_offs_position] add ecx,[eax+sb_offs_position]
mov ted_sel_x1,ecx mov ted_sel_x1,ecx
mov eax,ted_scr_w mov eax,ted_scr_w
mov ecx,ted_cur_y mov ecx,ted_cur_y
add ecx,dword[eax+sb_offs_position] add ecx,[eax+sb_offs_position]
mov ted_sel_y1,ecx mov ted_sel_y1,ecx
pop ecx eax pop ecx eax
cmp ted_fun_draw_panel_buttons,0 ;redraw toolbar (need to button Copy) cmp ted_fun_draw_panel_buttons,0 ;redraw toolbar (need to button Copy)
@ -900,7 +904,7 @@ ted_iterat_perv:
je .else je .else
push ebx push ebx
@@: @@:
mov edx,dword[edx+2] mov edx,[edx+2]
cmp edx,0 cmp edx,0
je @f je @f
imul edx,sizeof.symbol imul edx,sizeof.symbol
@ -917,7 +921,7 @@ ted_iterat_perv:
pop ebx pop ebx
ret ret
.else: .else:
mov edx,dword[edx+2] mov edx,[edx+2]
cmp edx,0 cmp edx,0
je @f je @f
imul edx,sizeof.symbol imul edx,sizeof.symbol
@ -943,7 +947,7 @@ ted_iterat_next:
je .else je .else
push ebx push ebx
@@: @@:
mov edx,dword[edx+6] mov edx,[edx+6]
cmp edx,1 cmp edx,1
jle @f jle @f
imul edx,sizeof.symbol imul edx,sizeof.symbol
@ -961,7 +965,7 @@ ted_iterat_next:
pop ebx pop ebx
ret ret
.else: .else:
mov edx,dword[edx+6] mov edx,[edx+6]
cmp edx,1 cmp edx,1
jle @f jle @f
imul edx,sizeof.symbol imul edx,sizeof.symbol
@ -1088,7 +1092,7 @@ proc ted_text_add, edit:dword, text:dword, t_len:dword, add_opt:dword
jl .no_add ;ª®£¤  ¤«¨­­  <1 ¯à룠¥¬ ­  ª®­¥æ ä㭪樨, ¢® ¨§¡¥¦ ­¨¥ £«îª®¢ jl .no_add ;ª®£¤  ¤«¨­­  <1 ¯à룠¥¬ ­  ª®­¥æ ä㭪樨, ¢® ¨§¡¥¦ ­¨¥ £«îª®¢
mov edi,[edit] mov edi,[edit]
mov esi,dword[text] mov esi,[text]
call ted_get_pos_by_cursor call ted_get_pos_by_cursor
call ted_get_text_perv_pos call ted_get_text_perv_pos
@ -1099,35 +1103,35 @@ proc ted_text_add, edit:dword, text:dword, t_len:dword, add_opt:dword
je @f je @f
push eax ;c_sp=cur[cn].x+Scroller->XPos-StrLen(cur[cn].y+Scroller->YPos); push eax ;c_sp=cur[cn].x+Scroller->XPos-StrLen(cur[cn].y+Scroller->YPos);
mov eax,ted_scr_h mov eax,ted_scr_h
mov eax,dword[eax+sb_offs_position] mov eax,[eax+sb_offs_position]
add eax,ted_cur_x ;eax - ­®¬¥à ᨬ¢®«  add eax,ted_cur_x ;eax - ­®¬¥à ᨬ¢®« 
mov dword[new_spc],eax mov [new_spc],eax
mov eax,ted_scr_w mov eax,ted_scr_w
mov eax,dword[eax+sb_offs_position] mov eax,[eax+sb_offs_position]
add eax,ted_cur_y ;eax - ­®¬¥à áâப¨ add eax,ted_cur_y ;eax - ­®¬¥à áâப¨
call ted_strlen ;ebx = line len call ted_strlen ;ebx = line len
sub dword[new_spc],ebx ;®â ¯®§¨æ¨¨ ªãàá®à  ®â­¨¬ ¥¬ ¤«¨­­ã áâப¨, 㧭 ¥¬ ª®««¨ç¥á⢮ ¤®¡ ¢«ï¥¬ëå ¯à®¡¥«®¢ sub [new_spc],ebx ;®â ¯®§¨æ¨¨ ªãàá®à  ®â­¨¬ ¥¬ ¤«¨­­ã áâப¨, 㧭 ¥¬ ª®««¨ç¥á⢮ ¤®¡ ¢«ï¥¬ëå ¯à®¡¥«®¢
pop eax pop eax
@@: @@:
mov ebx,dword[t_len] mov ebx,[t_len]
mov dword[new_lin],0 mov dword[new_lin],0
cmp ted_gp_opt,0 cmp ted_gp_opt,0
jne @f jne @f
push eax push eax
mov eax,ted_scr_w mov eax,ted_scr_w
mov eax,dword[eax+sb_offs_position] mov eax,[eax+sb_offs_position]
add eax,ted_cur_y add eax,ted_cur_y
inc eax inc eax
mov dword[new_lin],eax mov [new_lin],eax
call ted_get_num_lines call ted_get_num_lines
sub dword[new_lin],eax sub [new_lin],eax
;㢥«¨ç¨¢ ¥¬ «¨­¨¨ ¢ áªà®««¨­£¥ ­  ç¨á«® ¤®¡ ¢«¥­­ëå ¤®¯®«­¨â¥«ì­ëå áâப ;㢥«¨ç¨¢ ¥¬ «¨­¨¨ ¢ áªà®««¨­£¥ ­  ç¨á«® ¤®¡ ¢«¥­­ëå ¤®¯®«­¨â¥«ì­ëå áâப
mov ecx,ted_scr_w mov ecx,ted_scr_w
add dword[ecx+sb_offs_max_area],eax ;㢥«¨ç¨¢ ¥¬ à §¬¥à ¢¥à⨪ «ì­®£® áªà®««¨­£  add [ecx+sb_offs_max_area],eax ;㢥«¨ç¨¢ ¥¬ à §¬¥à ¢¥à⨪ «ì­®£® áªà®««¨­£ 
pop eax pop eax
@@: @@:
@ -1302,11 +1306,11 @@ align 4
align 16 align 16
proc ted_but_convert_by_table uses eax edx edi esi, edit:dword, table:dword proc ted_but_convert_by_table uses eax edx edi esi, edit:dword, table:dword
mov edi,[edit] mov edi,[edit]
mov esi,dword[table] mov esi,[table]
mov edx,ted_tex mov edx,ted_tex
.cycle: .cycle:
;¯¥à¥å®¤¨¬ ­  á«¥¤ãî騩 ᨬ¢®« ;¯¥à¥å®¤¨¬ ­  á«¥¤ãî騩 ᨬ¢®«
mov edx,dword[edx+6] mov edx,[edx+6]
cmp edx,1 cmp edx,1
jle .end_text jle .end_text
imul edx,sizeof.symbol imul edx,sizeof.symbol
@ -1402,7 +1406,7 @@ endp
align 16 align 16
proc ted_text_del uses ecx edx edi, edit:dword, del_opt:dword proc ted_text_del uses ecx edx edi, edit:dword, del_opt:dword
mov edi,[edit] mov edi,[edit]
mov ebx,dword[del_opt] mov ebx,[del_opt]
xor cl,cl xor cl,cl
test ebx,ted_opt_ed_move_cursor test ebx,ted_opt_ed_move_cursor
@ -1578,8 +1582,8 @@ align 16
ted_cur_move_down: ted_cur_move_down:
push eax ebx push eax ebx
mov ebx,ted_scr_w mov ebx,ted_scr_w
mov dl,0 xor dl,dl
mov eax,dword[ebx+sb_offs_cur_area] mov eax,[ebx+sb_offs_cur_area]
dec eax dec eax
cmp ted_cur_y,eax cmp ted_cur_y,eax
jge @f jge @f
@ -1588,9 +1592,9 @@ ted_cur_move_down:
jmp .ret_f jmp .ret_f
@@: @@:
mov eax,ted_cur_y mov eax,ted_cur_y
add eax,dword[ebx+sb_offs_position] add eax,[ebx+sb_offs_position]
inc eax inc eax
cmp dword[ebx+sb_offs_max_area],eax cmp [ebx+sb_offs_max_area],eax
jle @f jle @f
inc dword[ebx+sb_offs_position] inc dword[ebx+sb_offs_position]
mov dl,8 mov dl,8
@ -1607,24 +1611,24 @@ ted_cur_move_down:
; dl = 1 if move up ; dl = 1 if move up
align 16 align 16
ted_cur_move_page_up: ted_cur_move_page_up:
push eax ebx push eax ebx
mov ebx,ted_scr_w mov ebx,ted_scr_w
mov eax,dword[ebx+sb_offs_cur_area] mov eax,[ebx+sb_offs_cur_area]
xor dl,dl xor dl,dl
cmp eax,dword[ebx+sb_offs_position] cmp eax,[ebx+sb_offs_position]
jg @f jg @f
sub dword[ebx+sb_offs_position],eax sub [ebx+sb_offs_position],eax
mov dl,1 mov dl,1
@@: @@:
cmp dword[ebx+sb_offs_position],0 cmp dword[ebx+sb_offs_position],0
je @f je @f
cmp dl,1 cmp dl,1
je @f je @f
mov dword[ebx+sb_offs_position],0 mov dword[ebx+sb_offs_position],0
mov dl,1 mov dl,1
@@: @@:
pop ebx eax pop ebx eax
ret ret
;input: ;input:
; edi = pointer to tedit struct ; edi = pointer to tedit struct
@ -1634,17 +1638,17 @@ ted_cur_move_page_down:
mov ecx,ted_scr_w mov ecx,ted_scr_w
xor dl,dl xor dl,dl
mov eax,dword[ecx+sb_offs_max_area] mov eax,[ecx+sb_offs_max_area]
sub eax,dword[ecx+sb_offs_cur_area] sub eax,[ecx+sb_offs_cur_area]
cmp dword[ecx+sb_offs_position],eax cmp [ecx+sb_offs_position],eax
jge @f jge @f
mov ebx,dword[ecx+sb_offs_cur_area] mov ebx,[ecx+sb_offs_cur_area]
add dword[ecx+sb_offs_position],ebx add [ecx+sb_offs_position],ebx
mov dl,1 mov dl,1
mov dword[ecx+sb_offs_redraw],1 mov dword[ecx+sb_offs_redraw],1
cmp dword[ecx+sb_offs_position],eax cmp [ecx+sb_offs_position],eax
jle @f jle @f
mov dword[ecx+sb_offs_position],eax mov [ecx+sb_offs_position],eax
@@: @@:
pop ecx ebx eax pop ecx ebx eax
ret ret
@ -1705,7 +1709,7 @@ ted_cur_move_right:
push eax ebx push eax ebx
mov eax,ted_scr_h mov eax,ted_scr_h
xor dl,dl xor dl,dl
mov ebx,dword[eax+sb_offs_cur_area] mov ebx,[eax+sb_offs_cur_area]
cmp ted_cur_x,ebx cmp ted_cur_x,ebx
jge @f jge @f
inc ted_cur_x inc ted_cur_x
@ -1728,23 +1732,23 @@ ted_cur_move_x_last_char:
push eax ebx ecx push eax ebx ecx
mov eax,ted_cur_y mov eax,ted_cur_y
mov ecx,ted_scr_w mov ecx,ted_scr_w
add eax,dword[ecx+sb_offs_position] add eax,[ecx+sb_offs_position]
call ted_strlen call ted_strlen
xor dl,dl xor dl,dl
mov ecx,ted_scr_h mov ecx,ted_scr_h
cmp ebx,dword[ecx+sb_offs_position] cmp ebx,[ecx+sb_offs_position]
jge @f jge @f
mov dl,8 mov dl,8
mov dword[ecx+sb_offs_position],ebx mov [ecx+sb_offs_position],ebx
@@: @@:
sub ebx,dword[ecx+sb_offs_position] sub ebx,[ecx+sb_offs_position]
cmp ebx,dword[ecx+sb_offs_cur_area] cmp ebx,[ecx+sb_offs_cur_area]
jle @f ; b---[---]---e jle @f ; b---[---]---e
add dword[ecx+sb_offs_position],ebx add [ecx+sb_offs_position],ebx
mov ebx,dword[ecx+sb_offs_cur_area] mov ebx,[ecx+sb_offs_cur_area]
sub dword[ecx+sb_offs_position],ebx sub [ecx+sb_offs_position],ebx
mov dl,8 mov dl,8
@@: @@:
mov ted_cur_x,ebx mov ted_cur_x,ebx
@ -1798,7 +1802,7 @@ ted_get_text_arr_index:
; edx = pointer to 'perv' struct ; edx = pointer to 'perv' struct
align 16 align 16
ted_get_text_perv_pos: ted_get_text_perv_pos:
mov edx,dword[edx+2] mov edx,[edx+2]
imul edx,sizeof.symbol imul edx,sizeof.symbol
add edx,ted_tex add edx,ted_tex
ret ret
@ -1809,7 +1813,7 @@ ted_get_text_perv_pos:
; edx = pointer to 'next' symbol struct ; edx = pointer to 'next' symbol struct
align 16 align 16
ted_get_text_next_pos: ted_get_text_next_pos:
mov edx,dword[edx+6] mov edx,[edx+6]
imul edx,sizeof.symbol imul edx,sizeof.symbol
add edx,ted_tex add edx,ted_tex
ret ret
@ -1826,10 +1830,10 @@ ted_get_pos_by_cursor:
push eax ecx esi push eax ecx esi
mov esi,ted_cur_x mov esi,ted_cur_x
mov eax,ted_scr_h mov eax,ted_scr_h
add esi,dword[eax+sb_offs_position] add esi,[eax+sb_offs_position]
mov ecx,ted_cur_y mov ecx,ted_cur_y
mov eax,ted_scr_w mov eax,ted_scr_w
add ecx,dword[eax+sb_offs_position] add ecx,[eax+sb_offs_position]
call ted_get_pos_by_coords call ted_get_pos_by_coords
pop esi ecx eax pop esi ecx eax
ret ret
@ -2053,15 +2057,15 @@ ted_go_to_pos:
push eax push eax
mov eax,ted_scr_w mov eax,ted_scr_w
mov ted_cur_x,ecx mov ted_cur_x,ecx
sub edx,dword[eax+sb_offs_position] sub edx,[eax+sb_offs_position]
cmp edx,dword[eax+sb_offs_cur_area] ;ted_cur_y > [.cur_area] cmp edx,[eax+sb_offs_cur_area] ;ted_cur_y > [.cur_area]
jl @f jl @f
push ebx push ebx
mov ebx,edx mov ebx,edx
sub ebx,dword[eax+sb_offs_cur_area] sub ebx,[eax+sb_offs_cur_area]
inc ebx inc ebx
add dword[eax+sb_offs_position],ebx add [eax+sb_offs_position],ebx
sub edx,ebx sub edx,ebx
pop ebx pop ebx
; ??? redrav ; ??? redrav
@ -2132,7 +2136,7 @@ endl
mov al,byte[edx] mov al,byte[edx]
shl ax,2 ;eax*=4 shl ax,2 ;eax*=4
add eax,ted_arr_key_pos add eax,ted_arr_key_pos
mov eax,dword[eax] mov eax,[eax]
cmp eax,0 cmp eax,0
jl @b ;if( (word_n=ted_arr_key_pos[(unsigned char)tex[i].c])>-1 ){ jl @b ;if( (word_n=ted_arr_key_pos[(unsigned char)tex[i].c])>-1 ){
@ -2150,7 +2154,7 @@ endl
jmp .wh_1b jmp .wh_1b
.wh_1e: .wh_1e:
mov dword[begPos],edx ;bP=i; mov [begPos],edx ;bP=i;
mov esi,1 mov esi,1
align 4 align 4
.wh_2b: ;while(1){ .wh_2b: ;while(1){
@ -2174,18 +2178,18 @@ align 4
ColToIndexOffset eax,ebx ColToIndexOffset eax,ebx
cmp byte[ebx+esi],0 cmp byte[ebx+esi],0
jne .if_0 ;if(Col[word_n].Text[pos]==0){ jne .if_0 ;if(Col[word_n].Text[pos]==0){
mov dword[endPos],edx ;eP=i; mov [endPos],edx ;eP=i;
ColToIndexOffset eax,ebx ColToIndexOffset eax,ebx
mov bl,byte[ebx+MAX_COLOR_WORD_LEN+7] mov bl,[ebx+MAX_COLOR_WORD_LEN+7]
mov byte[f_color],bl ;f_color=Col[word_n].color; mov [f_color],bl ;f_color=Col[word_n].color;
mov byte[find],1 mov byte[find],1
ColToIndexOffset eax,ebx ;... ebx = Col[word_n] ColToIndexOffset eax,ebx ;... ebx = Col[word_n]
mov bl,byte[ebx+MAX_COLOR_WORD_LEN+4] mov bl,[ebx+MAX_COLOR_WORD_LEN+4]
cmp bl,0 ;if(Col[word_n].wwo) cmp bl,0 ;if(Col[word_n].wwo)
je .if_2n je .if_2n
push edx push edx
mov edx,dword[begPos] mov edx,[begPos]
call ted_iterat_perv call ted_iterat_perv
btr bx,0 ;1-1 btr bx,0 ;1-1
@ -2205,7 +2209,7 @@ align 4
mov byte[find],0 mov byte[find],0
.if_4e: .if_4e:
mov edx,dword[endPos] mov edx,[endPos]
;call ted_iterat_next ;call ted_iterat_next
btr bx,1 ;2-1 btr bx,1 ;2-1
@ -2271,20 +2275,20 @@ align 4
cmp byte[find],1 ;if(fnd)break; cmp byte[find],1 ;if(fnd)break;
je @f je @f
mov edx,dword[begPos];i=bP; mov edx,[begPos];i=bP;
jmp @b jmp @b
@@: @@:
cmp byte[find],1 cmp byte[find],1
jne .if_1e ;if(fnd){ // ¢ë¤¥«¥­¨¥ ­ ©¤¥­®£® ⥪áâ  jne .if_1e ;if(fnd){ // ¢ë¤¥«¥­¨¥ ­ ©¤¥­®£® ⥪áâ 
;if(!mode_sf1 || (mode_sf1 && strlen(Col[word_n].f1->c_str())>0)){ ;if(!mode_sf1 || (mode_sf1 && strlen(Col[word_n].f1->c_str())>0)){
mov eax,dword[begPos] mov eax,[begPos]
mov bl,byte[f_color] mov bl,[f_color]
mov byte[eax+1],bl ;tex[bP].col=f_color; mov [eax+1],bl ;tex[bP].col=f_color;
mov eax,dword[endPos] mov eax,[endPos]
mov byte[eax+1],0xff ;tex[eP].col=255; mov byte[eax+1],0xff ;tex[eP].col=255;
;return ItPoPerv(eP); // ¢®§¢à é ¥¬ ¯®§¨æ¨î ª®­æ  ¢å®¦¤¥­¨ï ;return ItPoPerv(eP); // ¢®§¢à é ¥¬ ¯®§¨æ¨î ª®­æ  ¢å®¦¤¥­¨ï
mov edx,dword[endPos] mov edx,[endPos]
call ted_get_text_perv_pos call ted_get_text_perv_pos
jmp @f jmp @f
.if_1e: .if_1e:
@ -2366,23 +2370,23 @@ proc ted_find_help_id, end_pos:dword
push ebx ecx push ebx ecx
xor ebx,ebx xor ebx,ebx
mov bl,byte[edx] mov bl,[edx]
shl bx,2 ;ebx*=4 shl bx,2 ;ebx*=4
add ebx,ted_arr_key_pos add ebx,ted_arr_key_pos
mov ecx,dword[ebx] mov ecx,[ebx]
cmp ecx,0 cmp ecx,0
jl .if_0e ;if( (word_n=ted_arr_key_pos[(unsigned char)tf[0]])>-1 ){ jl .if_0e ;if( (word_n=ted_arr_key_pos[(unsigned char)tf[0]])>-1 ){
push esi eax push esi eax
mov ebx,ecx ;l_pos=word_n; mov ebx,ecx ;l_pos=word_n;
ColToIndexOffset ecx,esi ColToIndexOffset ecx,esi
push cx push cx
mov cl,byte[esi] mov cl,[esi]
@@: @@:
cmp ebx,ted_key_words_count ;while(l_pos<ted_key_words_count) cmp ebx,ted_key_words_count ;while(l_pos<ted_key_words_count)
jge @f jge @f
;ColToIndexOffset ecx,esi ;ColToIndexOffset ecx,esi
ColToIndexOffset ebx,eax ColToIndexOffset ebx,eax
cmp cl,byte[eax] ;&& Col[l_pos].Text[0]==Col[word_n].Text[0]) cmp cl,[eax] ;&& Col[l_pos].Text[0]==Col[word_n].Text[0])
jne @f jne @f
inc ebx ;l_pos++; inc ebx ;l_pos++;
jmp @b jmp @b
@ -2420,7 +2424,7 @@ proc ted_find_help_id, end_pos:dword
cmp ecx,ebx ;if(word_n==l_pos) break; cmp ecx,ebx ;if(word_n==l_pos) break;
je @f je @f
call ted_iterat_next ;pos++; call ted_iterat_next ;pos++;
cmp edx,dword[end_pos] ;for(...;i<strlen;...) cmp edx,[end_pos] ;for(...;i<strlen;...)
je @f ;jge je @f ;jge
inc esi inc esi
jmp @b jmp @b
@ -2544,6 +2548,8 @@ proc ted_but_select_word, edit:dword
ret ret
endp endp
;output:
; al = 1 if delete
align 16 align 16
proc ted_but_cut uses edi, edit:dword proc ted_but_cut uses edi, edit:dword
mov edi,[edit] mov edi,[edit]
@ -2562,8 +2568,6 @@ proc ted_but_cut uses edi, edit:dword
ret ret
endp endp
;output:
; al = 1 if copy text
align 16 align 16
proc ted_but_copy, edit:dword proc ted_but_copy, edit:dword
pushad pushad
@ -2644,7 +2648,7 @@ proc ted_but_paste, edit:dword
je .no_buf_r je .no_buf_r
cmp eax,-1 cmp eax,-1
je .no_buf_r je .no_buf_r
mov ecx,dword[eax] mov ecx,[eax]
cmp ecx,1 ;size cmp ecx,1 ;size
jl .no_buf_r jl .no_buf_r
cmp dword[eax+4],0 ;text cmp dword[eax+4],0 ;text
@ -2863,12 +2867,12 @@ ted_key_ctrl_end:
push eax ebx push eax ebx
call ted_get_num_lines call ted_get_num_lines
mov ebx,ted_scr_w mov ebx,ted_scr_w
mov dword[ebx+sb_offs_position],eax ;áâ ¢¨¬ ¯®«§ã­®ª ­  ¯®á«¥¤­îî áâப㠤®ªã¬¥­â  mov [ebx+sb_offs_position],eax ;áâ ¢¨¬ ¯®«§ã­®ª ­  ¯®á«¥¤­îî áâப㠤®ªã¬¥­â 
cmp eax,dword[ebx+sb_offs_cur_area] cmp eax,[ebx+sb_offs_cur_area]
jle @f jle @f
mov eax,dword[ebx+sb_offs_cur_area] ;¯®«ãç ¥¬ ç¨á«® áâப ¢« §ïé¨å ¢ ®ª­® mov eax,[ebx+sb_offs_cur_area] ;¯®«ãç ¥¬ ç¨á«® áâப ¢« §ïé¨å ¢ ®ª­®
@@: @@:
sub dword[ebx+sb_offs_position],eax ;®â­¨¬ ¥¬ ®â ¯®«§ã­ª  ç¨á«® áâப ¢« §ïé¨å ¢ ®ª­® (­® ­¥ ¡®«ìè¥ â¥å, çâ® ¥áâì ¢ ¤®ªã¬¥­â¥) sub [ebx+sb_offs_position],eax ;®â­¨¬ ¥¬ ®â ¯®«§ã­ª  ç¨á«® áâப ¢« §ïé¨å ¢ ®ª­® (­® ­¥ ¡®«ìè¥ â¥å, çâ® ¥áâì ¢ ¤®ªã¬¥­â¥)
dec eax dec eax
mov ted_cur_y,eax ;áâ ¢¨¬ ªãàá®à ­  ¯®á«¥¤­îî áâப㠤®ªã¬¥­â  mov ted_cur_y,eax ;áâ ¢¨¬ ªãàá®à ­  ¯®á«¥¤­îî áâப㠤®ªã¬¥­â 
pop ebx eax pop ebx eax
@ -3080,7 +3084,7 @@ ted_get_symb_color:
shl ax,2 ;㬭®¦ ¥¬ ¨­¤¥ªá æ¢¥â  ­  4 ¡ ©â  shl ax,2 ;㬭®¦ ¥¬ ¨­¤¥ªá æ¢¥â  ­  4 ¡ ©â 
mov ecx,ted_text_colors ;¯à¨¡ ¢«ï¥¬ ᬥ饭¨¥ 1-£® æ¢¥â  mov ecx,ted_text_colors ;¯à¨¡ ¢«ï¥¬ ᬥ饭¨¥ 1-£® 梥â 
add ecx,eax add ecx,eax
mov ecx,dword[ecx] ;ãáâ ­ ¢«¨¢ ¥¬ ⥪ã騩 梥â ⥪áâ  ¯® ᬥ饭¨î mov ecx,[ecx] ;ãáâ ­ ¢«¨¢ ¥¬ ⥪ã騩 梥â ⥪áâ  ¯® ᬥ饭¨î
.exit: .exit:
or ecx,ted_font_size or ecx,ted_font_size
pop edx eax pop edx eax
@ -3141,7 +3145,7 @@ proc ted_draw, edit:dword
mov eax,SF_DRAW_TEXT mov eax,SF_DRAW_TEXT
mov ecx,ted_text_colors mov ecx,ted_text_colors
mov ecx,dword[ecx] mov ecx,[ecx]
mov ebx,ted_wnd_l mov ebx,ted_wnd_l
add ebx,ted_rec_l add ebx,ted_rec_l
@ -3772,7 +3776,7 @@ proc ted_clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_l
mov bx,dx mov bx,dx
jmp .no_wnd jmp .no_wnd
.in_wnd: .in_wnd:
mov bx,0 xor bx,bx
.no_wnd: .no_wnd:
mov edx,ted_color_wnd_work mov edx,ted_color_wnd_work
int 0x40 int 0x40