Rev 827 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 827 | Rev 987 | ||
---|---|---|---|
Line 15... | Line 15... | ||
15 | 15 | ||
16 | xor ebx,ebx |
16 | xor ebx,ebx |
17 | mov ecx,[cur_editor.Lines.Count] |
17 | mov ecx,[cur_editor.Lines.Count] |
18 | @@: call get_real_length |
18 | @@: call get_real_length |
19 | add ebx,eax |
19 | add ebx,eax |
20 | movzx eax,word[esi] |
20 | mov eax,[esi+EDITOR_LINE_DATA.Size] |
21 | lea esi,[esi+eax+4] |
21 | lea esi,[esi+eax+sizeof.EDITOR_LINE_DATA] |
22 | loop @b |
22 | loop @b |
23 | mov eax,[cur_editor.Lines.Count] |
23 | mov eax,[cur_editor.Lines.Count] |
24 | shl eax,1 |
24 | shl eax,1 |
25 | lea eax,[eax+ebx+1024] |
25 | lea eax,[eax+ebx+1024] |
Line 28... | Line 28... | ||
28 | mov esi,[cur_editor.Lines] |
28 | mov esi,[cur_editor.Lines] |
29 | mov edi,eax |
29 | mov edi,eax |
Line 30... | Line 30... | ||
30 | 30 | ||
31 | .new_string: |
31 | .new_string: |
32 | call save_string |
32 | call save_string |
33 | cmp dword[esi],0 |
33 | cmp dword[esi+EDITOR_LINE_DATA.Size],0 |
34 | jne .new_string |
34 | jne .new_string |
35 | pop eax |
35 | pop eax |
36 | sub edi,eax |
36 | sub edi,eax |
Line 62... | Line 62... | ||
62 | endp |
62 | endp |
Line 63... | Line 63... | ||
63 | 63 | ||
64 | ;----------------------------------------------------------------------------- |
64 | ;----------------------------------------------------------------------------- |
65 | proc save_string ;//////////////////////////////////////////////////////////// |
65 | proc save_string ;//////////////////////////////////////////////////////////// |
66 | ;----------------------------------------------------------------------------- |
66 | ;----------------------------------------------------------------------------- |
67 | movzx ecx,word[esi] |
67 | mov ecx,[esi+EDITOR_LINE_DATA.Size] |
68 | test dword[esi],0x00010000 |
68 | test [esi+EDITOR_LINE_DATA.Flags],EDITOR_LINE_FLAG_MOFIFIED |
69 | jz @f |
69 | jz @f |
70 | or dword[esi],0x00020000 |
70 | or [esi+EDITOR_LINE_DATA.Flags],EDITOR_LINE_FLAG_SAVED |
Line 71... | Line 71... | ||
71 | @@: add esi,4 |
71 | @@: add esi,sizeof.EDITOR_LINE_DATA |
72 | 72 | ||
73 | @@: cmp byte[esi+ecx-1],' ' |
73 | @@: cmp byte[esi+ecx-1],' ' |
74 | jne @f |
74 | jne @f |
Line 79... | Line 79... | ||
79 | mov ah,dl |
79 | mov ah,dl |
Line 80... | Line 80... | ||
80 | 80 | ||
81 | .next_char: |
81 | .next_char: |
82 | mov al,[esi+ebx] |
82 | mov al,[esi+ebx] |
83 | inc ebx |
83 | inc ebx |
84 | test [options],OPTS_OPTIMSAVE |
84 | test [optim_save],1 |
85 | jz .put |
85 | jz .put |
86 | test ah,00000001b |
86 | test ah,00000001b |
87 | jnz .char |
87 | jnz .char |
88 | cmp al,'"' |
88 | cmp al,'"' |
Line 125... | Line 125... | ||
125 | @@: loop .next_char |
125 | @@: loop .next_char |
Line 126... | Line 126... | ||
126 | 126 | ||
127 | .endcopy: |
127 | .endcopy: |
128 | mov eax,0x0A0D |
128 | mov eax,0x0A0D |
129 | stosw |
- | |
130 | movzx eax,word[esi-4] |
129 | stosw |
131 | add esi,eax;[esi-4] |
130 | add esi,[esi-sizeof.EDITOR_LINE_DATA+EDITOR_LINE_DATA.Size] |
132 | ret |
131 | ret |
Line 133... | Line 132... | ||
133 | endp |
132 | endp |
134 | 133 | ||
Line 172... | Line 171... | ||
172 | mov byte[f_info70+20],al |
171 | mov byte[f_info70+20],al |
173 | mov [f_info70+21],f_info.path |
172 | mov [f_info70+21],f_info.path |
174 | mcall 70,f_info70 |
173 | mcall 70,f_info70 |
175 | mov [f_info70+0],0 |
174 | mov [f_info70+0],0 |
176 | mov eax,dword[file_info.Size] |
175 | mov eax,dword[file_info.Size] |
- | 176 | or eax, eax |
|
- | 177 | jnz @f |
|
- | 178 | mov eax, 1024 |
|
177 | mov [f_info70+12],eax |
179 | @@: mov [f_info70+12],eax |
178 | stdcall mem.Alloc,eax |
180 | stdcall mem.Alloc,eax |
179 | mov [f_info70+16],eax |
181 | mov [f_info70+16],eax |
180 | mcall 70,f_info70 |
182 | mcall 70,f_info70 |
Line 181... | Line 183... | ||
181 | 183 | ||
Line 231... | Line 233... | ||
231 | ; EBP = EDITOR* |
233 | ; EBP = EDITOR* |
232 | ;----------------------------------------------------------------------------- |
234 | ;----------------------------------------------------------------------------- |
233 | call get_lines_in_file |
235 | call get_lines_in_file |
234 | mov [ebp+EDITOR.Lines.Count],eax |
236 | mov [ebp+EDITOR.Lines.Count],eax |
235 | lea edx,[ebx+ecx] |
237 | lea edx,[ebx+ecx] |
236 | imul ebx,eax,14 |
238 | imul ebx,eax,16 |
237 | add ebx,edx |
239 | add ebx,edx |
238 | mov [ebp+EDITOR.Lines.Size],ebx |
240 | mov [ebp+EDITOR.Lines.Size],ebx |
239 | stdcall mem.ReAlloc,[ebp+EDITOR.Lines],ebx |
241 | stdcall mem.ReAlloc,[ebp+EDITOR.Lines],ebx |
240 | mov [ebp+EDITOR.Lines],eax |
242 | mov [ebp+EDITOR.Lines],eax |
Line 243... | Line 245... | ||
243 | mov edi,eax |
245 | mov edi,eax |
244 | mov edx,ecx |
246 | mov edx,ecx |
Line 245... | Line 247... | ||
245 | 247 | ||
246 | .next_line: |
248 | .next_line: |
247 | mov ebx,edi |
249 | mov ebx,edi |
248 | add edi,4 |
250 | add edi,sizeof.EDITOR_LINE_DATA |
249 | .next_char: |
251 | .next_char: |
250 | or edx,edx |
252 | or edx,edx |
251 | jle .exit |
253 | jle .exit |
252 | lodsb |
254 | lodsb |
Line 264... | Line 266... | ||
264 | 266 | ||
265 | .exit: |
267 | .exit: |
266 | mov ecx,10 |
268 | mov ecx,10 |
267 | mov al,' ' |
269 | mov al,' ' |
268 | rep stosb |
270 | rep stosb |
269 | lea eax,[edi-4] |
271 | lea eax,[edi-sizeof.EDITOR_LINE_DATA] |
270 | sub eax,ebx |
272 | sub eax,ebx |
271 | mov [ebx],eax |
273 | mov [ebx+EDITOR_LINE_DATA.Size],eax |
272 | mov dword[ebx+eax+4],0 |
274 | mov [ebx+eax+sizeof.EDITOR_LINE_DATA+EDITOR_LINE_DATA.Size],0 |
273 | sub eax,10 |
275 | sub eax,10 |
274 | jnz @f |
276 | jnz @f |
275 | inc eax |
277 | inc eax |
276 | @@: cmp eax,[ebp+EDITOR.Columns.Count] |
278 | @@: cmp eax,[ebp+EDITOR.Columns.Count] |
Line 284... | Line 286... | ||
284 | lodsb |
286 | lodsb |
285 | dec edx |
287 | dec edx |
286 | .LF: mov ecx,10 |
288 | .LF: mov ecx,10 |
287 | mov al,' ' |
289 | mov al,' ' |
288 | rep stosb |
290 | rep stosb |
289 | lea eax,[edi-4] |
291 | lea eax,[edi-sizeof.EDITOR_LINE_DATA] |
290 | sub eax,ebx |
292 | sub eax,ebx |
291 | mov [ebx],eax |
293 | mov [ebx+EDITOR_LINE_DATA.Size],eax |
292 | add eax,-10 |
294 | add eax,-10 |
293 | cmp eax,[ebp+EDITOR.Columns.Count] |
295 | cmp eax,[ebp+EDITOR.Columns.Count] |
294 | jbe .next_line |
296 | jbe .next_line |
295 | mov [ebp+EDITOR.Columns.Count],eax |
297 | mov [ebp+EDITOR.Columns.Count],eax |
296 | jmp .next_line |
298 | jmp .next_line |
Line 297... | Line 299... | ||
297 | 299 | ||
298 | .TB: lea eax,[edi-4] |
300 | .TB: lea eax,[edi-sizeof.EDITOR_LINE_DATA] |
299 | sub eax,ebx |
301 | sub eax,ebx |
300 | mov ecx,eax |
302 | mov ecx,eax |
301 | add ecx,ATABW |
303 | add ecx,ATABW |
302 | and ecx,not(ATABW-1) |
304 | and ecx,not(ATABW-1) |