Skip to content

Add keyboard shortcuts for scrolling horizontally#162992

Merged
alexdima merged 5 commits into
microsoft:mainfrom
Brikaa:horizontal-scroll
Oct 24, 2022
Merged

Add keyboard shortcuts for scrolling horizontally#162992
alexdima merged 5 commits into
microsoft:mainfrom
Brikaa:horizontal-scroll

Conversation

@Brikaa

@Brikaa Brikaa commented Oct 7, 2022

Copy link
Copy Markdown
Contributor

closes #143466

CursorConfiguration

  • Adds fontInfo as a dependency
  • Uses fontInfo to determine the lineHeight instead of getting it explicitly (removes lineHeight dependency).
  • Uses fontInfo to determine the typicalHalfwidthCharacterWidth

CoreNavigationCommands

  • In each scrolling command, use EditorScrollImpl.runCoreEditorCommand instead of EditorScrollImpl._runEditorScroll and pass EditorScroll_.RawArguments
  • Adds horizontal units and directions to EditorScroll_.Unit and EditorScroll_.Direction
  • EditorScrollImpl.runCoreEditorCommand determines the scrolling method from the direction and the unit if they are compatible
  • The horizontal scrolling unit used for the shortcuts is Column (typicalHalfwidthCharacterWidth).
  • Each of scrollLeft and scrollRight scroll two columns (this more or less matches the pace of the vertical scroll)
  • However, horizontal scrolling does not guarantee landing after exactly two columns because of the flooring done in scrollable; typicalHalfwidthCharacterWidth is usually a float while integer values are forced in the viewLayout's scrollable
  • args.revealCursor is still not implemented
  • No default keyboard shortcut is configured for horizontal scrolling

@jrieken jrieken assigned alexdima and unassigned jrieken Oct 10, 2022
@alexdima alexdima added this to the October 2022 milestone Oct 24, 2022
@alexdima

Copy link
Copy Markdown
Member

Thank you!

@alexdima
alexdima merged commit feab94a into microsoft:main Oct 24, 2022
formigoni pushed a commit to formigoni/vscode that referenced this pull request Oct 27, 2022
* Initial horizontal scroll

* Use columns as unit in horizontal scrolling shortcuts

* Horizontal scroll value 2, remove shortcuts

* Unify Horizontal, Vertical scroll Directions and Units, determine the method

Co-authored-by: Alexandru Dima <[email protected]>
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add keyboard shortcuts for scrolling horizontally

6 participants