Rev 5579 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5579 | Rev 5838 | ||
---|---|---|---|
Line 67... | Line 67... | ||
67 | or eax,edx |
67 | or eax,edx |
Line 68... | Line 68... | ||
68 | 68 | ||
69 | .lp0: test al,0x80 |
69 | .lp0: test al,0x80 |
70 | jnz still.skip_write |
70 | jnz still.skip_write |
71 | ;-------------------------------------- |
71 | ;-------------------------------------- |
72 | ; it is CAPS LOCK correct processing for chars |
72 | ; CAPS LOCK correct processing for chars |
73 | test [shi], 0x00000040 ; CAPS LOCK is on? |
73 | test [shi], 0x00000040 ; CAPS LOCK is on? |
74 | jz .no_caps_lock |
74 | jz .no_caps_lock |
75 | cmp ecx,1 |
75 | cmp ecx,1 |
76 | jnz @f |
76 | jnz @f |
Line 79... | Line 79... | ||
79 | @@: |
79 | @@: |
80 | cmp ecx,2 |
80 | cmp ecx,2 |
81 | jnz .no_caps_lock |
81 | jnz .no_caps_lock |
82 | dec ecx |
82 | dec ecx |
83 | .no_caps_lock: |
83 | .no_caps_lock: |
84 | ;-------------------------------------- |
- | |
85 | ; alt gr pressed? |
84 | ; alt gr pressed? |
86 | test [shi], 0x00000020 |
85 | test [shi], 0x00000020 |
87 | jz .no_alt_gr |
86 | jz .no_alt_gr |
88 | mov ecx, 3 |
87 | mov ecx, 3 |
89 | .no_alt_gr: |
88 | .no_alt_gr: |
90 | ;-------------------------------------- |
- | |
91 | push eax |
89 | push eax |
92 | mcall 26,2,,key1 |
90 | mcall 26,2,,key1 |
93 | pop eax |
91 | pop eax |
Line 94... | Line 92... | ||
94 | 92 | ||
Line 162... | Line 160... | ||
162 | .lp3: push [cur_editor.Caret.X] eax |
160 | .lp3: push [cur_editor.Caret.X] eax |
163 | inc dword[esp+4] |
161 | inc dword[esp+4] |
164 | mov eax,1 |
162 | mov eax,1 |
165 | jmp key.tab.direct |
163 | jmp key.tab.direct |
Line 166... | Line 164... | ||
166 | 164 | ||
167 | ;----------------------------------------------------------------------------- |
165 | ;--------------------------------------------------------------- |
168 | proc key.ctrl_a ;///// SELECT ALL DOCUMENT /////////////////////////////////// |
166 | proc key.ctrl_a ;///// SELECT ALL DOCUMENT ///////////////////// |
169 | ;----------------------------------------------------------------------------- |
167 | ;--------------------------------------------------------------- |
170 | xor eax,eax |
168 | xor eax,eax |
171 | mov [cur_editor.SelStart.X],eax |
169 | mov [cur_editor.SelStart.X],eax |
172 | mov [cur_editor.SelStart.Y],eax |
170 | mov [cur_editor.SelStart.Y],eax |
173 | mov ecx,[cur_editor.Lines.Count] |
171 | mov ecx,[cur_editor.Lines.Count] |
Line 178... | Line 176... | ||
178 | mov [cur_editor.Caret.X],eax |
176 | mov [cur_editor.Caret.X],eax |
179 | call draw_editor |
177 | call draw_editor |
180 | ret |
178 | ret |
181 | endp |
179 | endp |
Line 182... | Line 180... | ||
182 | 180 | ||
183 | ;----------------------------------------------------------------------------- |
181 | ;--------------------------------------------------------------- |
184 | proc key.ctrl_o ;///// ENTER OPEN FILENAME /////////////////////////////////// |
182 | proc key.ctrl_o ;///// ENTER OPEN FILENAME ///////////////////// |
185 | ;----------------------------------------------------------------------------- |
183 | ;--------------------------------------------------------------- |
Line 186... | Line 184... | ||
186 | mov [bot_mode2],0 |
184 | mov [bot_mode2],0 |
187 | 185 | ||
188 | .direct: |
186 | .direct: |
Line 205... | Line 203... | ||
205 | mov [tb_casesen],0;1 |
203 | mov [tb_casesen],0;1 |
206 | call drawwindow |
204 | call drawwindow |
207 | ret |
205 | ret |
208 | endp |
206 | endp |
Line 209... | Line 207... | ||
209 | 207 | ||
210 | ;----------------------------------------------------------------------------- |
208 | ;--------------------------------------------------------------- |
211 | proc key.ctrl_s ;///// ENTER SAVE FILENAME /////////////////////////////////// |
209 | proc key.ctrl_s ;///// ENTER SAVE FILENAME ///////////////////// |
212 | ;----------------------------------------------------------------------------- |
210 | ;--------------------------------------------------------------- |
213 | cmp [cur_editor.FilePath], 0 |
211 | cmp [cur_editor.FilePath], 0 |
214 | je key.shift_ctrl_s |
212 | je key.shift_ctrl_s |
215 | cmp [cur_editor.Modified],0 |
213 | cmp [cur_editor.Modified],0 |
216 | je .exit |
214 | je .exit |
Line 222... | Line 220... | ||
222 | key.shift_ctrl_s: |
220 | key.shift_ctrl_s: |
223 | mov [bot_mode2],1 |
221 | mov [bot_mode2],1 |
224 | jmp key.ctrl_o.direct |
222 | jmp key.ctrl_o.direct |
225 | endp |
223 | endp |
Line 226... | Line 224... | ||
226 | 224 | ||
227 | ;----------------------------------------------------------------------------- |
225 | ;--------------------------------------------------------------- |
228 | proc key.ctrl_n ;///// CREATE NEW FILE (TAB) ///////////////////////////////// |
226 | proc key.ctrl_n ;///// CREATE NEW FILE (TAB) /////////////////// |
229 | ;----------------------------------------------------------------------------- |
227 | ;--------------------------------------------------------------- |
230 | call create_tab |
228 | call create_tab |
231 | ret |
229 | ret |
Line 232... | Line 230... | ||
232 | endp |
230 | endp |
233 | 231 | ||
234 | ;----------------------------------------------------------------------------- |
232 | ;--------------------------------------------------------------- |
235 | proc key.ctrl_f ;///// ENTER KEYWORD TO FIND ///////////////////////////////// |
233 | proc key.ctrl_f ;///// ENTER KEYWORD TO FIND /////////////////// |
236 | ;----------------------------------------------------------------------------- |
234 | ;--------------------------------------------------------------- |
Line 237... | Line 235... | ||
237 | mov [bot_mode2],0 |
235 | mov [bot_mode2],0 |
Line 258... | Line 256... | ||
258 | mov [tb_casesen],0 |
256 | mov [tb_casesen],0 |
259 | call drawwindow |
257 | call drawwindow |
260 | ret |
258 | ret |
261 | endp |
259 | endp |
Line -... | Line 260... | ||
- | 260 | ||
262 | 261 | ;--------------------------------------------------------------- |
|
- | 262 | proc key.ctrl_h |
|
263 | proc key.ctrl_h |
263 | ;--------------------------------------------------------------- |
264 | mov [bot_mode2],1 |
264 | mov [bot_mode2],1 |
265 | mov [bot_dlg_height],16*3+4*2+1 |
- | |
266 | 265 | mov [bot_dlg_height],16*3+4*2+1 |
|
267 | mov [s_status],s_enter_text_to_replace |
- | |
268 | 266 | mov [s_status],s_enter_text_to_replace |
|
269 | jmp key.ctrl_f.direct |
267 | jmp key.ctrl_f.direct |
Line -... | Line 268... | ||
- | 268 | endp |
|
270 | endp |
269 | |
- | 270 | ;--------------------------------------------------------------- |
|
271 | 271 | proc key.ctrl_g |
|
272 | proc key.ctrl_g |
- | |
273 | ret |
272 | ;--------------------------------------------------------------- |
274 | @^ |
273 | ret |
275 | mov [bot_mode2],0 |
- | |
276 | mov [bot_dlg_height],16*2+4*2-1 |
274 | ; mov [bot_mode2],0 |
277 | 275 | ; mov [bot_dlg_height],16*2+4*2-1 |
|
278 | mov [bot_mode],1 |
276 | ; mov [bot_mode],1 |
279 | mov [bot_dlg_handler],gotodlg_handler |
- | |
280 | mov [focused_tb],tb_gotorow |
277 | ; mov [bot_dlg_handler],gotodlg_handler |
281 | 278 | ; mov [focused_tb],tb_gotorow |
|
282 | mov al,[tb_gotorow.length] |
279 | ; mov al,[tb_gotorow.length] |
283 | mov [tb_gotorow.pos.x],al |
280 | ; mov [tb_gotorow.pos.x],al |
284 | mov [tb_gotorow.sel.x],0 |
281 | ; mov [tb_gotorow.sel.x],0 |
285 | mov [tb_casesen],0 |
282 | ; mov [tb_casesen],0 |
286 | call drawwindow |
- | |
287 | ret |
283 | ; call drawwindow |
288 | ^@ |
284 | ; ret |
289 | endp |
285 | endp |
290 | 286 | ||
291 | ;----------------------------------------------------------------------------- |
287 | ;--------------------------------------------------------------- |
292 | proc key.ctrl_left ;///// GO TO PREVIOUS WORD //////////////////////////////// |
288 | proc key.ctrl_left ;///// GO TO PREVIOUS WORD ////////////////// |
293 | ;----------------------------------------------------------------------------- |
- | |
294 | call clear_selection |
289 | ;--------------------------------------------------------------- |
295 | 290 | call clear_selection |
|
296 | ;----------------------------------------------------------------------------- |
291 | ;--------------------------------------------------------------- |
297 | key.shift_ctrl_left: ;///// GO TO PREVIOUS WORD, WITH SELECTION ///////// |
292 | key.shift_ctrl_left: ; GO TO PREVIOUS WORD, WITH SELECTION |
298 | ;----------------------------------------------------------------------------- |
293 | ;--------------------------------------------------------------- |
299 | mov ebx,[cur_editor.Caret.Y] |
294 | mov ebx,[cur_editor.Caret.Y] |
300 | mov edx,[cur_editor.Caret.X] |
295 | mov edx,[cur_editor.Caret.X] |
301 | cld |
296 | cld |
Line 379... | Line 374... | ||
379 | call editor_check_for_changes |
374 | call editor_check_for_changes |
380 | .exit.2: |
375 | .exit.2: |
381 | ret |
376 | ret |
382 | endp |
377 | endp |
Line 383... | Line 378... | ||
383 | 378 | ||
384 | ;----------------------------------------------------------------------------- |
379 | ;--------------------------------------------------------------- |
385 | proc key.ctrl_right ;///// GO TO NEXT WORD /////////////////////////////////// |
380 | proc key.ctrl_right ;///// GO TO NEXT WORD ///////////////////// |
386 | ;----------------------------------------------------------------------------- |
381 | ;--------------------------------------------------------------- |
387 | call clear_selection |
- | |
388 | 382 | call clear_selection |
|
389 | ;----------------------------------------------------------------------------- |
383 | ;--------------------------------------------------------------- |
390 | key.shift_ctrl_right: ;///// GO TO NEXT WORD, WITH SELECTION //////////// |
384 | key.shift_ctrl_right: ;/ GO TO NEXT WORD, WITH SELECTION // |
391 | ;----------------------------------------------------------------------------- |
385 | ;--------------------------------------------------------------- |
392 | mov ebx,[cur_editor.Caret.Y] |
386 | mov ebx,[cur_editor.Caret.Y] |
393 | mov edx,[cur_editor.Caret.X] |
387 | mov edx,[cur_editor.Caret.X] |
394 | cld |
388 | cld |
395 | .lp1: mov ecx,ebx |
389 | .lp1: mov ecx,ebx |
Line 468... | Line 462... | ||
468 | call editor_check_for_changes |
462 | call editor_check_for_changes |
469 | .exit.2: |
463 | .exit.2: |
470 | ret |
464 | ret |
471 | endp |
465 | endp |
Line 472... | Line 466... | ||
472 | 466 | ||
473 | ;----------------------------------------------------------------------------- |
467 | ;--------------------------------------------------------------- |
- | 468 | proc key.ctrl_x ;///// CUT ///////////////////////////////////// |
|
474 | proc key.ctrl_x |
469 | ;--------------------------------------------------------------- |
475 | cmp [sel.selected],0 |
470 | cmp [sel.selected],0 |
476 | je @f |
471 | je @f |
477 | call key.ctrl_c |
472 | call key.ctrl_c |
478 | call key.del |
473 | call key.del |
479 | mov [cur_editor.Modified],1 |
474 | mov [cur_editor.Modified],1 |
480 | @@: ret |
475 | @@: ret |
Line 481... | Line 476... | ||
481 | endp |
476 | endp |
482 | 477 | ||
- | 478 | ;--------------------------------------------------------------- |
|
483 | ;----------------------------------------------------------------------------- |
479 | proc key.ctrl_c ;///// COPY //////////////////////////////////// |
484 | proc key.ctrl_c |
480 | ;--------------------------------------------------------------- |
485 | mov [copy_size],0 |
481 | mov [copy_size],0 |
Line 486... | Line 482... | ||
486 | cmp [sel.selected],0 |
482 | cmp [sel.selected],0 |
Line 580... | Line 576... | ||
580 | jecxz @b |
576 | jecxz @b |
581 | rep stosb |
577 | rep stosb |
582 | jmp @b |
578 | jmp @b |
583 | endp |
579 | endp |
Line 584... | Line 580... | ||
584 | 580 | ||
585 | ;----------------------------------------------------------------------------- |
581 | ;--------------------------------------------------------------- |
- | 582 | proc key.ctrl_v ;///// PASTE /////////////////////////////////// |
|
586 | proc key.ctrl_v |
583 | ;--------------------------------------------------------------- |
587 | cmp [replace_mode],0 |
584 | cmp [replace_mode],0 |
588 | jne @f |
585 | jne @f |
589 | call get_from_clipboard |
586 | call get_from_clipboard |
590 | @@: |
587 | @@: |
Line 688... | Line 685... | ||
688 | mov [cur_editor.Columns.Count],eax |
685 | mov [cur_editor.Columns.Count],eax |
689 | @@: |
686 | @@: |
690 | pop eax |
687 | pop eax |
691 | ret |
688 | ret |
692 | endp |
689 | endp |
693 | ;----------------------------------------------------------------------------- |
690 | ;--------------------------------------------------------------- |
694 | proc key.ctrl_d ;///// INSERT SEPARATOR ////////////////////////////////////// |
691 | proc key.ctrl_d ;///// INSERT SEPARATOR //////////////////////// |
695 | ;----------------------------------------------------------------------------- |
692 | ;--------------------------------------------------------------- |
696 | mov eax,90+sizeof.EDITOR_LINE_DATA |
693 | mov eax,90+sizeof.EDITOR_LINE_DATA |
697 | call editor_realloc_lines |
694 | call editor_realloc_lines |
Line 698... | Line 695... | ||
698 | 695 | ||
699 | mov ecx,[cur_editor.Caret.Y] |
696 | mov ecx,[cur_editor.Caret.Y] |
Line 727... | Line 724... | ||
727 | 724 | ||
728 | .exit: |
725 | .exit: |
729 | ret |
726 | ret |
Line 730... | Line 727... | ||
730 | endp |
727 | endp |
731 | 728 | ||
732 | ;----------------------------------------------------------------------------- |
729 | ;--------------------------------------------------------------- |
733 | proc key.ctrl_y ;///// DELETE CURRENT LINE /////////////////////////////////// |
730 | proc key.ctrl_y ;///// DELETE CURRENT LINE ///////////////////// |
734 | ;----------------------------------------------------------------------------- |
731 | ;--------------------------------------------------------------- |
735 | mov eax,[cur_editor.Caret.Y] |
732 | mov eax,[cur_editor.Caret.Y] |
736 | inc eax |
733 | inc eax |
Line 764... | Line 761... | ||
764 | 761 | ||
765 | .exit: |
762 | .exit: |
766 | ret |
763 | ret |
Line 767... | Line 764... | ||
767 | endp |
764 | endp |
768 | 765 | ||
769 | ;----------------------------------------------------------------------------- |
766 | ;--------------------------------------------------------------- |
770 | proc key.up ;///// GO TO PREVIOUS LINE /////////////////////////////////////// |
767 | proc key.up ;///// GO TO PREVIOUS LINE ///////////////////////// |
771 | ;----------------------------------------------------------------------------- |
768 | ;--------------------------------------------------------------- |
- | 769 | call key.shift_up |
|
772 | call key.shift_up |
770 | jmp clear_selection |
773 | jmp clear_selection |
771 | |
774 | ;----------------------------------------------------------------------------- |
772 | ;--------------------------------------------------------------- |
775 | key.shift_up: ;///// GO TO PREVIOUS LINE, WITH SELECTION //////////////// |
773 | key.shift_up: ;/// GO TO PREVIOUS LINE, WITH SELECTION //// |
776 | ;----------------------------------------------------------------------------- |
774 | ;--------------------------------------------------------------- |
777 | mov ecx,[cur_editor.Caret.Y] |
775 | mov ecx,[cur_editor.Caret.Y] |
778 | dec ecx |
776 | dec ecx |
779 | js .exit |
777 | js .exit |
Line 785... | Line 783... | ||
785 | mov [cur_editor.Caret.X],eax |
783 | mov [cur_editor.Caret.X],eax |
786 | .exit: |
784 | .exit: |
787 | ret |
785 | ret |
788 | endp |
786 | endp |
Line 789... | Line 787... | ||
789 | 787 | ||
790 | ;----------------------------------------------------------------------------- |
788 | ;--------------------------------------------------------------- |
791 | proc key.down ;///// GO TO NEXT LINE ///////////////////////////////////////// |
789 | proc key.down ;///// GO TO NEXT LINE /////////////////////////// |
792 | ;----------------------------------------------------------------------------- |
790 | ;--------------------------------------------------------------- |
793 | call key.shift_down |
791 | call key.shift_down |
- | 792 | jmp clear_selection |
|
794 | jmp clear_selection |
793 | |
795 | ;----------------------------------------------------------------------------- |
794 | ;--------------------------------------------------------------- |
796 | key.shift_down: ;///// GO TO NEXT LINE, WITH SELECTION ////////////////// |
795 | key.shift_down: ;//// GO TO NEXT LINE, WITH SELECTION ///// |
797 | ;----------------------------------------------------------------------------- |
796 | ;--------------------------------------------------------------- |
798 | mov ecx,[cur_editor.Caret.Y] |
797 | mov ecx,[cur_editor.Caret.Y] |
799 | inc ecx |
798 | inc ecx |
800 | cmp [cur_editor.Lines.Count],ecx |
799 | cmp [cur_editor.Lines.Count],ecx |
801 | jz .exit |
800 | jz .exit |
Line 807... | Line 806... | ||
807 | mov [cur_editor.Caret.X],eax |
806 | mov [cur_editor.Caret.X],eax |
808 | .exit: |
807 | .exit: |
809 | ret |
808 | ret |
810 | endp |
809 | endp |
Line 811... | Line 810... | ||
811 | 810 | ||
812 | ;----------------------------------------------------------------------------- |
811 | ;--------------------------------------------------------------- |
813 | proc key.left ;///// GO TO PREVIOUS CHAR ///////////////////////////////////// |
812 | proc key.left ;///// GO TO PREVIOUS CHAR /////////////////////// |
814 | ;----------------------------------------------------------------------------- |
813 | ;--------------------------------------------------------------- |
815 | call key.shift_left |
814 | call key.shift_left |
- | 815 | jmp clear_selection |
|
816 | jmp clear_selection |
816 | |
817 | ;----------------------------------------------------------------------------- |
817 | ;--------------------------------------------------------------- |
818 | key.shift_left: ;///// GO TO PREVIOUS CHAR, WITH SELECTION ////////////// |
818 | key.shift_left: ;// GO TO PREVIOUS CHAR, WITH SELECTION /// |
819 | ;----------------------------------------------------------------------------- |
819 | ;--------------------------------------------------------------- |
820 | mov eax,[cur_editor.Caret.X] |
820 | mov eax,[cur_editor.Caret.X] |
821 | dec eax |
821 | dec eax |
822 | jns @f |
822 | jns @f |
823 | mov ecx,[cur_editor.Caret.Y] |
823 | mov ecx,[cur_editor.Caret.Y] |
Line 830... | Line 830... | ||
830 | mov [cur_editor.Caret.X],eax |
830 | mov [cur_editor.Caret.X],eax |
831 | .exit: |
831 | .exit: |
832 | ret |
832 | ret |
833 | endp |
833 | endp |
Line 834... | Line 834... | ||
834 | 834 | ||
835 | ;----------------------------------------------------------------------------- |
835 | ;--------------------------------------------------------------- |
836 | proc key.right ;///// GO TO NEXT CHAR //////////////////////////////////////// |
836 | proc key.right ;///// GO TO NEXT CHAR ////////////////////////// |
837 | ;----------------------------------------------------------------------------- |
837 | ;--------------------------------------------------------------- |
838 | call key.shift_right |
838 | call key.shift_right |
- | 839 | jmp clear_selection |
|
839 | jmp clear_selection |
840 | |
840 | ;----------------------------------------------------------------------------- |
841 | ;--------------------------------------------------------------- |
841 | key.shift_right: ;///// GO TO NEXT CHAR, WITH SELECTION ///////////////// |
842 | key.shift_right: ;//// GO TO NEXT CHAR, WITH SELECTION //// |
842 | ;----------------------------------------------------------------------------- |
843 | ;--------------------------------------------------------------- |
843 | mov ecx,[cur_editor.Caret.Y] |
844 | mov ecx,[cur_editor.Caret.Y] |
844 | call get_line_offset |
845 | call get_line_offset |
845 | mov eax,[cur_editor.Caret.X] |
846 | mov eax,[cur_editor.Caret.X] |
846 | inc eax |
847 | inc eax |
Line 855... | Line 856... | ||
855 | mov [cur_editor.Caret.X],eax |
856 | mov [cur_editor.Caret.X],eax |
856 | .exit: |
857 | .exit: |
857 | ret |
858 | ret |
858 | endp |
859 | endp |
Line 859... | Line 860... | ||
859 | 860 | ||
860 | ;----------------------------------------------------------------------------- |
861 | ;--------------------------------------------------------------- |
861 | proc key.pgup ;///// GO TO PREVIOUS PAGE ///////////////////////////////////// |
862 | proc key.pgup ;///// GO TO PREVIOUS PAGE /////////////////////// |
862 | ;----------------------------------------------------------------------------- |
863 | ;--------------------------------------------------------------- |
863 | call clear_selection |
- | |
864 | 864 | call clear_selection |
|
865 | ;----------------------------------------------------------------------------- |
865 | ;--------------------------------------------------------------- |
866 | key.shift_pgup: ;///// GO TO PREVIOUS PAGE, WITH SELECTION ////////////// |
866 | key.shift_pgup: ;// GO TO PREVIOUS PAGE, WITH SELECTION /// |
867 | ;----------------------------------------------------------------------------- |
867 | ;--------------------------------------------------------------- |
868 | mov edx,[lines.scr] |
868 | mov edx,[lines.scr] |
869 | dec edx |
869 | dec edx |
870 | mov eax,[cur_editor.Caret.Y] |
870 | mov eax,[cur_editor.Caret.Y] |
871 | mov ecx,[cur_editor.TopLeft.Y] |
871 | mov ecx,[cur_editor.TopLeft.Y] |
Line 883... | Line 883... | ||
883 | 883 | ||
884 | .exit: |
884 | .exit: |
885 | ret |
885 | ret |
Line 886... | Line 886... | ||
886 | endp |
886 | endp |
887 | 887 | ||
888 | ;----------------------------------------------------------------------------- |
888 | ;--------------------------------------------------------------- |
889 | proc key.pgdn ;///// GO TO NEXT PAGE ///////////////////////////////////////// |
889 | proc key.pgdn ;///// GO TO NEXT PAGE /////////////////////////// |
890 | ;----------------------------------------------------------------------------- |
- | |
891 | call clear_selection |
890 | ;--------------------------------------------------------------- |
892 | 891 | call clear_selection |
|
893 | ;----------------------------------------------------------------------------- |
892 | ;--------------------------------------------------------------- |
894 | key.shift_pgdn: ;///// GO TO NEXT PAGE, WITH SELECTION ////////////////// |
893 | key.shift_pgdn: ;//// GO TO NEXT PAGE, WITH SELECTION ///// |
895 | ;----------------------------------------------------------------------------- |
894 | ;--------------------------------------------------------------- |
896 | mov edx,[lines.scr] |
895 | mov edx,[lines.scr] |
897 | dec edx |
896 | dec edx |
898 | mov eax,[cur_editor.Caret.Y] |
897 | mov eax,[cur_editor.Caret.Y] |
Line 911... | Line 910... | ||
911 | 910 | ||
912 | .exit: |
911 | .exit: |
913 | ret |
912 | ret |
Line 914... | Line 913... | ||
914 | endp |
913 | endp |
915 | 914 | ||
916 | ;----------------------------------------------------------------------------- |
915 | ;--------------------------------------------------------------- |
917 | proc key.home ;///// GO TO LINE START //////////////////////////////////////// |
916 | proc key.home ;///// GO TO LINE START ////////////////////////// |
918 | ;----------------------------------------------------------------------------- |
- | |
919 | call clear_selection |
917 | ;--------------------------------------------------------------- |
920 | 918 | call clear_selection |
|
921 | ;----------------------------------------------------------------------------- |
919 | ;--------------------------------------------------------------- |
922 | key.shift_home: ;///// GO TO LINE START, WITH SELECTION ///////////////// |
920 | key.shift_home: ;//// GO TO LINE START, WITH SELECTION //// |
923 | ;----------------------------------------------------------------------------- |
921 | ;--------------------------------------------------------------- |
924 | mov [cur_editor.Caret.X],0 |
922 | mov [cur_editor.Caret.X],0 |
925 | test [chr],KM_SHIFT |
923 | test [chr],KM_SHIFT |
926 | jnz @f |
924 | jnz @f |
Line 927... | Line 925... | ||
927 | mov [cur_editor.SelStart.X],0 |
925 | mov [cur_editor.SelStart.X],0 |
928 | @@: |
926 | @@: |
929 | 927 | ||
Line 930... | Line 928... | ||
930 | .exit: |
928 | .exit: |
931 | ret |
929 | ret |
932 | endp |
930 | endp |
933 | 931 | ||
934 | ;----------------------------------------------------------------------------- |
- | |
935 | proc key.end ;///// GO TO LINE END /////////////////////////////////////////// |
932 | ;--------------------------------------------------------------- |
936 | ;----------------------------------------------------------------------------- |
933 | proc key.end ;///// GO TO LINE END ///////////////////////////// |
937 | call clear_selection |
934 | ;--------------------------------------------------------------- |
938 | 935 | call clear_selection |
|
939 | ;----------------------------------------------------------------------------- |
936 | ;--------------------------------------------------------------- |
940 | key.shift_end: ;///// GO TO LINE END, WITH SELECTION //////////////////// |
937 | key.shift_end: ;///// GO TO LINE END, WITH SELECTION ////// |
941 | ;----------------------------------------------------------------------------- |
938 | ;--------------------------------------------------------------- |
942 | mov ecx,[cur_editor.Caret.Y] |
939 | mov ecx,[cur_editor.Caret.Y] |
Line 950... | Line 947... | ||
950 | 947 | ||
951 | .exit: |
948 | .exit: |
952 | ret |
949 | ret |
Line 953... | Line 950... | ||
953 | endp |
950 | endp |
954 | 951 | ||
955 | ;----------------------------------------------------------------------------- |
952 | ;--------------------------------------------------------------- |
956 | proc key.ctrl_home ;///// GO TO PAGE START /////////////////////////////////// |
953 | proc key.ctrl_home ;///// GO TO PAGE START ///////////////////// |
957 | ;----------------------------------------------------------------------------- |
- | |
958 | call clear_selection |
954 | ;--------------------------------------------------------------- |
959 | 955 | call clear_selection |
|
960 | ;----------------------------------------------------------------------------- |
956 | ;--------------------------------------------------------------- |
961 | key.shift_ctrl_home: ;///// GO TO PAGE START, WITH SELECTION //////////// |
957 | key.shift_ctrl_home: ;/ GO TO PAGE START, WITH SELECTION // |
962 | ;----------------------------------------------------------------------------- |
958 | ;--------------------------------------------------------------- |
963 | mov eax,[cur_editor.TopLeft.Y] |
959 | mov eax,[cur_editor.TopLeft.Y] |
964 | mov ecx,eax |
960 | mov ecx,eax |
965 | test [chr],KM_SHIFT |
961 | test [chr],KM_SHIFT |
Line 970... | Line 966... | ||
970 | 966 | ||
971 | .exit: |
967 | .exit: |
972 | ret |
968 | ret |
Line 973... | Line 969... | ||
973 | endp |
969 | endp |
974 | 970 | ||
975 | ;----------------------------------------------------------------------------- |
971 | ;--------------------------------------------------------------- |
976 | proc key.ctrl_end ;///// GO TO PAGE END ////////////////////////////////////// |
972 | proc key.ctrl_end ;///// GO TO PAGE END //////////////////////// |
977 | ;----------------------------------------------------------------------------- |
- | |
978 | call clear_selection |
973 | ;--------------------------------------------------------------- |
979 | 974 | call clear_selection |
|
980 | ;----------------------------------------------------------------------------- |
975 | ;--------------------------------------------------------------- |
981 | key.shift_ctrl_end: ;///// GO TO PAGE END, WITH SELECTION /////////////// |
976 | key.shift_ctrl_end: ;/// GO TO PAGE END, WITH SELECTION /// |
982 | ;----------------------------------------------------------------------------- |
977 | ;--------------------------------------------------------------- |
983 | mov ecx,[cur_editor.TopLeft.Y] |
978 | mov ecx,[cur_editor.TopLeft.Y] |
984 | mov eax,[lines.scr] |
979 | mov eax,[lines.scr] |
985 | cmp eax,[cur_editor.Lines.Count] |
980 | cmp eax,[cur_editor.Lines.Count] |
Line 995... | Line 990... | ||
995 | 990 | ||
996 | .exit: |
991 | .exit: |
997 | ret |
992 | ret |
Line 998... | Line 993... | ||
998 | endp |
993 | endp |
999 | 994 | ||
1000 | ;----------------------------------------------------------------------------- |
995 | ;--------------------------------------------------------------- |
1001 | proc key.ctrl_pgup ;///// GO TO DOCUMENT START /////////////////////////////// |
996 | proc key.ctrl_pgup ;///// GO TO DOCUMENT START ///////////////// |
1002 | ;----------------------------------------------------------------------------- |
- | |
1003 | call clear_selection |
997 | ;--------------------------------------------------------------- |
1004 | 998 | call clear_selection |
|
1005 | ;----------------------------------------------------------------------------- |
999 | ;--------------------------------------------------------------- |
1006 | key.shift_ctrl_pgup: ;///// GO TO DOCUMENT START, WITH SELECTION //////// |
1000 | key.shift_ctrl_pgup: ; GO TO DOCUMENT START, WITH SELECTION |
1007 | ;----------------------------------------------------------------------------- |
1001 | ;--------------------------------------------------------------- |
1008 | xor eax,eax |
1002 | xor eax,eax |
1009 | mov [cur_editor.TopLeft.Y],eax |
1003 | mov [cur_editor.TopLeft.Y],eax |
1010 | mov [cur_editor.Caret.Y],eax |
1004 | mov [cur_editor.Caret.Y],eax |
Line 1015... | Line 1009... | ||
1015 | 1009 | ||
1016 | .exit: |
1010 | .exit: |
1017 | ret |
1011 | ret |
Line 1018... | Line 1012... | ||
1018 | endp |
1012 | endp |
1019 | 1013 | ||
1020 | ;----------------------------------------------------------------------------- |
1014 | ;--------------------------------------------------------------- |
1021 | proc key.ctrl_pgdn ;///// GO TO DOCUMENT END ///////////////////////////////// |
1015 | proc key.ctrl_pgdn ;///// GO TO DOCUMENT END /////////////////// |
1022 | ;----------------------------------------------------------------------------- |
- | |
1023 | call clear_selection |
1016 | ;--------------------------------------------------------------- |
1024 | 1017 | call clear_selection |
|
1025 | ;----------------------------------------------------------------------------- |
1018 | ;--------------------------------------------------------------- |
1026 | key.shift_ctrl_pgdn: ;///// GO TO DOCUMENT END, WITH SELECTION ////////// |
1019 | key.shift_ctrl_pgdn: ; GO TO DOCUMENT END, WITH SELECTION / |
1027 | ;----------------------------------------------------------------------------- |
1020 | ;--------------------------------------------------------------- |
1028 | mov eax,[cur_editor.Lines.Count] |
1021 | mov eax,[cur_editor.Lines.Count] |
1029 | mov [cur_editor.Caret.Y],eax |
1022 | mov [cur_editor.Caret.Y],eax |
1030 | sub eax,[lines.scr] |
1023 | sub eax,[lines.scr] |
Line 1039... | Line 1032... | ||
1039 | 1032 | ||
1040 | .exit: |
1033 | .exit: |
1041 | ret |
1034 | ret |
Line 1042... | Line 1035... | ||
1042 | endp |
1035 | endp |
1043 | 1036 | ||
1044 | ;----------------------------------------------------------------------------- |
1037 | ;--------------------------------------------------------------- |
1045 | proc key.del ;///// DELETE NEXT CHAR OR SELECTION //////////////////////////// |
1038 | proc key.del ;///// DELETE NEXT CHAR OR SELECTION ////////////// |
1046 | ;----------------------------------------------------------------------------- |
1039 | ;--------------------------------------------------------------- |
Line 1047... | Line 1040... | ||
1047 | call delete_selection |
1040 | call delete_selection |
1048 | jnc .exit |
1041 | jnc .exit |
Line 1180... | Line 1173... | ||
1180 | 1173 | ||
1181 | .exit: |
1174 | .exit: |
1182 | ret |
1175 | ret |
Line 1183... | Line 1176... | ||
1183 | endp |
1176 | endp |
1184 | 1177 | ||
1185 | ;----------------------------------------------------------------------------- |
1178 | ;--------------------------------------------------------------- |
1186 | proc key.ins ;///// TOGGLE INSERT/OVERWRITE MODE ///////////////////////////// |
1179 | proc key.ins ;///// TOGGLE INSERT/OVERWRITE MODE /////////////// |
1187 | ;----------------------------------------------------------------------------- |
1180 | ;--------------------------------------------------------------- |
1188 | xor [ins_mode],1 |
1181 | xor [ins_mode],1 |
1189 | mov eax,[cur_editor.Caret.Y] |
1182 | mov eax,[cur_editor.Caret.Y] |
1190 | mov ebx,eax |
1183 | mov ebx,eax |
1191 | call draw_editor_text.part |
1184 | call draw_editor_text.part |
1192 | call draw_editor_caret |
1185 | call draw_editor_caret |
Line 1193... | Line 1186... | ||
1193 | ret |
1186 | ret |
1194 | endp |
1187 | endp |
1195 | 1188 | ||
1196 | ;----------------------------------------------------------------------------- |
1189 | ;--------------------------------------------------------------- |
1197 | proc key.bkspace ;///// DELETE PREVIOUS CHAR OR SELECTION //////////////////// |
1190 | proc key.bkspace ;///// DELETE PREVIOUS CHAR OR SELECTION ////// |
Line 1198... | Line 1191... | ||
1198 | ;----------------------------------------------------------------------------- |
1191 | ;--------------------------------------------------------------- |
1199 | call delete_selection |
1192 | call delete_selection |
Line 1254... | Line 1247... | ||
1254 | dec [cur_editor.Caret.Y] |
1247 | dec [cur_editor.Caret.Y] |
1255 | cld |
1248 | cld |
1256 | jmp key.del.line_up |
1249 | jmp key.del.line_up |
1257 | endp |
1250 | endp |
Line 1258... | Line 1251... | ||
1258 | 1251 | ||
1259 | ;----------------------------------------------------------------------------- |
1252 | ;--------------------------------------------------------------- |
1260 | proc key.tab ;///// TABULATE ///////////////////////////////////////////////// |
1253 | proc key.tab ;///// TABULATE /////////////////////////////////// |
1261 | ;----------------------------------------------------------------------------- |
1254 | ;--------------------------------------------------------------- |
1262 | call delete_selection |
1255 | call delete_selection |
Line 1263... | Line 1256... | ||
1263 | mov eax,[cur_editor.Caret.X] |
1256 | mov eax,[cur_editor.Caret.X] |
1264 | 1257 | ||
Line 1339... | Line 1332... | ||
1339 | 1332 | ||
1340 | .exit: |
1333 | .exit: |
1341 | ret |
1334 | ret |
Line 1342... | Line 1335... | ||
1342 | endp |
1335 | endp |
1343 | 1336 | ||
1344 | ;----------------------------------------------------------------------------- |
1337 | ;--------------------------------------------------------------- |
1345 | proc key.return ;///// CARRIAGE RETURN /////////////////////////////////////// |
1338 | proc key.return ;///// CARRIAGE RETURN ///////////////////////// |
1346 | ;----------------------------------------------------------------------------- |
1339 | ;--------------------------------------------------------------- |
1347 | call delete_selection |
1340 | call delete_selection |
1348 | ; unknown how many times the user wants to press "Enter", |
1341 | ; unknown how many times the user wants to press "Enter", |
1349 | ; so you should do a little more value |
1342 | ; so you should do a little more value |
Line 1476... | Line 1469... | ||
1476 | 1469 | ||
1477 | .exit: |
1470 | .exit: |
1478 | ret |
1471 | ret |
Line 1479... | Line 1472... | ||
1479 | endp |
1472 | endp |
1480 | 1473 | ||
1481 | ;----------------------------------------------------------------------------- |
1474 | ;--------------------------------------------------------------- |
1482 | proc key.ctrl_tab ;///// SWITCH TO NEXT TAB ////////////////////////////////// |
1475 | proc key.ctrl_tab ;///// SWITCH TO NEXT TAB //////////////////// |
1483 | ;----------------------------------------------------------------------------- |
1476 | ;--------------------------------------------------------------- |
1484 | cmp [tab_bar.Items.Count],1 |
1477 | cmp [tab_bar.Items.Count],1 |
1485 | je .exit |
1478 | je .exit |
1486 | xor eax,eax |
1479 | xor eax,eax |
Line 1503... | Line 1496... | ||
1503 | call update_caption |
1496 | call update_caption |
1504 | .exit: |
1497 | .exit: |
1505 | ret |
1498 | ret |
1506 | endp |
1499 | endp |
Line 1507... | Line 1500... | ||
1507 | 1500 | ||
1508 | ;----------------------------------------------------------------------------- |
1501 | ;--------------------------------------------------------------- |
1509 | proc key.shift_ctrl_tab ;///// SWITCH TO PREVIOUS TAB //////////////////////// |
1502 | proc key.shift_ctrl_tab ;///// SWITCH TO PREVIOUS TAB ////////// |
1510 | ;----------------------------------------------------------------------------- |
1503 | ;--------------------------------------------------------------- |
1511 | cmp [tab_bar.Items.Count],1 |
1504 | cmp [tab_bar.Items.Count],1 |
1512 | je .exit |
1505 | je .exit |
1513 | xor eax,eax |
1506 | xor eax,eax |
1514 | mov ebp,[tab_bar.Items] |
1507 | mov ebp,[tab_bar.Items] |
Line 1531... | Line 1524... | ||
1531 | call update_caption |
1524 | call update_caption |
1532 | .exit: |
1525 | .exit: |
1533 | ret |
1526 | ret |
1534 | endp |
1527 | endp |
Line 1535... | Line 1528... | ||
1535 | 1528 | ||
1536 | ;----------------------------------------------------------------------------- |
1529 | ;--------------------------------------------------------------- |
1537 | proc key.ctrl_f4 ;///// CLOSE CURRENT TAB //////////////////////////////////// |
1530 | proc key.ctrl_f4 ;///// CLOSE CURRENT TAB ////////////////////// |
1538 | ;----------------------------------------------------------------------------- |
1531 | ;--------------------------------------------------------------- |
1539 | cmp [cur_editor.Modified],0 |
1532 | cmp [cur_editor.Modified],0 |
1540 | je .close |
1533 | je .close |
1541 | mov [bot_mode2],2 |
1534 | mov [bot_mode2],2 |
1542 | jmp key.ctrl_o.direct |
1535 | jmp key.ctrl_o.direct |
Line 1555... | Line 1548... | ||
1555 | call draw_tabctl |
1548 | call draw_tabctl |
1556 | call draw_statusbar |
1549 | call draw_statusbar |
1557 | ret |
1550 | ret |
1558 | endp |
1551 | endp |
Line 1559... | Line 1552... | ||
1559 | 1552 | ||
1560 | ;----------------------------------------------------------------------------- |
1553 | ;--------------------------------------------------------------- |
1561 | proc key.shift_f9 ;///// SET DEFAULT TAB ///////////////////////////////////// |
1554 | proc key.shift_f9 ;///// SET DEFAULT TAB /////////////////////// |
1562 | ;----------------------------------------------------------------------------- |
1555 | ;--------------------------------------------------------------- |
1563 | mov eax,[tab_bar.Current.Ptr] |
1556 | mov eax,[tab_bar.Current.Ptr] |
1564 | cmp eax,[tab_bar.Default.Ptr] |
1557 | cmp eax,[tab_bar.Default.Ptr] |
1565 | jne @f |
1558 | jne @f |
1566 | xor eax,eax |
1559 | xor eax,eax |
Line 1573... | Line 1566... | ||
1573 | call draw_editor |
1566 | call draw_editor |
1574 | @@: call draw_tabctl |
1567 | @@: call draw_tabctl |
1575 | ret |
1568 | ret |
1576 | endp |
1569 | endp |
Line 1577... | Line 1570... | ||
1577 | 1570 | ||
1578 | ;----------------------------------------------------------------------------- |
1571 | ;--------------------------------------------------------------- |
1579 | proc key.f3 ;///// FIND NEXT MATCH /////////////////////////////////////////// |
1572 | proc key.f3 ;///// FIND NEXT MATCH ///////////////////////////// |
1580 | ;----------------------------------------------------------------------------- |
1573 | ;--------------------------------------------------------------- |
1581 | jmp search |
1574 | jmp search |
Line 1582... | Line 1575... | ||
1582 | endp |
1575 | endp |
1583 | 1576 | ||
1584 | ;----------------------------------------------------------------------------- |
1577 | ;--------------------------------------------------------------- |
1585 | proc key.ctrl_f9 ;///// COMPILE ////////////////////////////////////////////// |
1578 | proc key.ctrl_f9 ;///// COMPILE //////////////////////////////// |
1586 | ;----------------------------------------------------------------------------- |
1579 | ;--------------------------------------------------------------- |
1587 | mov bl,0 |
1580 | mov bl,0 |
Line 1588... | Line 1581... | ||
1588 | jmp start_fasm |
1581 | jmp start_fasm |
1589 | endp |
1582 | endp |
1590 | 1583 | ||
1591 | ;----------------------------------------------------------------------------- |
1584 | ;--------------------------------------------------------------- |
1592 | proc key.f9 ;///// COMPILE AND RUN /////////////////////////////////////////// |
1585 | proc key.f9 ;///// COMPILE AND RUN ///////////////////////////// |
1593 | ;----------------------------------------------------------------------------- |
1586 | ;--------------------------------------------------------------- |
Line 1594... | Line 1587... | ||
1594 | mov bl,1 |
1587 | mov bl,1 |
1595 | jmp start_fasm |
1588 | jmp start_fasm |
1596 | endp |
1589 | endp |
1597 | 1590 | ||
1598 | ;----------------------------------------------------------------------------- |
1591 | ;--------------------------------------------------------------- |
1599 | proc key.f10 ;///// COMPILE AND RUN UNDER DEBUG ////////////////////////////// |
1592 | proc key.f10 ;///// COMPILE AND RUN UNDER DEBUG //////////////// |
Line 1600... | Line 1593... | ||
1600 | ;----------------------------------------------------------------------------- |
1593 | ;--------------------------------------------------------------- |
1601 | mov bl,2 |
1594 | mov bl,2 |
1602 | jmp start_fasm |
1595 | jmp start_fasm |
1603 | endp |
1596 | endp |
1604 | 1597 | ||
1605 | ;----------------------------------------------------------------------------- |
1598 | ;--------------------------------------------------------------- |
1606 | proc key.alt_x ;///// EXIT PROGRAM /////////////////////////////////////////// |
1599 | proc key.alt_x ;///// EXIT PROGRAM ///////////////////////////// |
1607 | ;----------------------------------------------------------------------------- |
1600 | ;--------------------------------------------------------------- |
Line 1622... | Line 1615... | ||
1622 | .close: |
1615 | .close: |
1623 | mov [main_closed],1 |
1616 | mov [main_closed],1 |
1624 | mcall -1 |
1617 | mcall -1 |
1625 | endp |
1618 | endp |
Line 1626... | Line 1619... | ||
1626 | 1619 | ||
- | 1620 | ;--------------------------------------------------------------- |
|
- | 1621 | proc key.ctrl_plus ;///// ZOOM IN ////////////////////////////// |
|
- | 1622 | ;--------------------------------------------------------------- |
|
- | 1623 | cmp [scale],7 |
|
- | 1624 | jz @f |
|
- | 1625 | inc [scale] |
|
- | 1626 | add [lineHeight],LINEH |
|
- | 1627 | add [charWidth],6 |
|
- | 1628 | jmp draw_editor |
|
- | 1629 | endp |
|
- | 1630 | ||
- | 1631 | ;--------------------------------------------------------------- |
|
- | 1632 | proc key.ctrl_minus ;///// ZOOM OUT //////////////////////////// |
|
- | 1633 | ;--------------------------------------------------------------- |
|
- | 1634 | cmp [scale],0 |
|
- | 1635 | jz @f |
|
- | 1636 | dec [scale] |
|
- | 1637 | sub [lineHeight],LINEH |
|
- | 1638 | sub [charWidth],6 |
|
- | 1639 | jmp draw_editor |
|
- | 1640 | @@: |
|
- | 1641 | ret |
|
- | 1642 | endp |
|
- | 1643 | ||
1627 | ;----------------------------------------------------------------------------- |
1644 | ;--------------------------------------------------------------- |
1628 | proc try_to_close_tabs ;///// FIND TABS TO BE SAVED BEFORE CLOSE ///////////// |
1645 | proc try_to_close_tabs ;// FIND TABS TO BE SAVED BEFORE CLOSE // |
1629 | ;----------------------------------------------------------------------------- |
1646 | ;--------------------------------------------------------------- |
1630 | push ecx ebp |
1647 | push ecx ebp |
1631 | call flush_cur_tab |
1648 | call flush_cur_tab |
1632 | mov ebp,[exit_tab_item] ; [tab_bar.Items] |
1649 | mov ebp,[exit_tab_item] ; [tab_bar.Items] |
1633 | add ebp,-sizeof.TABITEM |
1650 | add ebp,-sizeof.TABITEM |