little-brother / sqlite-gui

Lightweight SQLite editor for Windows
GNU General Public License v2.0
1.07k stars 51 forks source link

Add shortcut to execute only current line (feature request) #152

Closed SilvioGrosso closed 4 months ago

SilvioGrosso commented 6 months ago

Hello @little-brother

Is it possible to add an option (shortcut) to select only the current line of SQL code in some future versions? This would be possible without selecting this line AND no matter where the mouse cursors is positioned into this line (e.g. middle, end etc)

Quite often, I write some simple SQL code into a single line. When I want to execute this code (usually some SELECT... FROM... stuff) with SQLITE-GUI I am forced to always select the entire line (by mouse's cursor) and, only after this selection is done, press CTR+ENTER to execute the code. This selection by mouse is quite tedious :-)

To make it clear, right now:

In short, I would like to propose do add a shortcut to execute the current line (the same in which is the mouse cursor).

This is already possible with Dbeaver, for instance. You can execute a line (ctr+enter) even though there is plenty of other SQL code in the current query editor.

SilvioGrosso commented 6 months ago

For instance, with dbeaver I can execute the SELECT code (line 6) without selecting it by mouse and even though there is some previous SQL code (create table...)

image

little-brother commented 6 months ago

Only a current line is not problem - it will be added.
A current statement is harder because it's not trivial to find start and end of an query.

SilvioGrosso commented 6 months ago

Hello @little-brother

Only a current line is not problem - it will be added.

Thanks a lot!

With Sqlite-gui (into the query editor window), compared to LIbreOffice Writer and other softwares (e.g. DBeaver), you can not double-click on the line to select ALL the text (sql code). Sqlite-gui only always select a single word (present in the line). At present, you are forced to manually select ALL the line by mouse's cursor (which is a bit tedious whenever the SQL line is long) With Sqlite-gui if you double LEFT click (or triple-click etc) very fast it only select a single word (never the whole line)

This remark is made to explain why I am also suggesting to add a shortcut :smile:

little-brother commented 6 months ago

The full row selection by Shift + Double click can be added too. The single word selection by double click is a default behaviour for many software i.e. browser or Word.

SilvioGrosso commented 6 months ago

The single word selection by double click is a default behaviour for many software i.e. browser or Word.

Yep. You are right! :smile:

Currently, only the triple left click is not implemented (in order to quickly select the whole line) within the editor

little-brother commented 6 months ago

Ok, triple click feels better than Shift + Double click. Windows doesn't support triple click from the box, so I need to implement it myself. If I can then the selection line wll be by triple click and otherwise by Shift + Double click.

little-brother commented 4 months ago

Add new shortcut F12 to execute a current line.