tinypad: 4GB line length limit; settings in INI file; bugfixes

git-svn-id: svn://kolibrios.org@987 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Mihail Semenyako (mike.dld) 2008-12-29 19:08:59 +00:00
parent d2029b5462
commit 7e149d6d99
14 changed files with 469 additions and 329 deletions

View File

@ -3,22 +3,38 @@ vscrl_capt dd -1
hscrl_capt dd -1 hscrl_capt dd -1
body_capt dd -1 body_capt dd -1
ins_mode db 1
s_status dd 0 s_status dd 0
sz app_fasm ,'/RD/1/DEVELOP/FASM',0 sz app_fasm ,'/rd/1/develop/fasm',0
sz app_board ,'/RD/1/BOARD',0 sz app_board ,'/rd/1/board',0
sz app_tinypad ,'/RD/1/TINYPAD',0 sz app_tinypad ,'/rd/1/tinypad',0
sz app_docpak ,'/RD/1/DOCPAK',0 sz app_docpak ,'/rd/1/docpak',0
sz sysfuncs_param,'g',0 sz sysfuncs_param,'g',0
include 'tp-tables.inc' include 'tp-tables.inc'
include 'tp-locale.inc' include 'tp-locale.inc'
macro editor_lines [str, flags]
{
common
local size
forward
virtual at 0
db str
size = $
end virtual
dd size
dw flags
db str
common
dd 0
}
;// options dialog data [ ;// options dialog data [
label optsdlg_editor at $-EDITOR.Bounds label optsdlg_editor at $-EDITOR.Bounds
; rb PATHL ; FilePath db PATHL dup(?)
; dd 0 ; FileName dd ?
dd ?,?,?,? ; Bounds RECT dd ?,?,?,? ; Bounds RECT
dd @f ; Lines dd ? dd @f ; Lines dd ?
dd ? ; Lines.Size dd ? dd ? ; Lines.Size dd ?
@ -35,25 +51,16 @@ label optsdlg_editor at $-EDITOR.Bounds
db 0 ; Modified db ? db 0 ; Modified db ?
@@: @@:
dd 0x00000000+1 editor_lines \
db ' ' ' ', 0, \
dd 0x00010000+9 ' org 100h', EDITOR_LINE_FLAG_MOFIFIED, \
db ' org 100h' ' ', 0, \
dd 0x00000000+1 ' mov ah,09h ; write', 0, \
db ' ' ' mov dx,text', 0, \
dd 0x00000000+20 ' int 21h', 0, \
db ' mov ah,09h ; write' ' int 20h', EDITOR_LINE_FLAG_MOFIFIED + EDITOR_LINE_FLAG_SAVED, \
dd 0x00000000+12 ' ', 0, \
db ' mov dx,text' ' text db "Hello!",24h', 0
dd 0x00000000+8
db ' int 21h'
dd 0x00030000+8
db ' int 20h'
dd 0x00000000+1
db ' '
dd 0x00000000+21
db ' text db "Hello!",24h'
dd 0
optsdlg_editor_parts: ; left,top,right,bottom,type optsdlg_editor_parts: ; left,top,right,bottom,type
db 0, 12, 13, 29, 22 db 0, 12, 13, 29, 22
@ -77,10 +84,33 @@ optsdlg_editor_parts: ; left,top,right,bottom,type
;// ] ;// ]
sz symbols_ex,';?.%"',"'" sz symbols_ex,';?.%"',"'"
sz symbols ,'#&*\:/<>|{}()[]=+-, ' sz symbols,'#&*\:/<>|{}()[]=+-, '
sz ini_sec_window ,'Window',0 ; INI file section/key names
sz ini_window_top ,'Top',0
sz ini_window_left ,'Left',0 sz ini_sec_window,INI_SEC_PREFIX,'window',0
sz ini_window_right ,'Right',0 sz ini_window_top,'top',0
sz ini_window_bottom,'Bottom',0 sz ini_window_left,'left',0
sz ini_window_width,'width',0
sz ini_window_height,'height',0
sz ini_sec_colors,INI_SEC_PREFIX,'colors',0
sz ini_colors_text,'text',0
sz ini_colors_back,'back',0
sz ini_colors_text_sel,'text_sel',0
sz ini_colors_back_sel,'back_sel',0
sz ini_colors_symbol,'symbol',0
sz ini_colors_number,'number',0
sz ini_colors_string,'string',0
sz ini_colors_comment,'comment',0
sz ini_colors_line_moded,'line_moded',0
sz ini_colors_line_saved,'line_saved',0
sz ini_sec_options,INI_SEC_PREFIX,'options',0
sz ini_options_tabs_pos,'tabs_pos',0
sz ini_options_secure_sel,'secure_sel',0
sz ini_options_auto_braces,'auto_braces',0
sz ini_options_auto_indent,'auto_indent',0
sz ini_options_smart_tab,'smart_tab',0
sz ini_options_optim_save,'optim_save',0
sz ini_options_line_nums,'line_nums',0

View File

@ -1,6 +1,4 @@
self_path rb PATHL
app_start: app_start:
dd ?,? dd ?,?
.params dd ? .params dd ?
@ -106,3 +104,29 @@ exit_tab_num dd ?
temp_buf dd ? temp_buf dd ?
copy_buf dd ? copy_buf dd ?
label color_tbl dword
.text dd ?
.back dd ?
.text.sel dd ?
.back.sel dd ?
.symbol dd ?
.number dd ?
.string dd ?
.comment dd ?
.line.moded dd ?
.line.saved dd ?
tabs_pos db ?
secure_sel db ?
auto_braces db ?
auto_indent db ?
smart_tab db ?
optim_save db ?
line_nums db ?
mainwnd_pos:
.x dd ?
.y dd ?
.w dd ?
.h dd ?

View File

@ -15,8 +15,6 @@ proc dll.Load, import_table:dword
or eax,eax or eax,eax
jz .fail jz .fail
stdcall dll.Link,eax,edx stdcall dll.Link,eax,edx
or eax,eax
jz .fail
stdcall dll.Init,[eax+4] stdcall dll.Init,[eax+4]
pop esi pop esi
add esi,8 add esi,8
@ -60,8 +58,10 @@ endp
proc dll.GetProcAddress, exp:dword,sz_name:dword proc dll.GetProcAddress, exp:dword,sz_name:dword
mov edx,[exp] mov edx,[exp]
.next: xor eax,eax xor eax,eax
test edx,edx .next: or edx,edx
jz .end
cmp dword[edx],0
jz .end jz .end
stdcall strcmp,[edx],[sz_name] stdcall strcmp,[edx],[sz_name]
test eax,eax test eax,eax
@ -88,5 +88,6 @@ proc strcmp, str1:dword,str2:dword
ret ret
endp endp
s_libdir db '/rd/1/lib/' s_libdir:
s_libdir.fname rb 32 db '/sys/lib/'
.fname rb 32

View File

@ -1,25 +1,35 @@
;----------------------------------------------------------------------------- ;;================================================================================================;;
; Copyright (c) 2006-2007, mike.dld ;;//// libio.inc //// (c) mike.dld, 2007-2008 ////////////////////////////////////////////////////;;
;----------------------------------------------------------------------------- ;;================================================================================================;;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ;; ;;
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ;; This file is part of Common development libraries (Libs-Dev). ;;
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ;; ;;
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ;; General Public License as published by the Free Software Foundation, either version 3 of the ;;
; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ;; License, or (at your option) any later version. ;;
; DEALINGS IN THE SOFTWARE. ;; ;;
;----------------------------------------------------------------------------- ;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
;; General Public License for more details. ;;
;; ;;
;; You should have received a copy of the GNU General Public License along with Libs-Dev. If not, ;;
;; see <http://www.gnu.org/licenses/>. ;;
;; ;;
;;================================================================================================;;
O_BINARY = 00000000b
O_READ = 00000001b O_READ = 00000001b
O_WRITE = 00000010b O_WRITE = 00000010b
O_CREATE = 00000100b O_CREATE = 00000100b
O_SHARE = 00001000b O_SHARE = 00001000b
O_TEXT = 00010000b
SEEK_SET = 0 SEEK_SET = 0
SEEK_CUR = 1 SEEK_CUR = 1
SEEK_END = 2 SEEK_END = 2
struct DateTime struct FileDateTime
union union
time dd ? time dd ?
struct struct
@ -58,22 +68,32 @@ ends
struct FileInfoA struct FileInfoA
Attributes dd ? Attributes dd ?
Flags dd ? Flags dd ?
DateCreate DateTime DateCreate FileDateTime
DateAccess DateTime DateAccess FileDateTime
DateModify DateTime DateModify FileDateTime
FileSize dd ? union
FileSizeHigh dd ? FileSize dq ?
FileName rb 264 struct
FileSizeLow dd ?
FileSizeHigh dd ?
ends
ends
FileName rb 252
ends ends
struct FileInfoW struct FileInfoW
Attributes dd ? Attributes dd ?
Flags dd ? Flags dd ?
DateCreate DateTime DateCreate FileDateTime
DateAccess DateTime DateAccess FileDateTime
DateModify DateTime DateModify FileDateTime
FileSize dd ? union
FileSizeHigh dd ? FileSize dq ?
struct
FileSizeLow dd ?
FileSizeHigh dd ?
ends
ends
FileName rw 260 FileName rw 260
ends ends
@ -89,3 +109,4 @@ FA_SYSTEM = 00000100b
FA_LABEL = 00001000b FA_LABEL = 00001000b
FA_FOLDER = 00010000b FA_FOLDER = 00010000b
FA_ARCHIVED = 00100000b FA_ARCHIVED = 00100000b
FA_ANY = 00111111b

View File

@ -9,6 +9,10 @@ HISTORY:
- line is redrawn after lining up a single char and then deleting it - line is redrawn after lining up a single char and then deleting it
(pressing Del twice) [#1] (pressing Del twice) [#1]
- update tab/window title and highlighting mode after file save - update tab/window title and highlighting mode after file save
- allocate 1024 bytes in case file not found (avoid crash)
changes:
- max line length changed back to 4GB, each line overhead is 6 bytes now
- settings are stored in INI file (using libini), allowing binary to be compressed
new features: new features:
- prompt to save modified file before closing (+fixes) - prompt to save modified file before closing (+fixes)
- button to close current tab (+fixes) - button to close current tab (+fixes)
@ -53,7 +57,7 @@ HISTORY:
- function 70 instead of 58 for files loading/saving - function 70 instead of 58 for files loading/saving
- clientarea-relative drawing (less code) - clientarea-relative drawing (less code)
- every line's dword is now splitted into 2 words; - every line's dword is now splitted into 2 words;
low word - line block length, so max line length is 65535 now low word - line block length, so max line length is 64KB now
high word - various flags. for now, only 2 of 16 bits are used: high word - various flags. for now, only 2 of 16 bits are used:
if bit #0 is set, line was modified since file open if bit #0 is set, line was modified since file open
if bit #1 is set, line was saved after last modification if bit #1 is set, line was saved after last modification

View File

@ -32,7 +32,7 @@ include 'tinypad.inc'
;purge mov,add,sub ;  SPEED ;purge mov,add,sub ;  SPEED
header '01',1,@CODE,TINYPAD_END,STATIC_MEM_END,MAIN_STACK,@PARAMS,self_path header '01',1,@CODE,TINYPAD_END,STATIC_MEM_END,MAIN_STACK,@PARAMS,ini_path
APP_VERSION equ 'SVN (4.0.5)' APP_VERSION equ 'SVN (4.0.5)'
@ -44,6 +44,8 @@ FALSE = 0
;define __DEBUG_LEVEL__ 1 ;define __DEBUG_LEVEL__ 1
;include 'debug-fdo.inc' ;include 'debug-fdo.inc'
; compiled-in options
ASEPC = '-' ; separator character (char) ASEPC = '-' ; separator character (char)
ATOPH = 19 ; menu bar height (pixels) ATOPH = 19 ; menu bar height (pixels)
SCRLW = 16 ; scrollbar widht/height (pixels) SCRLW = 16 ; scrollbar widht/height (pixels)
@ -56,59 +58,18 @@ LCHGW = 3 ; changed/saved marker width (pixels)
STATH = 16 ; status bar height (pixels) STATH = 16 ; status bar height (pixels)
TBARH = 18 ; tab bar height (pixels) TBARH = 18 ; tab bar height (pixels)
;----------------------------------------------------------------------------- INI_SEC_PREFIX equ ''
section @OPTIONS ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;-----------------------------------------------------------------------------
label color_tbl dword
.text: RGB( 0, 0, 0)
.back: RGB(255,255,255)
.text.sel: RGB(255,255,255)
.back.sel: RGB( 10, 36,106)
.symbol: RGB( 48, 48,240)
.number: RGB( 0,144, 0)
.string: RGB(176, 0, 0)
.comment: RGB(128,128,128)
.line.moded: RGB(255,238, 98)
.line.saved: RGB(108,226,108)
ins_mode db 1
tab_pos db 2
options db OPTS_AUTOINDENT+OPTS_OPTIMSAVE+OPTS_SMARTTAB
mainwnd_pos:
.x dd 250
.y dd 75
.w dd 6*80+6+SCRLW+5 ;- 220
.h dd 402 ;- 220
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
section @CODE ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: section @CODE ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
; fninit
; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_left,50
; mov [mainwnd_pos.x],eax
; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_top,50
; mov [mainwnd_pos.y],eax
; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_right,350
; sub eax,[mainwnd_pos.x]
; mov [mainwnd_pos.w],eax
; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_bottom,450
; sub eax,[mainwnd_pos.y]
; mov [mainwnd_pos.h],eax
cld cld
mov edi,@UDATA mov edi,@UDATA
mov ecx,@PARAMS-@UDATA mov ecx,@PARAMS-@UDATA
mov al,0 mov al,0
rep stosb rep stosb
mov al,[tab_pos]
mov [tab_bar.Style],al
mcall 68,11 mcall 68,11
or eax,eax or eax,eax
jz key.alt_x.close jz key.alt_x.close
@ -117,6 +78,15 @@ section @CODE ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
or eax,eax or eax,eax
jnz key.alt_x.close jnz key.alt_x.close
mov edi,ini_path
xor al,al
mov ecx,PATHL
repne scasb
mov dword[edi-1],'.ini'
mov byte[edi+3],0
stdcall load_settings
stdcall mem.Alloc,65536 stdcall mem.Alloc,65536
mov [temp_buf],eax mov [temp_buf],eax
@ -208,6 +178,10 @@ section @CODE ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@@: @@:
mov [s_status],0 mov [s_status],0
dec [do_not_draw] dec [do_not_draw]
mov al,[tabs_pos]
mov [tab_bar.Style],al
mcall 66,1,1 mcall 66,1,1
mcall 40,00100111b mcall 40,00100111b
red: red:
@ -296,6 +270,100 @@ proc get_event ctx ;//////////////////////////////////////////////////////////
ret ret
endp endp
;-----------------------------------------------------------------------------
proc load_settings ;//////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
pushad
invoke ini.get_int,ini_path,ini_sec_options,ini_options_tabs_pos,2
mov [tabs_pos],al
invoke ini.get_int,ini_path,ini_sec_options,ini_options_secure_sel,0
mov [secure_sel],al
invoke ini.get_int,ini_path,ini_sec_options,ini_options_auto_braces,0
mov [auto_braces],al
invoke ini.get_int,ini_path,ini_sec_options,ini_options_auto_indent,1
mov [auto_indent],al
invoke ini.get_int,ini_path,ini_sec_options,ini_options_smart_tab,1
mov [smart_tab],al
invoke ini.get_int,ini_path,ini_sec_options,ini_options_optim_save,1
mov [optim_save],al
invoke ini.get_int,ini_path,ini_sec_options,ini_options_line_nums,0
mov [line_nums],al
invoke ini.get_color,ini_path,ini_sec_colors,ini_colors_text,0x00000000
mov [color_tbl.text],eax
invoke ini.get_color,ini_path,ini_sec_colors,ini_colors_back,0x00ffffff
mov [color_tbl.back],eax
invoke ini.get_color,ini_path,ini_sec_colors,ini_colors_text_sel,0x00ffffff
mov [color_tbl.text.sel],eax
invoke ini.get_color,ini_path,ini_sec_colors,ini_colors_back_sel,0x000a246a
mov [color_tbl.back.sel],eax
invoke ini.get_color,ini_path,ini_sec_colors,ini_colors_symbol,0x003030f0
mov [color_tbl.symbol],eax
invoke ini.get_color,ini_path,ini_sec_colors,ini_colors_number,0x00009000
mov [color_tbl.number],eax
invoke ini.get_color,ini_path,ini_sec_colors,ini_colors_string,0x00b00000
mov [color_tbl.string],eax
invoke ini.get_color,ini_path,ini_sec_colors,ini_colors_comment,0x00808080
mov [color_tbl.comment],eax
invoke ini.get_color,ini_path,ini_sec_colors,ini_colors_line_moded,0x00ffee62
mov [color_tbl.line.moded],eax
invoke ini.get_color,ini_path,ini_sec_colors,ini_colors_line_saved,0x006ce26c
mov [color_tbl.line.saved],eax
invoke ini.get_int,ini_path,ini_sec_window,ini_window_left,250
mov [mainwnd_pos.x],eax
invoke ini.get_int,ini_path,ini_sec_window,ini_window_top,75
mov [mainwnd_pos.y],eax
invoke ini.get_int,ini_path,ini_sec_window,ini_window_width,6*80+6+SCRLW+5
mov [mainwnd_pos.w],eax
invoke ini.get_int,ini_path,ini_sec_window,ini_window_height,402
mov [mainwnd_pos.h],eax
popad
ret
endp
;-----------------------------------------------------------------------------
proc save_settings ;//////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
pushad
movzx eax,[tabs_pos]
invoke ini.set_int,ini_path,ini_sec_options,ini_options_tabs_pos,eax
movzx eax,[secure_sel]
invoke ini.set_int,ini_path,ini_sec_options,ini_options_secure_sel,eax
movzx eax,[auto_braces]
invoke ini.set_int,ini_path,ini_sec_options,ini_options_auto_braces,eax
movzx eax,[auto_indent]
invoke ini.set_int,ini_path,ini_sec_options,ini_options_auto_indent,eax
movzx eax,[smart_tab]
invoke ini.set_int,ini_path,ini_sec_options,ini_options_smart_tab,eax
movzx eax,[optim_save]
invoke ini.set_int,ini_path,ini_sec_options,ini_options_optim_save,eax
movzx eax,[line_nums]
invoke ini.set_int,ini_path,ini_sec_options,ini_options_line_nums,eax
invoke ini.set_color,ini_path,ini_sec_colors,ini_colors_text,[color_tbl.text]
invoke ini.set_color,ini_path,ini_sec_colors,ini_colors_back,[color_tbl.back]
invoke ini.set_color,ini_path,ini_sec_colors,ini_colors_text_sel,[color_tbl.text.sel]
invoke ini.set_color,ini_path,ini_sec_colors,ini_colors_back_sel,[color_tbl.back.sel]
invoke ini.set_color,ini_path,ini_sec_colors,ini_colors_symbol,[color_tbl.symbol]
invoke ini.set_color,ini_path,ini_sec_colors,ini_colors_number,[color_tbl.number]
invoke ini.set_color,ini_path,ini_sec_colors,ini_colors_string,[color_tbl.string]
invoke ini.set_color,ini_path,ini_sec_colors,ini_colors_comment,[color_tbl.comment]
invoke ini.set_color,ini_path,ini_sec_colors,ini_colors_line_moded,[color_tbl.line.moded]
invoke ini.set_color,ini_path,ini_sec_colors,ini_colors_line_saved,[color_tbl.line.saved]
invoke ini.set_int,ini_path,ini_sec_window,ini_window_left,[mainwnd_pos.x]
invoke ini.set_int,ini_path,ini_sec_window,ini_window_top,[mainwnd_pos.y]
invoke ini.set_int,ini_path,ini_sec_window,ini_window_width,[mainwnd_pos.w]
invoke ini.set_int,ini_path,ini_sec_window,ini_window_height,[mainwnd_pos.h]
popad
ret
endp
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
proc start_fasm ;///////////////////////////////////////////////////////////// proc start_fasm ;/////////////////////////////////////////////////////////////
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
@ -408,22 +476,19 @@ set_opt:
ret ret
.line_numbers: .line_numbers:
mov al,OPTS_LINENUMS xor [line_nums],1
jmp .main ret
.optimal_fill: .optimal_fill:
mov al,OPTS_OPTIMSAVE xor [optim_save],1
jmp .main ret
.auto_indents: .auto_indents:
mov al,OPTS_AUTOINDENT xor [auto_indent],1
jmp .main ret
.auto_braces: .auto_braces:
mov al,OPTS_AUTOBRACES xor [auto_braces],1
jmp .main ret
.secure_sel: .secure_sel:
mov al,OPTS_SECURESEL xor [secure_sel],1
.main:
xor [options],al
ret ret
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
@ -456,8 +521,6 @@ include 'data/tp-idata.inc'
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
section @IMPORT ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: section @IMPORT ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
;align 16
;@IMPORT:
library \ library \
libini,'libini.obj',\ libini,'libini.obj',\
@ -465,10 +528,12 @@ library \
libgfx,'libgfx.obj' libgfx,'libgfx.obj'
import libini, \ import libini, \
ini.get_str,'ini.get_str',\ ini.get_str ,'ini.get_str',\
ini.set_str,'ini.set_str',\ ini.set_str ,'ini.set_str',\
ini.get_int,'ini.get_int',\ ini.get_int ,'ini.get_int',\
ini.set_int,'ini.set_int' ini.set_int ,'ini.set_int',\
ini.get_color,'ini.get_color',\
ini.set_color,'ini.set_color'
import libio, \ import libio, \
file.find_first,'file.find_first',\ file.find_first,'file.find_first',\
@ -520,6 +585,8 @@ p_info process_information
p_info2 process_information p_info2 process_information
sc system_colors sc system_colors
ini_path rb PATHL
rb 1024*4 rb 1024*4
MAIN_STACK: MAIN_STACK:
rb 1024*4 rb 1024*4

View File

@ -48,6 +48,14 @@ struct EDITOR
db ? db ?
ends ends
struct EDITOR_LINE_DATA
Size dd ?
Flags dw ?
ends
EDITOR_LINE_FLAG_MOFIFIED = 0x0001
EDITOR_LINE_FLAG_SAVED = 0x0002
struct TABITEM struct TABITEM
Editor EDITOR Editor EDITOR
ends ends
@ -201,15 +209,6 @@ macro menubar_res _name,[_lang,_title,_popup,_onshow]
end if end if
} }
;// OPTIONS
OPTS_SECURESEL = 00000001b
OPTS_AUTOBRACES = 00000010b
OPTS_AUTOINDENT = 00000100b
OPTS_SMARTTAB = 00001000b
OPTS_OPTIMSAVE = 00010000b
OPTS_LINENUMS = 00100000b
;// MOUSE EVENTS ;// MOUSE EVENTS
MEV_LDOWN = 1 MEV_LDOWN = 1

View File

@ -70,8 +70,8 @@ endp
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
proc get_real_length ;//////////////////////////////////////////////////////// proc get_real_length ;////////////////////////////////////////////////////////
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
movzx eax,word[esi] mov eax,[esi+EDITOR_LINE_DATA.Size]
@@: cmp byte[esi+eax+4-1],' ' @@: cmp byte[esi+eax+sizeof.EDITOR_LINE_DATA-1],' '
jne @f jne @f
dec eax dec eax
jnz @b jnz @b
@ -90,8 +90,8 @@ proc get_line_offset ;////////////////////////////////////////////////////////
mov esi,[cur_editor.Lines] mov esi,[cur_editor.Lines]
@@: dec ecx @@: dec ecx
js .exit js .exit
movzx eax,word[esi] mov eax,[esi+EDITOR_LINE_DATA.Size]
lea esi,[esi+eax+4] lea esi,[esi+eax+sizeof.EDITOR_LINE_DATA]
jmp @b jmp @b
.exit: .exit:
pop ecx eax pop ecx eax
@ -358,22 +358,22 @@ proc line_add_spaces ;////////////////////////////////////////////////////////
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
xor eax,eax xor eax,eax
pushad pushad
movzx edx,word[esi] mov edx,[esi+EDITOR_LINE_DATA.Size]
cmp ecx,edx cmp ecx,edx
jbe .exit jbe .exit
sub ecx,edx sub ecx,edx
lea eax,[ecx+4] lea eax,[ecx+sizeof.EDITOR_LINE_DATA]
call editor_realloc_lines call editor_realloc_lines
mov [esp+4*7],eax mov [esp+4*7],eax
add esi,eax add esi,eax
push ecx push ecx
mov edi,[cur_editor.Lines] mov edi,[cur_editor.Lines]
add edi,[edi-4] add edi,[cur_editor.Lines.Size] ; !!! CHECK THIS!!! add edi,[edi-4]
dec edi dec edi
mov eax,esi mov eax,esi
mov esi,edi mov esi,edi
sub esi,ecx sub esi,ecx
lea ecx,[eax+4] lea ecx,[eax+sizeof.EDITOR_LINE_DATA]
add ecx,edx add ecx,edx
push ecx push ecx
neg ecx neg ecx
@ -381,7 +381,7 @@ proc line_add_spaces ;////////////////////////////////////////////////////////
std std
rep movsb rep movsb
pop edi ecx pop edi ecx
add [eax],cx add [eax+EDITOR_LINE_DATA.Size],ecx
mov al,' ' mov al,' '
cld cld
rep stosb rep stosb
@ -403,25 +403,25 @@ proc delete_selection ;///////////////////////////////////////////////////////
cmp ecx,[sel.end.y] cmp ecx,[sel.end.y]
je .single_line je .single_line
call get_line_offset call get_line_offset
and dword[esi],not 0x00020000 and [esi+EDITOR_LINE_DATA.Flags],not EDITOR_LINE_FLAG_SAVED
or dword[esi],0x00010000 or [esi+EDITOR_LINE_DATA.Flags],EDITOR_LINE_FLAG_MOFIFIED
mov ecx,[sel.begin.x] mov ecx,[sel.begin.x]
call line_add_spaces call line_add_spaces
add esi,eax add esi,eax
lea edi,[esi+4] lea edi,[esi+sizeof.EDITOR_LINE_DATA]
mov ecx,[sel.end.y] mov ecx,[sel.end.y]
call get_line_offset call get_line_offset
call get_real_length call get_real_length
cmp eax,[sel.end.x] cmp eax,[sel.end.x]
jbe @f jbe @f
mov eax,[sel.end.x] mov eax,[sel.end.x]
@@: movzx ecx,word[esi] @@: mov ecx,[esi+EDITOR_LINE_DATA.Size]
sub ecx,eax sub ecx,eax
mov ebx,[sel.begin.x] mov ebx,[sel.begin.x]
add ebx,ecx add ebx,ecx
mov [edi-4],bx mov [edi-sizeof.EDITOR_LINE_DATA+EDITOR_LINE_DATA.Size],ebx
add edi,[sel.begin.x] add edi,[sel.begin.x]
lea esi,[esi+eax+4] lea esi,[esi+eax+sizeof.EDITOR_LINE_DATA]
mov ecx,[cur_editor.Lines] mov ecx,[cur_editor.Lines]
add ecx,[cur_editor.Lines.Size] ;*** add ecx,[ecx-4] add ecx,[cur_editor.Lines.Size] ;*** add ecx,[ecx-4]
sub ecx,esi sub ecx,esi
@ -434,8 +434,8 @@ proc delete_selection ;///////////////////////////////////////////////////////
.single_line: .single_line:
call get_line_offset call get_line_offset
and dword[esi],not 0x00020000 and [esi+EDITOR_LINE_DATA.Flags],not EDITOR_LINE_FLAG_SAVED
or dword[esi],0x00010000 or [esi+EDITOR_LINE_DATA.Flags],EDITOR_LINE_FLAG_MOFIFIED
call get_real_length call get_real_length
cmp eax,[sel.begin.x] cmp eax,[sel.begin.x]
jbe .exit jbe .exit
@ -444,8 +444,8 @@ proc delete_selection ;///////////////////////////////////////////////////////
jbe @f jbe @f
mov ecx,eax mov ecx,eax
@@: sub ecx,[sel.begin.x] @@: sub ecx,[sel.begin.x]
sub [esi],cx sub [esi+EDITOR_LINE_DATA.Size],ecx
lea edi,[esi+4] lea edi,[esi+sizeof.EDITOR_LINE_DATA]
add edi,[sel.begin.x] add edi,[sel.begin.x]
lea esi,[edi+ecx] lea esi,[edi+ecx]
mov ecx,[cur_editor.Lines] mov ecx,[cur_editor.Lines]
@ -464,8 +464,8 @@ proc delete_selection ;///////////////////////////////////////////////////////
mov ecx,[cur_editor.Lines.Count] mov ecx,[cur_editor.Lines.Count]
call get_line_offset call get_line_offset
movzx eax,word[esi] mov eax,[esi+EDITOR_LINE_DATA.Size]
lea esi,[esi+eax+4] lea esi,[esi+eax+sizeof.EDITOR_LINE_DATA]
mov eax,[cur_editor.Lines] mov eax,[cur_editor.Lines]
add eax,[cur_editor.Lines.Size] ;*** add eax,[eax-4] add eax,[cur_editor.Lines.Size] ;*** add eax,[eax-4]
sub esi,eax sub esi,eax

View File

@ -350,8 +350,9 @@ optsdlg_handler:
jmp .draw_color.2 jmp .draw_color.2
.draw_editor: .draw_editor:
push dword[options] [tab_bar.Current.Ptr] ;push dword[options] [tab_bar.Current.Ptr]
mov [options],0 push [tab_bar.Current.Ptr]
;mov [options],0
mov ebp,optsdlg_editor mov ebp,optsdlg_editor
call set_cur_tab call set_cur_tab
@ -366,8 +367,9 @@ optsdlg_handler:
call draw_editor call draw_editor
call .xchg_colors call .xchg_colors
pop ebp eax ;pop ebp eax
mov [options],al pop ebp
;mov [options],al
call set_cur_tab call set_cur_tab
ret ret
@ -383,7 +385,7 @@ optsdlg_handler:
dec ecx dec ecx
mcall 8,,,0x40000000+21001 mcall 8,,,0x40000000+21001
mov esi,[cl_3d_normal] mov esi,[cl_3d_normal]
mov al,[tab_pos] mov al,[tabs_pos]
TPOSH = 6 TPOSH = 6
TPOSW = 10 TPOSW = 10
@ -687,16 +689,18 @@ botdlg.button:
mov [bot_mode],al mov [bot_mode],al
mov [bot_dlg_height],eax mov [bot_dlg_height],eax
call optsdlg_handler.xchg_colors call optsdlg_handler.xchg_colors
mov al,[tab_pos] mov al,[tabs_pos]
mov [tab_bar.Style],al mov [tab_bar.Style],al
stdcall save_settings
call drawwindow call drawwindow
ret ret
tabpos_round db 4,3,1,2 tabpos_round db 4,3,1,2
btn.bot.tabpos: btn.bot.tabpos:
movzx eax,[tab_pos] movzx eax,[tabs_pos]
mov al,[tabpos_round+eax-1] mov al,[tabpos_round+eax-1]
mov [tab_pos],al mov [tabs_pos],al
@@: call optsdlg_handler.draw_tabpos @@: call optsdlg_handler.draw_tabpos
ret ret

View File

@ -16,7 +16,7 @@ proc draw_editor ;///// DRAW EDITOR //////////////////////////////////////////
call draw_framerect call draw_framerect
mov [cur_editor.Gutter.Visible],0 mov [cur_editor.Gutter.Visible],0
test [options],OPTS_LINENUMS test [line_nums],1
jnz @f jnz @f
xor eax,eax xor eax,eax
jmp .lp1 jmp .lp1
@ -574,14 +574,12 @@ proc draw_editor_text ;///// DRAW EDITOR TEXT ////////////////////////////////
.lp6: .lp6:
mcall 13 mcall 13
lodsd
pushad pushad
mov edx,[color_tbl.back] mov edx,[color_tbl.back]
test eax,0x00010000 test [esi+EDITOR_LINE_DATA.Flags],EDITOR_LINE_FLAG_MOFIFIED
jz @f jz @f
mov edx,[color_tbl.line.moded] mov edx,[color_tbl.line.moded]
test eax,0x00020000 test [esi+EDITOR_LINE_DATA.Flags],EDITOR_LINE_FLAG_SAVED
jz @f jz @f
mov edx,[color_tbl.line.saved] mov edx,[color_tbl.line.saved]
@@: mov ebx,[left_ofs] @@: mov ebx,[left_ofs]
@ -593,8 +591,9 @@ proc draw_editor_text ;///// DRAW EDITOR TEXT ////////////////////////////////
popad popad
xor ecx,ecx xor ecx,ecx
and eax,0x0000FFFF mov eax,[esi+EDITOR_LINE_DATA.Size]
mov [cur_line_len],eax mov [cur_line_len],eax
add esi,sizeof.EDITOR_LINE_DATA
or eax,eax or eax,eax
ja .next_block ja .next_block

View File

@ -17,8 +17,8 @@ proc save_file ;//////////////////////////////////////////////////////////////
mov ecx,[cur_editor.Lines.Count] mov ecx,[cur_editor.Lines.Count]
@@: call get_real_length @@: call get_real_length
add ebx,eax add ebx,eax
movzx eax,word[esi] mov eax,[esi+EDITOR_LINE_DATA.Size]
lea esi,[esi+eax+4] lea esi,[esi+eax+sizeof.EDITOR_LINE_DATA]
loop @b loop @b
mov eax,[cur_editor.Lines.Count] mov eax,[cur_editor.Lines.Count]
shl eax,1 shl eax,1
@ -30,7 +30,7 @@ proc save_file ;//////////////////////////////////////////////////////////////
.new_string: .new_string:
call save_string call save_string
cmp dword[esi],0 cmp dword[esi+EDITOR_LINE_DATA.Size],0
jne .new_string jne .new_string
pop eax pop eax
sub edi,eax sub edi,eax
@ -64,11 +64,11 @@ endp
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
proc save_string ;//////////////////////////////////////////////////////////// proc save_string ;////////////////////////////////////////////////////////////
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
movzx ecx,word[esi] mov ecx,[esi+EDITOR_LINE_DATA.Size]
test dword[esi],0x00010000 test [esi+EDITOR_LINE_DATA.Flags],EDITOR_LINE_FLAG_MOFIFIED
jz @f jz @f
or dword[esi],0x00020000 or [esi+EDITOR_LINE_DATA.Flags],EDITOR_LINE_FLAG_SAVED
@@: add esi,4 @@: add esi,sizeof.EDITOR_LINE_DATA
@@: cmp byte[esi+ecx-1],' ' @@: cmp byte[esi+ecx-1],' '
jne @f jne @f
@ -81,7 +81,7 @@ proc save_string ;////////////////////////////////////////////////////////////
.next_char: .next_char:
mov al,[esi+ebx] mov al,[esi+ebx]
inc ebx inc ebx
test [options],OPTS_OPTIMSAVE test [optim_save],1
jz .put jz .put
test ah,00000001b test ah,00000001b
jnz .char jnz .char
@ -127,8 +127,7 @@ proc save_string ;////////////////////////////////////////////////////////////
.endcopy: .endcopy:
mov eax,0x0A0D mov eax,0x0A0D
stosw stosw
movzx eax,word[esi-4] add esi,[esi-sizeof.EDITOR_LINE_DATA+EDITOR_LINE_DATA.Size]
add esi,eax;[esi-4]
ret ret
endp endp
@ -174,7 +173,10 @@ proc load_file ;//////////////////////////////////////////////////////////////
mcall 70,f_info70 mcall 70,f_info70
mov [f_info70+0],0 mov [f_info70+0],0
mov eax,dword[file_info.Size] mov eax,dword[file_info.Size]
mov [f_info70+12],eax or eax, eax
jnz @f
mov eax, 1024
@@: mov [f_info70+12],eax
stdcall mem.Alloc,eax stdcall mem.Alloc,eax
mov [f_info70+16],eax mov [f_info70+16],eax
mcall 70,f_info70 mcall 70,f_info70
@ -233,7 +235,7 @@ proc load_from_memory ;///////////////////////////////////////////////////////
call get_lines_in_file call get_lines_in_file
mov [ebp+EDITOR.Lines.Count],eax mov [ebp+EDITOR.Lines.Count],eax
lea edx,[ebx+ecx] lea edx,[ebx+ecx]
imul ebx,eax,14 imul ebx,eax,16
add ebx,edx add ebx,edx
mov [ebp+EDITOR.Lines.Size],ebx mov [ebp+EDITOR.Lines.Size],ebx
stdcall mem.ReAlloc,[ebp+EDITOR.Lines],ebx stdcall mem.ReAlloc,[ebp+EDITOR.Lines],ebx
@ -245,7 +247,7 @@ proc load_from_memory ;///////////////////////////////////////////////////////
.next_line: .next_line:
mov ebx,edi mov ebx,edi
add edi,4 add edi,sizeof.EDITOR_LINE_DATA
.next_char: .next_char:
or edx,edx or edx,edx
jle .exit jle .exit
@ -266,10 +268,10 @@ proc load_from_memory ;///////////////////////////////////////////////////////
mov ecx,10 mov ecx,10
mov al,' ' mov al,' '
rep stosb rep stosb
lea eax,[edi-4] lea eax,[edi-sizeof.EDITOR_LINE_DATA]
sub eax,ebx sub eax,ebx
mov [ebx],eax mov [ebx+EDITOR_LINE_DATA.Size],eax
mov dword[ebx+eax+4],0 mov [ebx+eax+sizeof.EDITOR_LINE_DATA+EDITOR_LINE_DATA.Size],0
sub eax,10 sub eax,10
jnz @f jnz @f
inc eax inc eax
@ -286,16 +288,16 @@ proc load_from_memory ;///////////////////////////////////////////////////////
.LF: mov ecx,10 .LF: mov ecx,10
mov al,' ' mov al,' '
rep stosb rep stosb
lea eax,[edi-4] lea eax,[edi-sizeof.EDITOR_LINE_DATA]
sub eax,ebx sub eax,ebx
mov [ebx],eax mov [ebx+EDITOR_LINE_DATA.Size],eax
add eax,-10 add eax,-10
cmp eax,[ebp+EDITOR.Columns.Count] cmp eax,[ebp+EDITOR.Columns.Count]
jbe .next_line jbe .next_line
mov [ebp+EDITOR.Columns.Count],eax mov [ebp+EDITOR.Columns.Count],eax
jmp .next_line jmp .next_line
.TB: lea eax,[edi-4] .TB: lea eax,[edi-sizeof.EDITOR_LINE_DATA]
sub eax,ebx sub eax,ebx
mov ecx,eax mov ecx,eax
add ecx,ATABW add ecx,ATABW

View File

@ -78,7 +78,7 @@ key:
mov esi,accel_table_main mov esi,accel_table_main
.acc: cmp eax,[esi] .acc: cmp eax,[esi]
jne @f jne @f
test [options],OPTS_SECURESEL test [secure_sel],1
jz .lp1 jz .lp1
m2m [cur_editor.SelStart.X],[cur_editor.Caret.X] m2m [cur_editor.SelStart.X],[cur_editor.Caret.X]
m2m [cur_editor.SelStart.Y],[cur_editor.Caret.Y] m2m [cur_editor.SelStart.Y],[cur_editor.Caret.Y]
@ -102,14 +102,14 @@ key:
movzx eax,[eax+key1] movzx eax,[eax+key1]
push eax push eax
test [options],OPTS_SECURESEL test [secure_sel],1
jz .lp2 jz .lp2
m2m [cur_editor.SelStart.X],[cur_editor.Caret.X] m2m [cur_editor.SelStart.X],[cur_editor.Caret.X]
m2m [cur_editor.SelStart.Y],[cur_editor.Caret.Y] m2m [cur_editor.SelStart.Y],[cur_editor.Caret.Y]
jmp .put jmp .put
.lp2: call delete_selection .lp2: call delete_selection
test [options],OPTS_AUTOBRACES test [auto_braces],1
jz .put jz .put
cmp al,'[' cmp al,'['
jne @f jne @f
@ -274,12 +274,12 @@ proc key.ctrl_left ;///// GO TO PREVIOUS WORD ////////////////////////////////
cld cld
mov ecx,ebx mov ecx,ebx
call get_line_offset call get_line_offset
.lp1: cmp dx,[esi] .lp1: cmp edx,[esi+EDITOR_LINE_DATA.Size]
jle @f jle @f
movzx edx,word[esi] mov edx,[esi+EDITOR_LINE_DATA.Size]
@@: dec edx @@: dec edx
jl .nx1 jl .nx1
add esi,4 add esi,sizeof.EDITOR_LINE_DATA
add esi,edx add esi,edx
mov ecx,edx mov ecx,edx
@@: push ecx @@: push ecx
@ -297,18 +297,18 @@ proc key.ctrl_left ;///// GO TO PREVIOUS WORD ////////////////////////////////
js .exit.2 js .exit.2
mov ecx,ebx mov ecx,ebx
call get_line_offset call get_line_offset
movzx edx,word[esi] mov edx,[esi+EDITOR_LINE_DATA.Size]
dec edx dec edx
jmp .lp1 jmp .lp1
@@: @@:
mov ecx,ebx mov ecx,ebx
call get_line_offset call get_line_offset
.lp2: cmp dx,[esi] .lp2: cmp edx,[esi+EDITOR_LINE_DATA.Size]
jle @f jle @f
movzx edx,word[esi] mov edx,[esi+EDITOR_LINE_DATA.Size]
@@: or edx,edx @@: or edx,edx
jl .nx2 jl .nx2
add esi,4 add esi,sizeof.EDITOR_LINE_DATA
add esi,edx add esi,edx
@@: mov edi,symbols_ex @@: mov edi,symbols_ex
mov ecx,symbols_ex.size+symbols.size mov ecx,symbols_ex.size+symbols.size
@ -323,7 +323,7 @@ proc key.ctrl_left ;///// GO TO PREVIOUS WORD ////////////////////////////////
js .exit.2 js .exit.2
mov ecx,ebx mov ecx,ebx
call get_line_offset call get_line_offset
movzx edx,word[esi] mov edx,[esi+EDITOR_LINE_DATA.Size]
dec edx dec edx
jmp .lp2 jmp .lp2
@@: @@:
@ -367,10 +367,10 @@ proc key.ctrl_right ;///// GO TO NEXT WORD ///////////////////////////////////
cld cld
.lp1: mov ecx,ebx .lp1: mov ecx,ebx
call get_line_offset call get_line_offset
movzx ecx,word[esi] mov ecx,[esi+EDITOR_LINE_DATA.Size]
cmp edx,ecx cmp edx,ecx
jge .nx1 jge .nx1
add esi,4 add esi,sizeof.EDITOR_LINE_DATA
add esi,edx add esi,edx
sub ecx,edx sub ecx,edx
@@: push ecx @@: push ecx
@ -392,10 +392,10 @@ proc key.ctrl_right ;///// GO TO NEXT WORD ///////////////////////////////////
.lp2: mov ecx,ebx .lp2: mov ecx,ebx
call get_line_offset call get_line_offset
movzx ecx,word[esi] mov ecx,[esi+EDITOR_LINE_DATA.Size]
cmp edx,ecx cmp edx,ecx
jge .nx2 jge .nx2
add esi,4 add esi,sizeof.EDITOR_LINE_DATA
add esi,edx add esi,edx
sub ecx,edx sub ecx,edx
@@: push ecx @@: push ecx
@ -477,8 +477,9 @@ proc key.ctrl_c
jge @f jge @f
xor eax,eax xor eax,eax
@@: add esi,[sel.begin.x] @@: add esi,[sel.begin.x]
add esi,4 add esi,sizeof.EDITOR_LINE_DATA
stosd mov [edi+EDITOR_LINE_DATA.Size],eax
add edi,sizeof.EDITOR_LINE_DATA
mov ecx,eax mov ecx,eax
jecxz @f jecxz @f
rep movsb rep movsb
@ -494,13 +495,14 @@ proc key.ctrl_c
rep movsb rep movsb
mov ecx,[sel.end.y] mov ecx,[sel.end.y]
@@: call get_line_offset @@: call get_line_offset
movzx eax,word[esi] mov eax,[esi+EDITOR_LINE_DATA.Size]
add esi,4 add esi,sizeof.EDITOR_LINE_DATA
cmp eax,[sel.end.x] cmp eax,[sel.end.x]
jle @f jle @f
mov eax,[sel.end.x] mov eax,[sel.end.x]
@@: mov ebx,edi @@: mov ebx,edi
stosd mov [edi+EDITOR_LINE_DATA.Size],eax
add edi,sizeof.EDITOR_LINE_DATA
mov ecx,eax mov ecx,eax
jecxz @f jecxz @f
rep movsb rep movsb
@ -524,19 +526,20 @@ proc key.ctrl_c
mov eax,[sel.end.x] mov eax,[sel.end.x]
sub eax,[sel.begin.x] sub eax,[sel.begin.x]
mov edi,[copy_buf] mov edi,[copy_buf]
stosd mov [edi+EDITOR_LINE_DATA.Size],eax
add edi,sizeof.EDITOR_LINE_DATA
mov ecx,[sel.begin.y] mov ecx,[sel.begin.y]
call get_line_offset call get_line_offset
mov ebx,[sel.begin.x] mov ebx,[sel.begin.x]
mov ecx,[sel.end.x] mov ecx,[sel.end.x]
cmp ebx,[esi] cmp ebx,[esi+EDITOR_LINE_DATA.Size]
jge .add_spaces jge .add_spaces
cmp ecx,[esi] cmp ecx,[esi+EDITOR_LINE_DATA.Size]
jle .lp1 jle .lp1
mov ecx,[esi] mov ecx,[esi+EDITOR_LINE_DATA.Size]
.lp1: sub ecx,[sel.begin.x] .lp1: sub ecx,[sel.begin.x]
sub eax,ecx sub eax,ecx
lea esi,[esi+ebx+4] lea esi,[esi+ebx+sizeof.EDITOR_LINE_DATA]
rep movsb rep movsb
.add_spaces: .add_spaces:
@ -565,20 +568,20 @@ proc key.ctrl_v
mov ecx,[cur_editor.Caret.Y] mov ecx,[cur_editor.Caret.Y]
call get_line_offset call get_line_offset
pushd [esi] esi pushd [esi+EDITOR_LINE_DATA.Size] esi
mov ecx,[cur_editor.Caret.X] mov ecx,[cur_editor.Caret.X]
call line_add_spaces call line_add_spaces
add [esp],eax add [esp],eax
add esi,eax add esi,eax
mov ecx,[copy_size] mov ecx,[copy_size]
sub ecx,4 sub ecx,sizeof.EDITOR_LINE_DATA
mov edi,[cur_editor.Lines] mov edi,[cur_editor.Lines]
add edi,[cur_editor.Lines.Size] ;*** add edi,[edi-4] add edi,[cur_editor.Lines.Size] ;*** add edi,[edi-4]
dec edi dec edi
mov eax,esi mov eax,esi
mov esi,edi mov esi,edi
sub esi,ecx sub esi,ecx
lea ecx,[eax+4] lea ecx,[eax+sizeof.EDITOR_LINE_DATA]
add ecx,[cur_editor.Caret.X] add ecx,[cur_editor.Caret.X]
neg ecx neg ecx
lea ecx,[esi+ecx+1] lea ecx,[esi+ecx+1]
@ -591,30 +594,32 @@ proc key.ctrl_v
cld cld
pop edi pop edi
add edi,4 add edi,sizeof.EDITOR_LINE_DATA
mov esi,[copy_buf] mov esi,[copy_buf]
lodsd mov eax,[esi+EDITOR_LINE_DATA.Size]
add esi,sizeof.EDITOR_LINE_DATA
mov ebx,[cur_editor.Caret.X] mov ebx,[cur_editor.Caret.X]
add eax,ebx add eax,ebx
mov [edi-4],ax mov [edi-sizeof.EDITOR_LINE_DATA+EDITOR_LINE_DATA.Size],eax
mov byte[edi-4+2],0x0001 mov [edi-sizeof.EDITOR_LINE_DATA+EDITOR_LINE_DATA.Flags],EDITOR_LINE_FLAG_MOFIFIED
sub eax,ebx sub eax,ebx
call .check_columns call .check_columns
add edi,ebx add edi,ebx
@@: push ecx @@: push ecx
mov ecx,eax mov ecx,eax
rep movsb rep movsb
lodsd mov eax,[esi+EDITOR_LINE_DATA.Size]
and eax,0x0000FFFF add esi,sizeof.EDITOR_LINE_DATA
stosd mov [edi+EDITOR_LINE_DATA.Size],eax
mov byte[edi-4+2],0x0001 mov [edi+EDITOR_LINE_DATA.Flags],EDITOR_LINE_FLAG_MOFIFIED
add edi,sizeof.EDITOR_LINE_DATA
pop ecx pop ecx
loop @b loop @b
pop ecx pop ecx
sub ecx,ebx sub ecx,ebx
add [edi-4],cx add [edi-sizeof.EDITOR_LINE_DATA+EDITOR_LINE_DATA.Size],ecx
call .check_columns call .check_columns
mov ecx,eax mov ecx,eax
rep movsb rep movsb
@ -633,12 +638,13 @@ proc key.ctrl_v
.single_line: .single_line:
cld cld
pop edi pop edi
add edi,4 add edi,sizeof.EDITOR_LINE_DATA
mov esi,[copy_buf] mov esi,[copy_buf]
lodsd mov eax,[esi+EDITOR_LINE_DATA.Size]
add [edi-4],ax add esi,sizeof.EDITOR_LINE_DATA
and dword[edi-4],not 0x00020000 add [edi-sizeof.EDITOR_LINE_DATA+EDITOR_LINE_DATA.Size],eax
or dword[edi-4],0x00010000 and [edi-sizeof.EDITOR_LINE_DATA+EDITOR_LINE_DATA.Flags],not EDITOR_LINE_FLAG_SAVED
or [edi-sizeof.EDITOR_LINE_DATA+EDITOR_LINE_DATA.Flags],EDITOR_LINE_FLAG_MOFIFIED
call .check_columns call .check_columns
add edi,[cur_editor.Caret.X] add edi,[cur_editor.Caret.X]
add esp,4 add esp,4
@ -655,7 +661,7 @@ proc key.ctrl_v
.check_columns: .check_columns:
push eax push eax
movzx eax,word[edi-4] mov eax,[edi-sizeof.EDITOR_LINE_DATA+EDITOR_LINE_DATA.Size]
cmp eax,[cur_editor.Columns.Count] cmp eax,[cur_editor.Columns.Count]
jbe @f jbe @f
mov [cur_editor.Columns.Count],eax mov [cur_editor.Columns.Count],eax
@ -666,7 +672,7 @@ endp
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
proc key.ctrl_d ;///// INSERT SEPARATOR ////////////////////////////////////// proc key.ctrl_d ;///// INSERT SEPARATOR //////////////////////////////////////
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
mov eax,94 mov eax,90+sizeof.EDITOR_LINE_DATA
call editor_realloc_lines call editor_realloc_lines
mov ecx,[cur_editor.Caret.Y] mov ecx,[cur_editor.Caret.Y]
@ -675,14 +681,14 @@ proc key.ctrl_d ;///// INSERT SEPARATOR //////////////////////////////////////
mov ecx,[cur_editor.Lines.Count] mov ecx,[cur_editor.Lines.Count]
call get_line_offset call get_line_offset
lea edi,[esi+90+4] lea edi,[esi+90+sizeof.EDITOR_LINE_DATA]
lea ecx,[esi+4] lea ecx,[esi+sizeof.EDITOR_LINE_DATA]
sub ecx,ebx sub ecx,ebx
std std
rep movsb rep movsb
lea edi,[ebx+5] lea edi,[ebx+sizeof.EDITOR_LINE_DATA+1]
mov word[ebx],90 mov [ebx+EDITOR_LINE_DATA.Size],90
mov al,ASEPC mov al,ASEPC
mov ecx,79 mov ecx,79
cld cld
@ -690,7 +696,7 @@ proc key.ctrl_d ;///// INSERT SEPARATOR //////////////////////////////////////
mov al,' ' mov al,' '
mov ecx,10 mov ecx,10
rep stosb rep stosb
mov byte[ebx+4],';' mov byte[ebx+sizeof.EDITOR_LINE_DATA],';'
inc [cur_editor.Lines.Count] inc [cur_editor.Lines.Count]
inc [cur_editor.Caret.Y] inc [cur_editor.Caret.Y]
@ -713,9 +719,8 @@ proc key.ctrl_y ;///// DELETE CURRENT LINE ///////////////////////////////////
mov ecx,[cur_editor.Caret.Y] mov ecx,[cur_editor.Caret.Y]
call get_line_offset call get_line_offset
mov edi,esi mov edi,esi
lodsd mov eax,[esi+EDITOR_LINE_DATA.Size]
and eax,0x0000FFFF lea esi,[esi+eax+sizeof.EDITOR_LINE_DATA]
add esi,eax
push eax push eax
dec [cur_editor.Lines.Count] dec [cur_editor.Lines.Count]
@ -727,7 +732,7 @@ proc key.ctrl_y ;///// DELETE CURRENT LINE ///////////////////////////////////
rep movsd rep movsd
pop eax pop eax
add eax,4 add eax,sizeof.EDITOR_LINE_DATA
neg eax neg eax
call editor_realloc_lines call editor_realloc_lines
@ -1033,9 +1038,9 @@ proc key.del ;///// DELETE NEXT CHAR OR SELECTION ////////////////////////////
mov ecx,[cur_editor.Caret.Y] mov ecx,[cur_editor.Caret.Y]
call get_line_offset call get_line_offset
and dword[esi],not 0x00020000 and [esi+EDITOR_LINE_DATA.Flags],not EDITOR_LINE_FLAG_SAVED
or dword[esi],0x00010000 or [esi+EDITOR_LINE_DATA.Flags],EDITOR_LINE_FLAG_MOFIFIED
lea ebx,[esi+4] lea ebx,[esi+sizeof.EDITOR_LINE_DATA]
mov ebp,esi mov ebp,esi
call get_real_length call get_real_length
@ -1047,7 +1052,7 @@ proc key.del ;///// DELETE NEXT CHAR OR SELECTION ////////////////////////////
jae .line_up jae .line_up
lea edi,[ebx+ecx] lea edi,[ebx+ecx]
neg ecx neg ecx
movzx eax,word[ebp] mov eax,[ebp+EDITOR_LINE_DATA.Size]
add ecx,eax;[ebp] add ecx,eax;[ebp]
repe scasb repe scasb
je .line_up je .line_up
@ -1057,7 +1062,7 @@ proc key.del ;///// DELETE NEXT CHAR OR SELECTION ////////////////////////////
add edi,ecx add edi,ecx
lea esi,[edi+1] lea esi,[edi+1]
neg ecx neg ecx
movzx eax,word[ebp] mov eax,[ebp+EDITOR_LINE_DATA.Size]
add ecx,eax;[ebp] add ecx,eax;[ebp]
dec ecx dec ecx
rep movsb rep movsb
@ -1074,27 +1079,27 @@ proc key.del ;///// DELETE NEXT CHAR OR SELECTION ////////////////////////////
cmp eax,[cur_editor.Caret.Y] cmp eax,[cur_editor.Caret.Y]
je .exit je .exit
mov edi,[temp_buf] mov edi,[temp_buf]
add edi,4 add edi,sizeof.EDITOR_LINE_DATA
mov esi,ebx mov esi,ebx
mov ecx,[cur_editor.Caret.X] mov ecx,[cur_editor.Caret.X]
rep movsb rep movsb
mov ecx,[cur_editor.Caret.X] mov ecx,[cur_editor.Caret.X]
mov eax,[temp_buf] mov eax,[temp_buf]
mov [eax],ecx mov [eax+EDITOR_LINE_DATA.Size],ecx
cmp cx,[ebp] cmp ecx,[ebp+EDITOR_LINE_DATA.Size]
jbe @f jbe @f
movzx eax,word[ebp] mov eax,[ebp+EDITOR_LINE_DATA.Size]
sub ecx,eax sub ecx,eax
sub edi,ecx sub edi,ecx
mov al,' ' mov al,' '
rep stosb rep stosb
@@: lea esi,[ebx+4] @@: lea esi,[ebx+sizeof.EDITOR_LINE_DATA]
movzx eax,word[ebp] mov eax,[ebp+EDITOR_LINE_DATA.Size]
add esi,eax add esi,eax
movzx ecx,word[esi-4] mov ecx,[esi-sizeof.EDITOR_LINE_DATA+EDITOR_LINE_DATA.Size]
mov eax,[temp_buf] mov eax,[temp_buf]
add [eax],ecx add [eax+EDITOR_LINE_DATA.Size],ecx
or dword[eax],0x00010000 or [eax+EDITOR_LINE_DATA.Flags],EDITOR_LINE_FLAG_MOFIFIED
rep movsb rep movsb
mov ecx,edi mov ecx,edi
@ -1110,14 +1115,13 @@ proc key.del ;///// DELETE NEXT CHAR OR SELECTION ////////////////////////////
mov edi,[cur_editor.Lines] mov edi,[cur_editor.Lines]
add edi,[cur_editor.Lines.Size] ;*** add edi,[edi-4] add edi,[cur_editor.Lines.Size] ;*** add edi,[edi-4]
dec edi dec edi
lea esi,[edi+8] lea esi,[edi+sizeof.EDITOR_LINE_DATA*2] ; !!! CHECK THIS !!!
sub esi,ecx sub esi,ecx
movzx eax,word[ebp] mov eax,[ebp+EDITOR_LINE_DATA.Size]
add esi,eax add esi,eax
movzx eax,word[ebp] mov eax,[ebp+eax+sizeof.EDITOR_LINE_DATA+EDITOR_LINE_DATA.Size]
movzx eax,word[ebp+eax+4]
add esi,eax add esi,eax
lea ecx,[esi-4] lea ecx,[esi-sizeof.EDITOR_LINE_DATA]
sub ecx,ebp sub ecx,ebp
std std
cmp esi,edi cmp esi,edi
@ -1125,10 +1129,10 @@ proc key.del ;///// DELETE NEXT CHAR OR SELECTION ////////////////////////////
jz .lp1 jz .lp1
mov edi,ebp mov edi,ebp
add edi,[esp] add edi,[esp]
lea esi,[ebp+8] lea esi,[ebp+sizeof.EDITOR_LINE_DATA*2] ; !!! CHECK THIS !!!
movzx eax,word[esi-8] mov eax,[esi-sizeof.EDITOR_LINE_DATA*2+EDITOR_LINE_DATA.Size] ; !!! CHECK THIS !!!
add esi,eax add esi,eax
movzx eax,word[esi-4] mov eax,[esi-sizeof.EDITOR_LINE_DATA+EDITOR_LINE_DATA.Size] ; !!! CHECK THIS !!!
add esi,eax add esi,eax
mov ecx,[cur_editor.Lines] mov ecx,[cur_editor.Lines]
add ecx,[cur_editor.Lines.Size] ;*** add ecx,[ecx-4] add ecx,[cur_editor.Lines.Size] ;*** add ecx,[ecx-4]
@ -1153,8 +1157,8 @@ proc key.del ;///// DELETE NEXT CHAR OR SELECTION ////////////////////////////
mov ecx,[cur_editor.Lines.Count] mov ecx,[cur_editor.Lines.Count]
call get_line_offset call get_line_offset
movzx eax,word[esi] mov eax,[esi+EDITOR_LINE_DATA.Size]
lea esi,[esi+eax+4] lea esi,[esi+eax+sizeof.EDITOR_LINE_DATA]
mov eax,[cur_editor.Lines] mov eax,[cur_editor.Lines]
add eax,[cur_editor.Lines.Size] ;*** add eax,[eax-4] add eax,[cur_editor.Lines.Size] ;*** add eax,[eax-4]
sub esi,eax sub esi,eax
@ -1191,8 +1195,8 @@ proc key.bkspace ;///// DELETE PREVIOUS CHAR OR SELECTION ////////////////////
dec [cur_editor.Caret.X] dec [cur_editor.Caret.X]
mov ecx,[cur_editor.Caret.Y] mov ecx,[cur_editor.Caret.Y]
call get_line_offset call get_line_offset
and dword[esi],not 0x00020000 and [esi+EDITOR_LINE_DATA.Flags],not EDITOR_LINE_FLAG_SAVED
or dword[esi],0x00010000 or [esi+EDITOR_LINE_DATA.Flags],EDITOR_LINE_FLAG_MOFIFIED
mov ebx,eax mov ebx,eax
call get_real_length call get_real_length
@ -1202,10 +1206,10 @@ proc key.bkspace ;///// DELETE PREVIOUS CHAR OR SELECTION ////////////////////
mov [cur_editor.Modified],1 mov [cur_editor.Modified],1
ret ret
@@: lea edi,[esi+4+ebx] @@: lea edi,[esi+sizeof.EDITOR_LINE_DATA+ebx]
mov ecx,ebx mov ecx,ebx
neg ecx neg ecx
movzx eax,word[esi] mov eax,[esi+EDITOR_LINE_DATA.Size]
add ecx,eax add ecx,eax
dec ecx dec ecx
lea esi,[edi+1] lea esi,[edi+1]
@ -1225,12 +1229,12 @@ proc key.bkspace ;///// DELETE PREVIOUS CHAR OR SELECTION ////////////////////
@@: mov ecx,[cur_editor.Caret.Y] @@: mov ecx,[cur_editor.Caret.Y]
dec ecx dec ecx
call get_line_offset call get_line_offset
and dword[esi],not 0x00020000 and [esi+EDITOR_LINE_DATA.Flags],not EDITOR_LINE_FLAG_SAVED
or dword[esi],0x00010000 or [esi+EDITOR_LINE_DATA.Flags],EDITOR_LINE_FLAG_MOFIFIED
mov ebp,esi mov ebp,esi
lea ebx,[esi+4] lea ebx,[esi+sizeof.EDITOR_LINE_DATA]
movzx ecx,word[ebp] mov ecx,[ebp+EDITOR_LINE_DATA.Size]
@@: cmp byte[ebx+ecx-1],' ' @@: cmp byte[ebx+ecx-1],' '
jne @f jne @f
dec ecx dec ecx
@ -1258,8 +1262,8 @@ proc key.tab ;///// TABULATE /////////////////////////////////////////////////
pop eax pop eax
mov ecx,[cur_editor.Caret.Y] mov ecx,[cur_editor.Caret.Y]
call get_line_offset call get_line_offset
and dword[esi],not 0x00020000 and [esi+EDITOR_LINE_DATA.Flags],not EDITOR_LINE_FLAG_SAVED
or dword[esi],0x00010000 or [esi+EDITOR_LINE_DATA.Flags],EDITOR_LINE_FLAG_MOFIFIED
xchg eax,ecx xchg eax,ecx
@ -1267,7 +1271,7 @@ proc key.tab ;///// TABULATE /////////////////////////////////////////////////
cmp eax,[cur_editor.Caret.X] cmp eax,[cur_editor.Caret.X]
jae @f jae @f
mov eax,[cur_editor.Caret.X] mov eax,[cur_editor.Caret.X]
@@: movzx edx,word[esi] @@: mov edx,[esi+EDITOR_LINE_DATA.Size]
sub edx,eax sub edx,eax
cmp ecx,edx cmp ecx,edx
jl @f jl @f
@ -1282,8 +1286,8 @@ proc key.tab ;///// TABULATE /////////////////////////////////////////////////
dec ecx dec ecx
mov edi,ecx mov edi,ecx
add ecx,-10+1 add ecx,-10+1
movzx eax,word[esi] mov eax,[esi+EDITOR_LINE_DATA.Size]
lea eax,[esi+eax+4] lea eax,[esi+eax+sizeof.EDITOR_LINE_DATA]
sub ecx,eax sub ecx,eax
lea esi,[edi-10] lea esi,[edi-10]
std std
@ -1292,11 +1296,11 @@ proc key.tab ;///// TABULATE /////////////////////////////////////////////////
mov al,' ' mov al,' '
rep stosb rep stosb
popad popad
add word[esi],10 add [esi+EDITOR_LINE_DATA.Size],10
jmp @b jmp @b
@@: lea ebx,[esi+4] @@: lea ebx,[esi+sizeof.EDITOR_LINE_DATA]
push ecx push ecx
movzx edi,word[esi] mov edi,[esi+EDITOR_LINE_DATA.Size]
lea edi,[ebx+edi-1] lea edi,[ebx+edi-1]
mov esi,edi mov esi,edi
sub esi,ecx sub esi,ecx
@ -1310,7 +1314,7 @@ proc key.tab ;///// TABULATE /////////////////////////////////////////////////
rep stosb rep stosb
cld cld
pop [cur_editor.Caret.X] pop [cur_editor.Caret.X]
lea esi,[ebx-4] lea esi,[ebx-sizeof.EDITOR_LINE_DATA]
call get_real_length call get_real_length
cmp eax,[cur_editor.Caret.X] cmp eax,[cur_editor.Caret.X]
jae @f jae @f
@ -1338,9 +1342,9 @@ proc key.return ;///// CARRIAGE RETURN ///////////////////////////////////////
call get_line_offset call get_line_offset
mov ebx,[cur_editor.Caret.X] mov ebx,[cur_editor.Caret.X]
cmp bx,[esi] cmp ebx,[esi+EDITOR_LINE_DATA.Size]
jb @f jb @f
movzx ebx,word[esi] mov ebx,[esi+EDITOR_LINE_DATA.Size]
dec ebx dec ebx
jns @f jns @f
xor ebx,ebx xor ebx,ebx
@ -1352,24 +1356,25 @@ proc key.return ;///// CARRIAGE RETURN ///////////////////////////////////////
lea ecx,[ebx+1] lea ecx,[ebx+1]
@@: dec ecx @@: dec ecx
jz @f jz @f
cmp byte[esi+ecx+4-1],' ' cmp byte[esi+ecx+sizeof.EDITOR_LINE_DATA-1],' '
je @b je @b
@@: lea eax,[ecx+10] @@: lea eax,[ecx+10]
or eax,0x00010000 mov [edi+EDITOR_LINE_DATA.Size],eax
stosd mov [edi+EDITOR_LINE_DATA.Flags],EDITOR_LINE_FLAG_MOFIFIED
add edi,sizeof.EDITOR_LINE_DATA
jecxz @f jecxz @f
push esi push esi
add esi,4 add esi,sizeof.EDITOR_LINE_DATA
rep movsb rep movsb
pop esi pop esi
@@: mov al,' ' @@: mov al,' '
mov ecx,10 mov ecx,10
rep stosb rep stosb
movzx ecx,word[esi] mov ecx,[esi+EDITOR_LINE_DATA.Size]
sub ecx,ebx sub ecx,ebx
add esi,ebx add esi,ebx
add esi,4 add esi,sizeof.EDITOR_LINE_DATA
inc ecx inc ecx
@@: dec ecx @@: dec ecx
jz @f jz @f
@ -1380,24 +1385,24 @@ proc key.return ;///// CARRIAGE RETURN ///////////////////////////////////////
jne .lp1 jne .lp1
inc esi inc esi
loop @b loop @b
.lp1: test [options],OPTS_AUTOINDENT .lp1: test [auto_indent],1
jz .lp2 jz .lp2
push edi ecx push edi ecx
movzx ecx,word[ebp] mov ecx,[ebp+EDITOR_LINE_DATA.Size]
lea edi,[ebp+4] lea edi,[ebp+sizeof.EDITOR_LINE_DATA]
mov al,' ' mov al,' '
repe scasb repe scasb
mov eax,ecx mov eax,ecx
pop ecx edi pop ecx edi
je .lp2 je .lp2
neg eax neg eax
movzx edx,word[ebp] mov edx,[ebp+EDITOR_LINE_DATA.Size]
add eax,edx;[ebp] add eax,edx;[ebp]
dec eax dec eax
jmp @f jmp @f
.lp2: xor eax,eax .lp2: xor eax,eax
@@: mov edx,edi @@: mov edx,edi
add edi,4 add edi,sizeof.EDITOR_LINE_DATA
mov [cur_editor.Caret.X],eax mov [cur_editor.Caret.X],eax
jecxz @f jecxz @f
push ecx push ecx
@ -1411,10 +1416,10 @@ proc key.return ;///// CARRIAGE RETURN ///////////////////////////////////////
mov al,' ' mov al,' '
rep stosb rep stosb
lea eax,[edi-4] lea eax,[edi-sizeof.EDITOR_LINE_DATA]
sub eax,edx sub eax,edx
or eax,0x00010000 mov [edx+EDITOR_LINE_DATA.Size],eax
mov [edx],eax mov [edx+EDITOR_LINE_DATA.Flags],EDITOR_LINE_FLAG_MOFIFIED
mov ecx,edi mov ecx,edi
sub ecx,[temp_buf] sub ecx,[temp_buf]
@ -1423,20 +1428,20 @@ proc key.return ;///// CARRIAGE RETURN ///////////////////////////////////////
mov edi,[cur_editor.Lines] mov edi,[cur_editor.Lines]
add edi,[cur_editor.Lines.Size] ;*** add edi,[edi-4] add edi,[cur_editor.Lines.Size] ;*** add edi,[edi-4]
dec edi dec edi
lea esi,[edi+4] lea esi,[edi+sizeof.EDITOR_LINE_DATA]
sub esi,ecx sub esi,ecx
movzx ecx,word[ebp] mov ecx,[ebp+EDITOR_LINE_DATA.Size]
add esi,ecx add esi,ecx
lea ecx,[esi-4] lea ecx,[esi-sizeof.EDITOR_LINE_DATA]
sub ecx,ebp sub ecx,ebp
std std
cmp esi,edi cmp esi,edi
jb @f jb @f
je .lp3 je .lp3
lea esi,[ebp+4] lea esi,[ebp+sizeof.EDITOR_LINE_DATA]
mov eax,[esp] mov eax,[esp]
lea edi,[esi+eax-4] lea edi,[esi+eax-sizeof.EDITOR_LINE_DATA]
movzx ecx,word[ebp] mov ecx,[ebp+EDITOR_LINE_DATA.Size]
add esi,ecx add esi,ecx
mov ecx,[cur_editor.Lines] mov ecx,[cur_editor.Lines]
add ecx,[cur_editor.Lines.Size] ;*** add ecx,[ecx-4] add ecx,[cur_editor.Lines.Size] ;*** add ecx,[ecx-4]
@ -1593,29 +1598,13 @@ proc key.alt_x ;///// EXIT PROGRAM ///////////////////////////////////////////
.direct: .direct:
call try_to_close_tabs call try_to_close_tabs
or eax,eax or eax,eax
jz .close jz @f
mov [bot_mode2],2 mov [bot_mode2],2
jmp key.ctrl_o.direct jmp key.ctrl_o.direct
@@: stdcall save_settings
.close: .close:
mov esi,self_path
mov byte[esi+PATHL-1],0
mov edi,f_info.path
cld
@@: lodsb
stosb
or al,al
jnz @b
mov [f_info70+0],2
mov [f_info70+4],0
mov [f_info70+8],0
mov [f_info70+12],TINYPAD_END
mov [f_info70+16],0
mov byte[f_info70+20],0
mov [f_info70+21],f_info.path
mcall 70,f_info70
mov [main_closed],1 mov [main_closed],1
mcall -1 mcall -1
endp endp

View File

@ -260,23 +260,23 @@ onshow:
;mov word[mm.Options+0],0 ;mov word[mm.Options+0],0
mov byte[mm.Options+5],0 mov byte[mm.Options+5],0
or byte[mm.Options+2],0x02 or byte[mm.Options+2],0x02
test [options],OPTS_SECURESEL test [secure_sel],1
jnz @f jnz @f
and byte[mm.Options+2],0xFD and byte[mm.Options+2],0xFD
@@: or byte[mm.Options+3],0x02 @@: or byte[mm.Options+3],0x02
test [options],OPTS_AUTOBRACES test [auto_braces],1
jnz @f jnz @f
and byte[mm.Options+3],0xFD and byte[mm.Options+3],0xFD
@@: or byte[mm.Options+4],0x02 @@: or byte[mm.Options+4],0x02
test [options],OPTS_AUTOINDENT test [auto_indent],1
jnz @f jnz @f
and byte[mm.Options+4],0xFD and byte[mm.Options+4],0xFD
@@: or byte[mm.Options+6],0x02 @@: or byte[mm.Options+6],0x02
test [options],OPTS_OPTIMSAVE test [optim_save],1
jnz @f jnz @f
and byte[mm.Options+6],0xFD and byte[mm.Options+6],0xFD
@@: or byte[mm.Options+8],0x02 @@: or byte[mm.Options+8],0x02
test [options],OPTS_LINENUMS test [line_nums],1
jnz @f jnz @f
and byte[mm.Options+8],0xFD and byte[mm.Options+8],0xFD
@@: ret @@: ret

View File

@ -101,9 +101,9 @@ proc create_tab ;///// ADD TAB TO THE END ////////////////////////////////////
mov [cur_editor.SelStart.X],eax mov [cur_editor.SelStart.X],eax
mov [cur_editor.SelStart.Y],eax mov [cur_editor.SelStart.Y],eax
mov edi,[cur_editor.Lines] mov edi,[cur_editor.Lines]
add edi,4 add edi,sizeof.EDITOR_LINE_DATA
mov ecx,10 mov ecx,10
mov [edi-4],ecx mov [edi-sizeof.EDITOR_LINE_DATA+EDITOR_LINE_DATA.Size],ecx
mov [edi+10],eax mov [edi+10],eax
mov al,' ' mov al,' '
cld cld