Skip to content

Scrollbar position (in sql editor tab) resets after running a query #2073

Open

Description

@T1mL3arn

Details for the issue

What did you do?

  1. Enter simple query, e.g. select 1;
  2. Press ENTER key many times that query from step 1 is not visible in a sql editor tab
  3. Enter another simple query, e.g. select 2;
  4. Run the last query with Execute current line or Ctrl+F5

What did you expect to see?

Scrollbar position is the same as it was before execution.

What did you see instead?

Scrollbar position is reset (scrollbar is in its origin position at the top).

Useful extra information

Win 8.1 x64
DB4S Version 3.11.99 (Nov 23 2019)

Activity

  1. mgrojo commented on Dec 29, 2019

    @mgrojo
    Member

    In a current nightly only happens when the second query contains an error. I think that hasn't changed. I think that we only move the scroll when a statement fails.

    The problem is that we consider all the whitespace before a statement to be part of it, and when a statement has an error, we move the cursor to the beginning of it. I'll check whether there is an easy and clean solution for that.

  2. self-assigned this
    on Dec 29, 2019
  3. added
    bugConfirmed bugs or reports that are very likely to be bugs.
    on Dec 29, 2019
  4. T1mL3arn commented on Dec 30, 2019

    @T1mL3arn
    Author

    only happens when the second query contains an error

    Tested Dec 28 2019 nightly. The behavior is the same.

    Some new info: if db is marked as dirty, then scrollbar works as expected.

    To reproduce

    1. Do the same as in the first post
    2. Change select 2 to something that produces an error (e.g. select hi)
    3. Execute that new query with Execute current line
    4. Note db is in dirty state (it is possible to press revert changes)
    5. Restore query to select 2
    6. Execute it again.
    7. Note scrollbar works as expected
    8. Revert changes
    9. Execute query again.
    10. Note scrollbar is not on the query

    easy and clean solution

    Saving current scrollbar position?

  5. mgrojo commented on Dec 30, 2019

    @mgrojo
    Member

    Thanks @T1mL3arn. There were two problems here:

    1. The starting point of the failing query was considered from the ending point of the previous statement. In this case when there is a lot of whitespace, it had this effect. Now all that whitespace is skipped and the starting point for indicating the error is at the statement beginning (in the absence of any comment that will not be skipped).
    2. Failed queries never undid a savepoint that we set when executing some SQL code. Now it is always rollback appropriately when the statement does not change anything, independently of having failed or not.

    The fixes are already committed and will be available in the tomorrow's nightly. Could you try again and report any pending problem?

  6. T1mL3arn commented on Jan 3, 2020

    @T1mL3arn
    Author

    @mgrojo could you trigger windows build script(or whatever) so I can test new version ?

  7. mgrojo commented on Jan 3, 2020

    @mgrojo
    Member

    The windows build script is triggered each midnight (around UTC) when there are changes in the repository. In https://nightlies.sqlitebrowser.org/latest/ you can find the results and according to https://nightlies.sqlitebrowser.org/win64/commit.txt and https://nightlies.sqlitebrowser.org/win32/commit.txt, they include the latest changes.

  8. T1mL3arn commented on Jan 3, 2020

    @T1mL3arn
    Author

    Tested. Now db is not marked as dirty for queries with error. Wrong scroll behavior still remains for correct and incorrect queries.

  9. mgrojo commented on Jan 3, 2020

    @mgrojo
    Member

    I'd need detail steps to reproduce it or if you could record a video, it'd be more easy to reproduce and analyse.

  10. mgrojo commented on Jan 4, 2020

    @mgrojo
    Member

    @T1mL3arn thanks for the video. At first, I thought that you didn't have the fix, but then, I realized that we had problems with the "Execute Current Line" function in Windows, due to the line separator differences between platforms. I could finally reproduce it under Linux using a file with CR+LF endings. This was already reported in issues #1632 and #1768.

    Could you confirm with tomorrow's nightly that everything works as expected under Windows?

  11. added a commit that references this issue on Jan 5, 2020
  12. T1mL3arn commented on Jan 5, 2020

    @T1mL3arn
    Author

    Tested. Scroll behavior for incorrect queries is fixed. The wrong scroll behavior for correct queries is still there. Here is a new video.

  13. mgrojo commented on Jan 5, 2020

    @mgrojo
    Member

    That is caused by the hourglass icon appearing and modifying the tab bar height. Maybe this could solve the problem:
    ui->tabSqlAreas->setMinimumSize(ui->tabSqlAreas->iconSize());
    but I don't see any change in Linux when I set big values for that minimum size, so it might do nothing actually.

    Another option is setting icons permanently in the tabs. The icon could indicate if the tab is an external file, an unsaved buffer or a saved tab in the project. Or only the saved or unsaved status of the tab.

    @MKleusberg, do you have any other idea?

  14. added a commit that references this issue on Mar 2, 2020
  15. added a commit that references this issue on Mar 12, 2020
  16. added a commit that references this issue on May 2, 2020
  17. added a commit that references this issue on Jun 6, 2020
  18. mgrojo commented on Jun 21, 2020

    @mgrojo
    Member

    @T1mL3arn This is supposed to be fixed in our release 3.12.0. Could you please confirm and close this issue?

  19. added this to the 3.12.0 - Next release milestone on Jun 21, 2020
  20. T1mL3arn commented on Jun 22, 2020

    @T1mL3arn
    Author

    @mgrojo Checked 3.12.0, It works the same as described in the post above, i.e. it is still broken.

  21. mgrojo commented on Jun 22, 2020

    @mgrojo
    Member

    It was supposed to be solved by having always an icon in the tab. I cannot reproduce it in Linux, which is my development platform, so I'm kind of blind trying to solve this. Maybe someone else can provide some insight.

  22. removed this from the 3.12.0 - Next release milestone on Jun 22, 2020
  23. justinclift commented on Jun 30, 2020

    @justinclift
    Member

    @MKleusberg Thoughts on this one too? 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugConfirmed bugs or reports that are very likely to be bugs.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions