forked from KolibriOS/kolibrios
t_edit:
fixed color highlighting at the end of the file, scrolling with the mouse wheel 3 lines. git-svn-id: svn://kolibrios.org@7877 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
94487a9544
commit
c82fc5ccb8
@ -2140,30 +2140,30 @@ ted_go_to_pos:
|
|||||||
; edi = pointer to tedit struct
|
; edi = pointer to tedit struct
|
||||||
align 16
|
align 16
|
||||||
ted_text_colored:
|
ted_text_colored:
|
||||||
push eax edx
|
push eax edx
|
||||||
mov eax,ted_tim_ch
|
mov eax,ted_tim_ch
|
||||||
sub eax,ted_tim_undo
|
sub eax,ted_tim_undo
|
||||||
mov ted_tim_co,eax
|
mov ted_tim_co,eax
|
||||||
mov edx,ted_tex
|
mov edx,ted_tex
|
||||||
@@:
|
@@:
|
||||||
call ted_iterat_next
|
call ted_iterat_next
|
||||||
cmp edx,ted_tex_1
|
cmp edx,ted_tex_1
|
||||||
jle @f
|
jle @f
|
||||||
mov byte[edx+1],0
|
mov byte[edx+1],0
|
||||||
jmp @b
|
jmp @b
|
||||||
@@:
|
@@:
|
||||||
|
|
||||||
cmp ted_key_words_count,1
|
cmp ted_key_words_count,1
|
||||||
jl .no_colors
|
jl .no_colors
|
||||||
mov edx,ted_tex
|
mov edx,ted_tex
|
||||||
@@:
|
@@:
|
||||||
call ted_text_find_sel_color
|
call ted_text_find_sel_color
|
||||||
cmp edx,ted_tex_1
|
cmp edx,ted_tex_1
|
||||||
jle .no_colors
|
jle .no_colors
|
||||||
jmp @b
|
jmp @b
|
||||||
.no_colors:
|
.no_colors:
|
||||||
pop edx eax
|
pop edx eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
;input:
|
;input:
|
||||||
@ -2189,10 +2189,10 @@ endl
|
|||||||
mov dword[endPos],1
|
mov dword[endPos],1
|
||||||
mov byte[find],0
|
mov byte[find],0
|
||||||
mov byte[f_color],1
|
mov byte[f_color],1
|
||||||
@@:
|
.cycle0:
|
||||||
call ted_iterat_next
|
call ted_iterat_next
|
||||||
cmp edx,ted_tex_1
|
cmp edx,ted_tex_1
|
||||||
jle @f
|
jle .cycle0end
|
||||||
|
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
mov al,byte[edx]
|
mov al,byte[edx]
|
||||||
@ -2200,7 +2200,7 @@ endl
|
|||||||
add eax,ted_arr_key_pos
|
add eax,ted_arr_key_pos
|
||||||
mov eax,[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 .cycle0 ;if( (word_n=ted_arr_key_pos[(unsigned char)tex[i].c])>-1 ){
|
||||||
|
|
||||||
mov ecx,eax
|
mov ecx,eax
|
||||||
;while(l_pos<ted_key_words_count && Col[l_pos].Text[0]==Col[word_n].Text[0])
|
;while(l_pos<ted_key_words_count && Col[l_pos].Text[0]==Col[word_n].Text[0])
|
||||||
@ -2223,19 +2223,19 @@ align 4
|
|||||||
call ted_iterat_next
|
call ted_iterat_next
|
||||||
|
|
||||||
;while(l_pos>word_n && Col[l_pos-1].Text[pos]!=tex[i].c)
|
;while(l_pos>word_n && Col[l_pos-1].Text[pos]!=tex[i].c)
|
||||||
.wh_3b:
|
@@:
|
||||||
cmp ecx,eax
|
cmp ecx,eax
|
||||||
jle .wh_3e
|
jle @f
|
||||||
dec ecx
|
dec ecx
|
||||||
ColToIndexOffset ecx,ebx
|
ColToIndexOffset ecx,ebx
|
||||||
inc ecx
|
inc ecx
|
||||||
;cmp byte[ebx+esi],byte[edx]
|
;cmp byte[ebx+esi],byte[edx]
|
||||||
mov bl,byte[ebx+esi]
|
mov bl,byte[ebx+esi]
|
||||||
cmp bl,byte[edx]
|
cmp bl,byte[edx]
|
||||||
je .wh_3e
|
je @f
|
||||||
dec ecx
|
dec ecx
|
||||||
jmp .wh_3b
|
jmp @b
|
||||||
.wh_3e:
|
@@:
|
||||||
|
|
||||||
ColToIndexOffset eax,ebx
|
ColToIndexOffset eax,ebx
|
||||||
cmp byte[ebx+esi],0
|
cmp byte[ebx+esi],0
|
||||||
@ -2255,13 +2255,13 @@ align 4
|
|||||||
call ted_iterat_perv
|
call ted_iterat_perv
|
||||||
|
|
||||||
btr bx,0 ;1-1
|
btr bx,0 ;1-1
|
||||||
jae .if_3e ;if(Col[word_n].wwo&1)
|
jae @f ;if(Col[word_n].wwo&1)
|
||||||
;u1= !(isalnum(cont_s)||cont_s=='_')
|
;u1= !(isalnum(cont_s)||cont_s=='_')
|
||||||
call isalnum
|
call isalnum
|
||||||
jae .if_3e
|
jae @f
|
||||||
mov byte[find],0
|
mov byte[find],0
|
||||||
jmp .if_4e
|
jmp .if_4e
|
||||||
.if_3e:
|
@@:
|
||||||
|
|
||||||
btr bx,3 ;4-1
|
btr bx,3 ;4-1
|
||||||
jae .if_4e ;if(Col[word_n].wwo&8)
|
jae .if_4e ;if(Col[word_n].wwo&8)
|
||||||
@ -2275,13 +2275,13 @@ align 4
|
|||||||
;call ted_iterat_next
|
;call ted_iterat_next
|
||||||
|
|
||||||
btr bx,1 ;2-1
|
btr bx,1 ;2-1
|
||||||
jae .if_5e ;if(Col[word_n].wwo&2)
|
jae @f ;if(Col[word_n].wwo&2)
|
||||||
;u1= !(isalnum(cont_s)||cont_s=='_')
|
;u1= !(isalnum(cont_s)||cont_s=='_')
|
||||||
call isalnum
|
call isalnum
|
||||||
jae .if_5e
|
jae @f
|
||||||
mov byte[find],0
|
mov byte[find],0
|
||||||
jmp .if_6e
|
jmp .if_6e
|
||||||
.if_5e:
|
@@:
|
||||||
|
|
||||||
btr bx,4 ;5-1
|
btr bx,4 ;5-1
|
||||||
jae .if_6e ;if(Col[word_n].wwo&16)
|
jae .if_6e ;if(Col[word_n].wwo&16)
|
||||||
@ -2297,7 +2297,10 @@ align 4
|
|||||||
mov bx,word[ebx+MAX_COLOR_WORD_LEN+5]
|
mov bx,word[ebx+MAX_COLOR_WORD_LEN+5]
|
||||||
call ted_iterat_next_pos_char
|
call ted_iterat_next_pos_char
|
||||||
cmp edx,ted_tex_1
|
cmp edx,ted_tex_1
|
||||||
jle .if_7e
|
jg @f
|
||||||
|
;¥á«¨ ¤®è«¨ ¤® ª®æ ä ©« ¨ ¥ 諨 ᨬ¢®« ª®æ à §¬¥âª¨
|
||||||
|
call ted_iterat_perv
|
||||||
|
@@:
|
||||||
mov dword[endPos],edx
|
mov dword[endPos],edx
|
||||||
.if_7e:
|
.if_7e:
|
||||||
|
|
||||||
@ -2336,10 +2339,10 @@ align 4
|
|||||||
.wh_2e:
|
.wh_2e:
|
||||||
|
|
||||||
cmp byte[find],1 ;if(fnd)break;
|
cmp byte[find],1 ;if(fnd)break;
|
||||||
je @f
|
je .cycle0end
|
||||||
mov edx,[begPos];i=bP;
|
mov edx,[begPos];i=bP;
|
||||||
jmp @b
|
jmp .cycle0
|
||||||
@@:
|
.cycle0end:
|
||||||
|
|
||||||
cmp byte[find],1
|
cmp byte[find],1
|
||||||
jne .if_1e ;if(fnd){ // ¢ë¤¥«¥¨¥ ©¤¥®£® ⥪áâ
|
jne .if_1e ;if(fnd){ // ¢ë¤¥«¥¨¥ ©¤¥®£® ⥪áâ
|
||||||
@ -4331,20 +4334,16 @@ ted_wnd_main_mouse_scroll:
|
|||||||
or ax,ax
|
or ax,ax
|
||||||
jz .no_scroll
|
jz .no_scroll
|
||||||
mov ecx,ted_scr_w
|
mov ecx,ted_scr_w
|
||||||
mov ebx,[ecx+sb_offs_position] ;copy old scroll position
|
movsx eax,ax
|
||||||
and eax,0xffff
|
lea eax,[eax+eax*2] ;㬮¦ ¥¬ 3 (ç¨á«® áâப ¯à®ªàã⪨ § ®¤® ¤¢¨¦¥¨¥ ª®«¥á ¬ëè¨)
|
||||||
btr ax,15
|
add eax,[ecx+sb_offs_position]
|
||||||
jae @f
|
mov ebx,[ecx+sb_offs_max_area]
|
||||||
or eax,0xffff8000
|
shl ebx,1
|
||||||
@@:
|
sub ebx,[ecx+sb_offs_cur_area] ;®â¨¬ ¥¬ ¯®«®¢¨ã ¢ëá®âë ®ª
|
||||||
add [ecx+sb_offs_position],eax
|
shr ebx,1
|
||||||
|
cmp eax,ebx
|
||||||
mov eax,[ecx+sb_offs_position]
|
jae .no_scroll
|
||||||
cmp eax,[ecx+sb_offs_max_area]
|
mov [ecx+sb_offs_position],eax
|
||||||
jb @f
|
|
||||||
mov [ecx+sb_offs_position],ebx ;if scroll position out of range
|
|
||||||
jmp .no_scroll
|
|
||||||
@@:
|
|
||||||
stdcall ted_draw,edi
|
stdcall ted_draw,edi
|
||||||
.no_scroll:
|
.no_scroll:
|
||||||
pop ecx ebx eax
|
pop ecx ebx eax
|
||||||
|
Loading…
Reference in New Issue
Block a user