157,31 → 157,31 |
cdq;xor edx,edx |
mov ecx,LINEH |
idiv ecx |
@@: add eax,[cur_tab.Editor.TopLeft.Y] ;! eax,[top_line] |
@@: add eax,[cur_editor.TopLeft.Y] ;! eax,[top_line] |
mov ebx,eax |
pop eax |
cdq;xor edx,edx |
mov ecx,6 |
idiv ecx |
@@: add eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col] |
@@: add eax,[cur_editor.TopLeft.X] ;! eax,[left_col] |
|
cmp eax,[cur_tab.Editor.Columns] ;! eax,[columns] |
cmp eax,[cur_editor.Columns.Count] ;! eax,[columns] |
jl @f |
mov eax,[cur_tab.Editor.Columns] ;! eax,[columns] |
@@: cmp ebx,[cur_tab.Editor.Lines] ;! ebx,[lines] |
mov eax,[cur_editor.Columns.Count] ;! eax,[columns] |
@@: cmp ebx,[cur_editor.Lines.Count] ;! ebx,[lines] |
jl @f |
mov ebx,[cur_tab.Editor.Lines] ;! ebx,[lines] |
mov ebx,[cur_editor.Lines.Count] ;! ebx,[lines] |
dec ebx |
@@: |
cmp [cur_tab.Editor.Caret.X],eax ;! [pos.x],eax |
cmp [cur_editor.Caret.X],eax ;! [pos.x],eax |
jne .change_cur_pos |
cmp [cur_tab.Editor.Caret.Y],ebx ;! [pos.y],ebx |
cmp [cur_editor.Caret.Y],ebx ;! [pos.y],ebx |
je still.skip_write |
|
.change_cur_pos: |
mov [cur_tab.Editor.Caret.X],eax ;! [pos.x],eax |
mov eax,[cur_tab.Editor.Caret.Y] ;! eax,[pos.y] |
mov [cur_tab.Editor.Caret.Y],ebx ;! [pos.y],ebx |
mov [cur_editor.Caret.X],eax ;! [pos.x],eax |
mov eax,[cur_editor.Caret.Y] ;! eax,[pos.y] |
mov [cur_editor.Caret.Y],ebx ;! [pos.y],ebx |
call check_cur_vis_inv |
jc .check_ldown |
; cmp eax,ebx |
213,20 → 213,20 |
; sub ebx,[__rc+0x4] |
cmp [vscrl_capt],0 |
jge .vcaptured |
mov eax,[cur_tab.Editor.VScroll.Top] ;! eax,[vscrl_top] |
mov eax,[cur_editor.VScroll.Top] ;! eax,[vscrl_top] |
cmp ebx,eax |
jb .center_vcapture |
add eax,[cur_tab.Editor.VScroll.Size] ;! eax,[vscrl_size] |
add eax,[cur_editor.VScroll.Size] ;! eax,[vscrl_size] |
cmp ebx,eax |
jae .center_vcapture |
mov eax,ebx |
sub eax,[cur_tab.Editor.VScroll.Top] ;! eax,[vscrl_top] |
sub eax,[cur_editor.VScroll.Top] ;! eax,[vscrl_top] |
dec eax |
mov [vscrl_capt],eax |
dec ebx |
jmp .vcaptured |
.center_vcapture: |
mov eax,[cur_tab.Editor.VScroll.Size] ;! eax,[vscrl_size] |
mov eax,[cur_editor.VScroll.Size] ;! eax,[vscrl_size] |
shr eax,1 |
mov [vscrl_capt],eax |
.vcaptured: |
236,24 → 236,24 |
@@: mov [mouse_captured],1 |
mov eax,[bot_ofs] |
sub eax,[top_ofs] |
sub eax,[cur_tab.Editor.VScroll.Size] ;! eax,[vscrl_size] |
sub eax,[cur_editor.VScroll.Size] ;! eax,[vscrl_size] |
sub eax,SCRLW*3-2 |
cmp eax,ebx |
jge @f |
mov ebx,eax |
@@: |
mov [cur_tab.Editor.VScroll.Top],ebx ;! [vscrl_top],ebx |
mov eax,[cur_tab.Editor.Lines] ;! eax,[lines] |
mov [cur_editor.VScroll.Top],ebx ;! [vscrl_top],ebx |
mov eax,[cur_editor.Lines.Count] ;! eax,[lines] |
sub eax,[lines.scr] |
imul ebx |
mov ebx,[bot_ofs] |
sub ebx,[top_ofs] |
sub ebx,SCRLW*3-2 ;** |
sub ebx,[cur_tab.Editor.VScroll.Size] ;! ebx,[vscrl_size] |
sub ebx,[cur_editor.VScroll.Size] ;! ebx,[vscrl_size] |
idiv ebx |
cmp eax,[cur_tab.Editor.TopLeft.Y] ;! eax,[top_line] |
cmp eax,[cur_editor.TopLeft.Y] ;! eax,[top_line] |
je still.skip_write |
mov [cur_tab.Editor.TopLeft.Y],eax ;! [top_line],eax |
mov [cur_editor.TopLeft.Y],eax ;! [top_line],eax |
call check_bottom_right |
call draw_file |
jmp still.skip_write |
274,20 → 274,20 |
; sub ebx,[__rc+0x0] |
cmp [hscrl_capt],0 |
jge .hcaptured |
mov eax,[cur_tab.Editor.HScroll.Top] ;! eax,[hscrl_top] |
mov eax,[cur_editor.HScroll.Top] ;! eax,[hscrl_top] |
cmp ebx,eax |
jl .center_hcapture |
add eax,[cur_tab.Editor.HScroll.Size] ;! eax,[hscrl_size] |
add eax,[cur_editor.HScroll.Size] ;! eax,[hscrl_size] |
cmp ebx,eax |
jge .center_hcapture |
mov eax,ebx |
sub eax,[cur_tab.Editor.HScroll.Top] ;! eax,[hscrl_top] |
sub eax,[cur_editor.HScroll.Top] ;! eax,[hscrl_top] |
dec eax |
mov [hscrl_capt],eax |
dec ebx |
jmp .hcaptured |
.center_hcapture: |
mov eax,[cur_tab.Editor.HScroll.Size] ;! eax,[hscrl_size] |
mov eax,[cur_editor.HScroll.Size] ;! eax,[hscrl_size] |
shr eax,1 |
mov [hscrl_capt],eax |
.hcaptured: |
296,23 → 296,23 |
xor ebx,ebx |
@@: mov [mouse_captured],1 |
mov eax,[p_info.box.width] |
sub eax,[cur_tab.Editor.HScroll.Size] ;! eax,[hscrl_size] |
sub eax,[cur_editor.HScroll.Size] ;! eax,[hscrl_size] |
sub eax,SCRLW*3+10+1 |
cmp eax,ebx |
jge @f |
mov ebx,eax |
@@: |
mov [cur_tab.Editor.HScroll.Top],ebx ;! [hscrl_top],ebx |
mov eax,[cur_tab.Editor.Columns] ;! eax,[columns] |
mov [cur_editor.HScroll.Top],ebx ;! [hscrl_top],ebx |
mov eax,[cur_editor.Columns.Count] ;! eax,[columns] |
sub eax,[columns.scr] |
imul ebx |
mov ebx,[p_info.box.width] |
sub ebx,SCRLW*3+10+1 ;** |
sub ebx,[cur_tab.Editor.HScroll.Size] ;! ebx,[hscrl_size] |
sub ebx,[cur_editor.HScroll.Size] ;! ebx,[hscrl_size] |
idiv ebx |
cmp eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col] |
cmp eax,[cur_editor.TopLeft.X] ;! eax,[left_col] |
je still.skip_write |
mov [cur_tab.Editor.TopLeft.X],eax ;! [left_col],eax |
mov [cur_editor.TopLeft.X],eax ;! [left_col],eax |
call check_bottom_right |
call draw_file |
jmp still.skip_write |
347,78 → 347,3 |
mov [mouse_captured],0 |
mov [just_from_popup],0 |
jmp still.skip_write |
|
|
func setup_main_menu_popup |
mov ebx,[p_info.box.left] |
add ebx,[p_info.client_box.left] |
@@: dec ecx |
jz @f |
add edx,8+1 |
movzx esi,byte[edx-1] |
add edx,esi |
jmp @b |
@@: movzx ecx,word[edx+2] |
add ebx,ecx |
|
mov [eax+POPUP.x],bx |
mov ebx,[p_info.box.top] |
add ebx,[p_info.client_box.top] |
add ebx,ATOPH-1 |
mov [eax+POPUP.y],bx |
mov [POPUP_STACK],eax |
ret |
endf |
|
onshow: |
|
.file: |
or byte[mm.File+3],0x01 |
cmp [f_info.length],0 |
jne @f |
and byte[mm.File+3],0xFE |
@@: ret |
|
.edit: |
or byte[mm.Edit+2],0x01 |
cmp [copy_size],0 |
jne @f |
and byte[mm.Edit+2],0xFE |
@@: or dword[mm.Edit+0],0x01000101 |
cmp [sel.selected],0 |
jne @f |
and dword[mm.Edit+0],0xFEFFFEFE |
@@: ret |
|
.search: |
mov byte[mm.Search+0],0 |
;mov byte[mm.Search+4],0 |
ret |
.run: |
ret |
.recode: |
ret |
.options: |
mov word[mm.Options+0],0 |
mov byte[mm.Options+5],0 |
or byte[mm.Options+2],0x02 |
test [options],OPTS_SECURESEL |
jnz @f |
and byte[mm.Options+2],0xFD |
@@: or byte[mm.Options+3],0x02 |
test [options],OPTS_AUTOBRACES |
jnz @f |
and byte[mm.Options+3],0xFD |
@@: or byte[mm.Options+4],0x02 |
test [options],OPTS_AUTOINDENT |
jnz @f |
and byte[mm.Options+4],0xFD |
@@: or byte[mm.Options+6],0x02 |
test [options],OPTS_OPTIMSAVE |
jnz @f |
and byte[mm.Options+6],0xFD |
@@: or byte[mm.Options+8],0x02 |
test [options],OPTS_LINENUMS |
jnz @f |
and byte[mm.Options+8],0xFD |
@@: ret |