提交 c384ef6a 编写于 作者: C cz_012273

新建文件显示未命名、修复空文件选择当前行下标越界

上级 19ced367
......@@ -151,7 +151,7 @@ procedure TForm1.FileNewClick(Sender: TObject); //
begin
SetFileName(sUntitled);
label1.text:='当前文件:'+sUntitled+'.txt';
Memo1.Lines.Clear;
Memo1.text := '';
end;
......@@ -198,7 +198,7 @@ begin
begin
Line := CaretPosition.line ;
SelStart := MemoLastPos-CaretPosition.pos ;
SelLength := Length(Lines[Line]) ;
if lines.count>0 then SelLength := Length(Lines[Line]) ; //如不是空文件,选当前行
end;
end;
......@@ -231,6 +231,8 @@ begin
SetFileName(sUntitled);
label1.text:='当前文件:'+sUntitled+'.txt';
memo1.height:= 473; //将meno控件恢复到默认高度
MemoLastPos:=0; //光标位置变量初始化
end;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册