KFar: fix conflict mouse and f3 mode, clean code

git-svn-id: svn://kolibrios.org@8960 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2021-06-28 20:25:58 +00:00
parent abe070e442
commit 9f0eae6809
4 changed files with 506 additions and 480 deletions

View File

@ -63,7 +63,7 @@ edit_block_header:
end virtual end virtual
edit_file: edit_file:
mov eax, [ebp + panel1_files - panel1_data] mov eax, [ebp + PanelData.files]
mov ecx, [eax+ecx*4] mov ecx, [eax+ecx*4]
test byte [ecx], 10h test byte [ecx], 10h
jz .file jz .file
@ -107,7 +107,7 @@ edit_file:
pop eax pop eax
ret ret
.memok: .memok:
lea esi, [ebp + panel1_dir - panel1_data] lea esi, [ebp + PanelData.dir]
push eax push eax
push ecx push ecx
mov ecx, eax mov ecx, eax
@ -123,14 +123,14 @@ edit_file:
mov [ebp + editor_data.memsize], ebx mov [ebp + editor_data.memsize], ebx
mov al, [EditEOLStyle] mov al, [EditEOLStyle]
mov [ebp + editor_data.eol], al mov [ebp + editor_data.eol], al
mov eax, dword [esi + panel1_hPlugin - panel1_dir] mov eax, dword [esi + panel1.hPlugin - panel1.dir]
mov [ebp + editor_data.hPlugin], eax mov [ebp + editor_data.hPlugin], eax
test eax, eax test eax, eax
jz .nocopyhostname jz .nocopyhostname
lea edi, [ebp + editor_data.hostname] lea edi, [ebp + editor_data.hostname]
push esi push esi
mov eax, dword [esi + panel1_parents - panel1_dir] mov eax, dword [esi + panel1.parents - panel1.dir]
mov esi, dword [esi + panel1_parents_sz - panel1_dir] mov esi, dword [esi + panel1.parents_sz - panel1.dir]
add esi, eax add esi, eax
@@: @@:
dec esi dec esi
@ -145,7 +145,7 @@ edit_file:
jnz @b jnz @b
pop esi pop esi
.nocopyhostname: .nocopyhostname:
mov eax, dword [esi + panel1_hFile - panel1_dir] mov eax, dword [esi + panel1.hFile - panel1.dir]
mov [ebp + editor_data.hFile], eax mov [ebp + editor_data.hFile], eax
mov [ebp + editor_data.encoding], encodings.cp866 mov [ebp + editor_data.encoding], encodings.cp866
xor eax, eax xor eax, eax

View File

@ -3,7 +3,7 @@ delete_file_worker:
; out: eax=0 - OK, eax=1 - retry, eax=2 - skip, eax=-1 - cancel, ; out: eax=0 - OK, eax=1 - retry, eax=2 - skip, eax=-1 - cancel,
; PF, ZF, CF and SF set accordingly to 'cmp eax,2' (or 'cmp al,2') ; PF, ZF, CF and SF set accordingly to 'cmp eax,2' (or 'cmp al,2')
push ebx push ebx
push 70 push SF_FILE
pop eax pop eax
mov ebx, delinfo mov ebx, delinfo
int 0x40 int 0x40
@ -51,7 +51,7 @@ delete_file:
; out: CF and ZF not set <=> cancel job ("ja cancel_label") ; out: CF and ZF not set <=> cancel job ("ja cancel_label")
pushad pushad
mov [del_dir_stack_ptr], del_dir_stack mov [del_dir_stack_ptr], del_dir_stack
lea esi, [ebp + panel1_dir - panel1_data] lea esi, [ebp + PanelData.dir]
mov edi, execdata mov edi, execdata
@@: @@:
lodsb lodsb
@ -99,7 +99,7 @@ delete_file:
mov [ebx+dirinfo.size-dirinfo], del_dir_query_size mov [ebx+dirinfo.size-dirinfo], del_dir_query_size
mov [ebx+dirinfo.dirdata-dirinfo], del_dir_query_area mov [ebx+dirinfo.dirdata-dirinfo], del_dir_query_area
mov [ebx+dirinfo.name-dirinfo], execdata mov [ebx+dirinfo.name-dirinfo], execdata
push 70 push SF_FILE
pop eax pop eax
int 0x40 int 0x40
; if we get read error, the best available action is try to delete directory itself ; if we get read error, the best available action is try to delete directory itself
@ -214,7 +214,7 @@ makedir:
; create directory with name from CopyDestEditBuf+12 ; create directory with name from CopyDestEditBuf+12
; destroys eax ; destroys eax
push ebx push ebx
push 70 push SF_FILE
pop eax pop eax
mov ebx, mkdirinfo mov ebx, mkdirinfo
int 0x40 int 0x40
@ -352,7 +352,7 @@ copy_file_worker2:
mov ebx, eax mov ebx, eax
jmp .copyreadok jmp .copyreadok
.native: .native:
push 70 push SF_FILE
pop eax pop eax
int 0x40 int 0x40
test eax, eax test eax, eax
@ -390,7 +390,7 @@ copy_file_worker2:
jnz .copydone jnz .copydone
.copywrite: .copywrite:
mov ebx, writeinfo mov ebx, writeinfo
push 70 push SF_FILE
pop eax pop eax
int 0x40 int 0x40
test eax, eax test eax, eax
@ -472,7 +472,7 @@ copy_file_worker2:
mov ebx, attrinfo mov ebx, attrinfo
mov [ebx+attrinfo.name-attrinfo], CopyDestEditBuf+12 mov [ebx+attrinfo.name-attrinfo], CopyDestEditBuf+12
inc dword [ebx] inc dword [ebx]
push 70 push SF_FILE
pop eax pop eax
push ebx push ebx
int 0x40 int 0x40
@ -520,7 +520,7 @@ copy_file_worker2:
mov ebx, delinfo mov ebx, delinfo
push dword [ebx+21] push dword [ebx+21]
mov dword [ebx+21], edi mov dword [ebx+21], edi
push 70 push SF_FILE
pop eax pop eax
int 0x40 int 0x40
; ignore errors ; ignore errors
@ -537,7 +537,7 @@ copy_file:
pushad pushad
mov [copy_dir_stack_ptr], copy_dir_stack mov [copy_dir_stack_ptr], copy_dir_stack
mov [bNeedRestoreName], 0 mov [bNeedRestoreName], 0
lea esi, [ebp + panel1_dir - panel1_data] lea esi, [ebp + PanelData.dir]
mov edi, execdata mov edi, execdata
@@: @@:
lodsb lodsb
@ -674,7 +674,7 @@ copy_file:
mov ebx, dword [copy_dir_query_area+4] mov ebx, dword [copy_dir_query_area+4]
jmp @f jmp @f
.readfolder_native: .readfolder_native:
push 70 push SF_FILE
pop eax pop eax
int 0x40 int 0x40
@@: @@:
@ -1325,7 +1325,7 @@ filesearch_OnKey:
test al, al test al, al
jnz @b jnz @b
mov esi, ecx mov esi, ecx
lea edi, [ebp + panel1_dir - panel1_data] lea edi, [ebp + PanelData.dir]
push esi edi push esi edi
call strcmpi call strcmpi
pop edi esi pop edi esi
@ -1335,11 +1335,11 @@ filesearch_OnKey:
stosb stosb
test al, al test al, al
jnz @b jnz @b
and [ebp + panel1_start - panel1_data], 0 and [ebp + PanelData.start], 0
and [ebp + panel1_index - panel1_data], 0 and [ebp + PanelData.index], 0
.goto.samedir: .goto.samedir:
push @f push @f
push [ebp + panel1_index - panel1_data] push [ebp + PanelData.index]
jmp panels_OnKey.ctrl_r.doread jmp panels_OnKey.ctrl_r.doread
@@: @@:
pop ebp pop ebp
@ -1353,7 +1353,7 @@ filesearch_OnKey:
jmp panels_OnKey.alt_f7.reinit jmp panels_OnKey.alt_f7.reinit
.query: .query:
mov esi, [active_panel] mov esi, [active_panel]
cmp [esi + panel1_hPlugin - panel1_data], 0 cmp [esi + PanelData.hPlugin], 0
jz @f jz @f
push aCannotSearchOnPlugin push aCannotSearchOnPlugin
mov eax, esp mov eax, esp
@ -1365,14 +1365,14 @@ filesearch_OnKey:
pop eax pop eax
jmp .exit jmp .exit
@@: @@:
add esi, panel1_dir - panel1_data add esi, PanelData.dir
lea edi, [ebp+filesearch_data.curdir] lea edi, [ebp+filesearch_data.curdir]
@@: @@:
lodsb lodsb
stosb stosb
test al, al test al, al
jnz @b jnz @b
push 51 push SF_CREATE_THREAD
pop eax pop eax
push 1 push 1
pop ebx pop ebx
@ -1393,9 +1393,9 @@ filesearch_OnKey:
mov [ebp+filesearch_data.updating], 0 mov [ebp+filesearch_data.updating], 0
mov [ebp+filesearch_data.datachanged], 0 mov [ebp+filesearch_data.datachanged], 0
xchg eax, ecx xchg eax, ecx
push 18 push SF_SYSTEM
pop eax pop eax
push 21 push SSF_GET_THREAD_SLOT
pop ebx pop ebx
int 40h int 40h
mov [ebp+filesearch_data.slot], eax mov [ebp+filesearch_data.slot], eax
@ -1532,14 +1532,14 @@ filesearch_wait_thread:
jecxz .secondary_thread_exited jecxz .secondary_thread_exited
@@: @@:
mov ebx, procinfo mov ebx, procinfo
push 9 push SF_THREAD_INFO
pop eax pop eax
int 40h int 40h
cmp word [ebx+50], 9 cmp word [ebx+50], 9
jz .secondary_thread_exited jz .secondary_thread_exited
cmp dword [ebx+30], edx cmp dword [ebx+30], edx
jnz .secondary_thread_exited jnz .secondary_thread_exited
push 5 push SF_SLEEP
pop eax pop eax
push 1 push 1
pop ebx pop ebx
@ -1639,7 +1639,7 @@ filesearch_thread:
mov dword [ebx+12], search_dir_query_size mov dword [ebx+12], search_dir_query_size
lea eax, [ebp+filesearch_data.dir_area] lea eax, [ebp+filesearch_data.dir_area]
mov [ebx+16], eax mov [ebx+16], eax
push 70 push SF_FILE
pop eax pop eax
int 40h int 40h
test eax, eax test eax, eax
@ -1862,7 +1862,7 @@ filesearch_thread:
ret ret
@@: @@:
push eax ebx push eax ebx
push 5 push SF_SLEEP
pop eax pop eax
push 1 push 1
pop ebx pop ebx
@ -1886,7 +1886,7 @@ filesearch_test_file:
.loop: .loop:
.read_retry: .read_retry:
call filesearch_thread.check_stop call filesearch_thread.check_stop
push 70 push SF_FILE
pop eax pop eax
lea ebx, [ebp+filesearch_data.fs.func] lea ebx, [ebp+filesearch_data.fs.func]
int 40h int 40h
@ -2029,7 +2029,7 @@ open:
stosd stosd
lea eax, [ecx+_FILE.attr] lea eax, [ecx+_FILE.attr]
stosd stosd
push 70 push SF_FILE
pop eax pop eax
int 0x40 int 0x40
test eax, eax test eax, eax
@ -2042,7 +2042,7 @@ open:
.truncate: .truncate:
lea ebx, [ecx+_FILE.fileinfo] lea ebx, [ecx+_FILE.fileinfo]
mov byte [ebx], 2 mov byte [ebx], 2
push 70 push SF_FILE
pop eax pop eax
int 0x40 int 0x40
test eax, eax test eax, eax
@ -2288,7 +2288,7 @@ read:
@@: @@:
ret ret
.native: .native:
push 70 push SF_FILE
pop eax pop eax
int 0x40 int 0x40
test eax, eax test eax, eax

File diff suppressed because it is too large Load Diff

View File

@ -49,14 +49,14 @@ view_file:
jnz @b jnz @b
jmp .namecopied jmp .namecopied
.frompanel: .frompanel:
mov eax, dword [esi+panel1_hPlugin-panel1_dir] mov eax, dword [esi+panel1.hPlugin-panel1.dir]
mov [ebp+viewer_data.hPlugin], eax mov [ebp+viewer_data.hPlugin], eax
test eax, eax test eax, eax
jz .nocopyhostname jz .nocopyhostname
lea edi, [ebp+viewer_data.hostname] lea edi, [ebp+viewer_data.hostname]
push esi push esi
mov eax, dword [esi+panel1_parents-panel1_dir] mov eax, dword [esi+panel1.parents-panel1.dir]
mov esi, dword [esi+panel1_parents_sz-panel1_dir] mov esi, dword [esi+panel1.parents_sz-panel1.dir]
add esi, eax add esi, eax
@@: @@:
dec esi dec esi
@ -71,7 +71,7 @@ view_file:
jnz @b jnz @b
pop esi pop esi
.nocopyhostname: .nocopyhostname:
mov eax, dword [esi+panel1_hFile-panel1_dir] mov eax, dword [esi+panel1.hFile-panel1.dir]
mov [ebp+viewer_data.hFile], eax mov [ebp+viewer_data.hFile], eax
lea edi, [ebp+viewer_data.filename] lea edi, [ebp+viewer_data.filename]
push edi push edi
@ -115,7 +115,7 @@ view_file:
pop ebp pop ebp
jmp .attr_common jmp .attr_common
.attr_native: .attr_native:
push 70 push SF_FILE
pop eax pop eax
int 40h int 40h
.attr_common: .attr_common:
@ -190,7 +190,7 @@ view_file:
mov ebx, eax mov ebx, eax
jmp .readok jmp .readok
.read_native: .read_native:
push 70 push SF_FILE
pop eax pop eax
int 40h int 40h
mov [ebp+viewer_data.buf_size], ebx mov [ebp+viewer_data.buf_size], ebx
@ -290,7 +290,7 @@ viewer_load_next:
xor ebx, ebx xor ebx, ebx
jmp .readok jmp .readok
.native: .native:
push 70 push SF_FILE
pop eax pop eax
int 40h int 40h
test eax, eax test eax, eax
@ -1204,7 +1204,7 @@ viewer_seek:
@@: @@:
ret ret
.native: .native:
push 70 push SF_FILE
pop eax pop eax
int 40h int 40h
test eax, eax test eax, eax