main: allow running partial query by selection

This commit is contained in:
mappu 2024-06-23 13:07:52 +12:00
parent 3a4bdbde94
commit db5f6816c5

View File

@ -263,6 +263,11 @@ func (f *TMainForm) OnQueryExecute(sender vcl.IObject) {
return return
} }
queryString := f.queryInput.Text()
if f.queryInput.SelLength() > 0 {
queryString = f.queryInput.SelText() // Just the selected text
}
// Execute // Execute
node := f.Buckets.Selected() node := f.Buckets.Selected()
if node == nil { if node == nil {
@ -271,7 +276,7 @@ func (f *TMainForm) OnQueryExecute(sender vcl.IObject) {
} }
ndata := (*navData)(node.Data()) ndata := (*navData)(node.Data())
ndata.ld.ExecQuery(f.queryInput.Text(), f.queryResult) ndata.ld.ExecQuery(queryString, f.queryResult)
} }
func (f *TMainForm) OnNavChange(sender vcl.IObject, node *vcl.TTreeNode) { func (f *TMainForm) OnNavChange(sender vcl.IObject, node *vcl.TTreeNode) {