sqlitebrowser icon indicating copy to clipboard operation
sqlitebrowser copied to clipboard

[Feature]: "Execute current line" improvements

Open bintoro opened this issue 2 years ago β€’ 17 comments

Describe the new feature

A few ideas to make the "Execute current line" operation more intuitive and accessible:

  • Add counterparts to the other Execute shortcuts besides F5, i.e., Shift-Ctrl-R and Shift-Ctrl-Return.
  • Rename the operation to "Execute current statement", which I suppose is the intended meaning and what currently happens as long as the cursor is on the first line of a multiline statement.
  • Have the feature execute the entire statement even if the cursor is not on the first line.

Does this feature exist in another product or project? Please provide a link

No response

Do you have a screenshot? Please add screenshots to help explain your idea.

No response

bintoro avatar Oct 08 '23 19:10 bintoro

Rename the operation to "Execute current statement" ...

That sounds pretty reasonable. We'll need to get the translations updated again though. :wink:

justinclift avatar Oct 09 '23 12:10 justinclift

It sounds reasonable and I don't think it will be difficult to fix. However, we're almost done with the translation for the next release, so we may want to consider fixing it after the next release. @justinclift What do you think about this? πŸ˜„

lucydodo avatar Oct 10 '23 00:10 lucydodo

Probably do it for the next release. We've already had a lot of the translations done for this one. :wink:

justinclift avatar Oct 10 '23 07:10 justinclift

Hi @bintoro, I've added a commit to a new branch that applies the improvements you suggested, but as comments above, it will most likely not be in this release.

Have the feature execute the entire statement even if the cursor is not on the first line.

By the way, can you elaborate a bit more on the above? because when I tested it, it seems to be work as you said. Thanks for your patience.

lucydodo avatar Oct 15 '23 06:10 lucydodo

Have the feature execute the entire statement even if the cursor is not on the first line.

By the way, can you elaborate a bit more on the above? because when I tested it, it seems to be work as you said. Thanks for your patience.

I’m sorry, I had totally missed this question.

So yeah, upon further investigation, the command isn’t completely broken. But it seems that when searching backwards from the cursor to locate the first line of the current statement, only explicit semicolons are recognized; the beginning of the text area is not.

To illustrate:

screenshot

Cursor on line Shift+F5 executes
1 1st statement βœ…
2 2nd line (error) ❌
3 3rd line (error) ❌
4 4th line (error) ❌
5 nothing βœ…
6..10 2nd statement βœ…

But if I prepend a semicolon to the first SELECT, everything works as expected.

bintoro avatar Nov 03 '23 21:11 bintoro

Oh, that sounds like a good catch. @mgrojo I think this will be of interest to you. :smile:

justinclift avatar Nov 04 '23 02:11 justinclift

Easy workaround... just highlight the statement you want to execute. Works every time. ;)

chrisjlocke avatar Nov 04 '23 08:11 chrisjlocke

Should be fixed, in any case. But the last time I looked at this was not straightforward; this part of the code is complex.

mgrojo avatar Nov 04 '23 08:11 mgrojo

Uhmm, I remembered something more cumbersome. I believe it's easy after all. Looking at it.

mgrojo avatar Nov 04 '23 11:11 mgrojo

So yeah, upon further investigation, the command isn’t completely broken. But it seems that when searching backwards from the cursor to locate the first line of the current statement, only explicit semicolons are recognized; the beginning of the text area is not. [...] But if I prepend a semicolon to the first SELECT, everything works as expected.

This bug should be fixed now in the next nightly build and will enter the next release (v3.13.0).

mgrojo avatar Nov 04 '23 12:11 mgrojo

@mgrojo Would it make sense to merge changes to 1 and 2 into the master branch after the next release? πŸ€”

lucydodo avatar Nov 06 '23 10:11 lucydodo

@lucydodo , yes, of course, it makes sense. As soon as we have the release branch, you are free to merge it.

mgrojo avatar Nov 07 '23 21:11 mgrojo

@mgrojo Thanks, I'll merge it after the when we create next release branch. @bintoro As mentioned above, this will be reflected in the near future, and I'll elt you know when that happens. Thanks.

lucydodo avatar Nov 10 '23 00:11 lucydodo

@lucydodo The new v3.13.x release branch was created by @mgrojo yesterday, so merging waiting stuff into master should now be ok. :smile:

justinclift avatar Nov 12 '23 03:11 justinclift

@lucydodo but check first with @deepsidhu1313 , I understood that he still needs some time for master to be frozen.

mgrojo avatar Nov 12 '23 08:11 mgrojo

Hey, sorry for the master branch thing, I can switch all the builds to 3.13.x branch temporarily if we are not planning 3.13.x release soon, or if you need this change on master urgently.

deepsidhu1313 avatar Nov 12 '23 11:11 deepsidhu1313

@justinclift @mgrojo Thanks for letting me know.

@deepsidhu1313 Don't worry, Take your time. :)

lucydodo avatar Nov 13 '23 01:11 lucydodo