Web pgadmin.org
 Home 
 ·  ·  ·  ·  ·  ·  · 
Display line numbers in SQL view

Display line numbers in SQL view



Hi,

During constant debugging of triggers / functions in office, I see the need to copy paste a specific SQL string and run it in the SQL view to trace a bug on a given nth line. The problem being that the SQL view doesn't have line numbers in the margin like the Create function SQL tab.

This patch adds line numbers to the SQL view as well.

(This patch just enables the line-numbers in the margin, in case its desirable to have a checkbox that allows the user to enable/disable this, we could have a menu option for that in the View menu. Should we ?)


Regards.
Robins Tharakan
Index: pgadmin/frm/frmQuery.cpp
===================================================================
--- pgadmin/frm/frmQuery.cpp	(revision 7108)
+++ pgadmin/frm/frmQuery.cpp	(working copy)
@@ -304,7 +304,9 @@
     // Query box
     sqlQuery = new ctlSQLBox(this, CTL_SQLQUERY, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxSIMPLE_BORDER | wxTE_RICH2);
     sqlQuery->SetDatabase(conn);
-    sqlQuery->SetMarginWidth(1, 16);
+    sqlQuery->SetMarginType(1, wxSTC_MARGIN_NUMBER);
+    sqlQuery->SetMarginWidth(1, ConvertDialogToPixels(wxPoint(16, 0)).x);
+
     SetLineEndingStyle();
 
     // Results pane


Home | Main Index | Thread Index

top