{"id":240754,"date":"2022-12-15T08:00:23","date_gmt":"2022-12-15T16:00:23","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/visualstudio\/?p=240754"},"modified":"2022-12-15T09:57:50","modified_gmt":"2022-12-15T17:57:50","slug":"sticky-scroll-now-in-preview","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/sticky-scroll-now-in-preview\/","title":{"rendered":"Sticky Scroll now in preview"},"content":{"rendered":"<p>When working in code with long classes and methods that stretch beyond the vertical size of your screen, it can be difficult to keep track of which scope you\u2019re working in. You may be editing a long method or exploring an unfamiliar codebase.<\/p>\n<p>In Visual Studio 2022 17.5 Preview 2, we introduced Sticky Scroll to help you be more productive and save time when going through your codebase. Sticky Scroll provides immediate context to the code in which you\u2019re working by keeping the relevant headers in your view. To start using Sticky Scroll today, update to the latest version of Visual Studio Preview and enable it in<em> Tools &gt; Options &gt; Text Editor &gt; General &gt; Sticky Scroll<\/em> by toggling the checkbox for &#8220;Show the nested current scopes during the scroll at the top of the editor&#8221;.<\/p>\n<p><div  class=\"d-flex justify-content-center\"><a class=\"cta_button_link btn-primary mb-24\" href=\"https:\/\/visualstudio.microsoft.com\/vs\/preview\/\" target=\"_blank\">Download Visual Studio Preview<\/a><\/div><\/p>\n<h2>Stay Oriented in Your Code as You Scroll<\/h2>\n<p>As you <em>scroll <\/em>through your code, namespaces, classes, and methods will <em>stick <\/em>to the top of the editor! Sticky Scroll supports multiple code formats, including C#, C++, XAML, and JSON.<\/p>\n<p><figure id=\"attachment_240762\" aria-labelledby=\"figcaption_attachment_240762\" class=\"wp-caption aligncenter\" ><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2022\/12\/sticky-scroll-long-code-example.gif\"><img decoding=\"async\" class=\"wp-image-240762 size-full\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2022\/12\/sticky-scroll-long-code-example.gif\" alt=\"\" width=\"878\" height=\"267\" \/><\/a><figcaption id=\"figcaption_attachment_240762\" class=\"wp-caption-text\">C# example<\/figcaption><\/figure><\/p>\n<p><figure id=\"attachment_240771\" aria-labelledby=\"figcaption_attachment_240771\" class=\"wp-caption aligncenter\" ><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2022\/12\/sticky-scroll-c-scrolling.gif\"><img decoding=\"async\" class=\"wp-image-240771 size-full\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2022\/12\/sticky-scroll-c-scrolling.gif\" alt=\"\" width=\"1232\" height=\"329\" \/><\/a><figcaption id=\"figcaption_attachment_240771\" class=\"wp-caption-text\">C++ example<\/figcaption><\/figure><\/p>\n<h2>Single Click Navigation<\/h2>\n<p>In addition to sticking to the top of the editor, the headers also take you straight to that line of code. Clicking on one of these lines will quickly navigate you to the top of that indentation level.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2022\/12\/sticky-scroll-click-to-navigate.gif\"><img decoding=\"async\" class=\"aligncenter wp-image-240763 size-full\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2022\/12\/sticky-scroll-click-to-navigate.gif\" alt=\"\" width=\"878\" height=\"267\" \/><\/a><\/p>\n<h2>Try It Out in Visual Studio 2022 17.5 Preview 2<\/h2>\n<p>Enable it in<em> Tools &gt; Options &gt; Text Editor &gt; General &gt; Sticky Scroll<\/em> by toggling the checkbox for &#8220;Show the nested current scopes during the scroll at the top of the editor&#8221;. \u00a0You can also set the maximum number of sticky lines with the &#8220;Define the maximum number of sticky lines to show&#8221; option.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2022\/12\/sticky-scroll-options.png\"><img decoding=\"async\" class=\"wp-image-240769 size-large aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2022\/12\/sticky-scroll-options-1024x788.png\" alt=\"\" width=\"640\" height=\"493\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2022\/12\/sticky-scroll-options-1024x788.png 1024w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2022\/12\/sticky-scroll-options-300x231.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2022\/12\/sticky-scroll-options-768x591.png 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2022\/12\/sticky-scroll-options.png 1072w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<h2>Please Share Your Feedback<\/h2>\n<p>We hope this feature will help you be more productive with your coding. As we continue to work on this feature, we appreciate your feedback. Let us know what you think of Sticky Scroll in Visual Studio on <a href=\"https:\/\/developercommunity.visualstudio.com\/t\/Sticky-function-signatures-when-scrollin\/10117341\">this feedback ticket<\/a> and <a href=\"https:\/\/developercommunity.visualstudio.com\/VisualStudio\/report\">report any issues<\/a> you face so we can improve the experience.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When working in code with long classes and methods that stretch beyond the vertical size of your screen, it can be difficult to keep track of which scope you\u2019re working in. You may be editing a long method or exploring an unfamiliar codebase. In Visual Studio 2022 17.5 Preview 2, we introduced Sticky Scroll to [&hellip;]<\/p>\n","protected":false},"author":105708,"featured_media":255385,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[155],"tags":[6879,526,6815],"class_list":["post-240754","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-visual-studio","tag-editor","tag-productivity","tag-visual-studio-2022"],"acf":[],"blog_post_summary":"<p>When working in code with long classes and methods that stretch beyond the vertical size of your screen, it can be difficult to keep track of which scope you\u2019re working in. You may be editing a long method or exploring an unfamiliar codebase. In Visual Studio 2022 17.5 Preview 2, we introduced Sticky Scroll to [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/240754","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/users\/105708"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=240754"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/240754\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/255385"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=240754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=240754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=240754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}