sqlitebrowser / sqlitebrowser

Official home of the DB Browser for SQLite (DB4S) project. Previously known as "SQLite Database Browser" and "Database Browser for SQLite". Website at:
https://sqlitebrowser.org
Other
21.19k stars 2.14k forks source link

misc feature request: line comment on gutter click #2996

Open dzzie opened 2 years ago

dzzie commented 2 years ago

as I am working with queries I often put different criteria on different lines then just comment them out as I switch between them for various tasks

select count(distinct(guid)) as g, count(guid) as c from main WHERE 
`group`=11
--submit like "%xxx%" and `group`=0

it would be super handy to have the gutter click event toggle a line comment prefix --

just a random idea

chrisjlocke commented 2 years ago

Seems like a good idea. I don't know if the text editor widget control thingy would recognise a gutter-click, but I guess it would. Could be a useful feature.

dzzie commented 2 years ago

I guess technically its the SCN_MARGINCLICK scintinilla message. Example VB6 handler here:

https://github.com/dzzie/scivb2/blob/b581d64030fecce1e2bc0ff786ffd9a59f515166/SciSimple.ctl#L378

edit: looks like it is broken out in qsciscintilla.cpp

https://github.com/sqlitebrowser/sqlitebrowser/blob/93a5c2d0ca81fb26c51a9e0ecabacfc7ab872d62/libs/qscintilla/Qt4Qt5/qsciscintilla.cpp#L1961

chrisjlocke commented 2 years ago

Well, the code is already there to do the comment and uncommenting - a button does it already (or pressing Ctrl+/ ) so on a double-click, it just has to push the button too.

dzzie commented 2 years ago

aghh the ctrl/ is pretty great, and never noticed the comment button. awesome thanks I also appreciate the block comment behavior if multiple lines selected quite well solved already i guess :) attention to detail like this is how you can tell a program is a labor of love and heavily use by its developers lol