Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextConsoleViewer Scrolling #719

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sagarrohat
Copy link

@sagarrohat sagarrohat commented Sep 22, 2023

Improve logic for auto-enable/-disable of scroll lock in TextConsoleViewer #669

  • Improved logic for checking if the end of the document is reached.
  • Added condition to set scroll lock if mouse scrolls up.
  • Improved logic for checking if the view is empty or the content is minimal, implying no need for scrolling.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 22, 2023

Test Results

   558 files   -    78     558 suites   - 78   24m 29s ⏱️ - 15m 31s
 3 352 tests  -   593   3 331 ✅  -   591   21 💤  - 2  0 ❌ ±0 
10 662 runs   - 1 779  10 504 ✅  - 1 773  158 💤  - 6  0 ❌ ±0 

Results for commit 7782daa. ± Comparison against base commit 31e1ef4.

This pull request removes 593 tests.
AntUITests org.eclipse.ant.tests.ui.APITests ‑ testCompareJavaVersions
AntUITests org.eclipse.ant.tests.ui.AntUtilTests ‑ testGetIncludeTargetsComplexHierarchyAlias
AntUITests org.eclipse.ant.tests.ui.AntUtilTests ‑ testGetIncludeTargetsComplexHierarchyMisc
AntUITests org.eclipse.ant.tests.ui.AntUtilTests ‑ testGetIncludeTargetsComplexHierarchyNoAlias
AntUITests org.eclipse.ant.tests.ui.AntUtilTests ‑ testGetIncludeTargetsExternalFiles
AntUITests org.eclipse.ant.tests.ui.AntUtilTests ‑ testGetIncludeTargetsPerformance
AntUITests org.eclipse.ant.tests.ui.AntUtilTests ‑ testGetIncludeTargetsSimpleHierarchyAlias
AntUITests org.eclipse.ant.tests.ui.AntUtilTests ‑ testGetIncludeTargetsSimpleHierarchyNoAliases
AntUITests org.eclipse.ant.tests.ui.AntUtilTests ‑ testGetTargetsLaunchConfiguration
AntUITests org.eclipse.ant.tests.ui.AntUtilTests ‑ testGetTargetsLaunchConfigurationMinusD
…

♻️ This comment has been updated with latest results.

@@ -306,11 +293,13 @@ public void keyPressed(KeyEvent e) {
if (isAutoScrollLockNotApplicable()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could rewrite this whole lambda like this:

if (isAuto... || e.count == 0) { 
    return; 
}
setScrollLock(e.count > 0 || !isAtEndOfDocument());

Comment on lines +167 to +168
* Checks if user preference is enabled for auto scroll lock. and if the view is
* empty or the content is minimal, implying no need for scrolling.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Checks if user preference is enabled for auto scroll lock. and if the view is
* empty or the content is minimal, implying no need for scrolling.
* Checks if the auto scrolling is not applicable based on:
<ul>
<li>Whether or not the appropriate user preference is enabled</li>
<li>Whether or not there is enough content to even require scrolling</li>
</ul>

@jukzi jukzi force-pushed the TextConsoleViewer_Scrolling branch from 0ed9a2f to 7782daa Compare March 8, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants