|
本帖最后由 mmwy 于 2013-11-5 22:20 编辑
在Lazarus中内置了JEDI Code Format IDE Plugin for Lazarus,快捷键是Ctrl+D。在Lazarus 1.0.12中按快捷键后会直接格式化代码,无提示。但是当我使用CT 4.50时,同样的快捷键后会弹出如下的对话框。

原以为这个东西地方可以配置,但是刨了很久也没发现,最后终于刨到fcl的源码。
在C:\CodeTyphon\typhon\components\jcf2\IdePlugin\typhon\jcfidemain.pas中,找到
- procedure TJcfIdeMain.DoFormatCurrentIDEWindow(Sender: TObject);
- var
- lsMsg: string;
- begin
- if (SourceEditorManagerIntf= nil) or (SourceEditorManagerIntf.ActiveEditor = nil) then
- LogIdeMessage('', 'No current window', mtInputError, -1, -1)
- else begin
- //lsMsg := Format(lisJEDICodeFormatOfStartFormatting, [SourceEditorManagerIntf.ActiveEditor.FileName+ NativeLineBreak]);
- //if MessageDlg(lsMsg, mtConfirmation, [mbYes, mbNo], 0) = mrYes then
- ConvertEditor(SourceEditorManagerIntf.ActiveEditor);
- end;
- end;
复制代码 去掉对话框部分的代码,然后重新编译IDE。
|
|