Support for multiline indentation#245
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
lhecker
left a comment
There was a problem hiding this comment.
I'm unfortunately not sure if we can merge this in the current state. I apologize for that. 🙈
Aside from the issues I mentioned, I believe this needs some polishing, because it's currently significantly larger than it likely could be. I have a strong gut feeling that the feature can be implemented in around 100 lines of code with a general approach that's similar to the existing code.
Please have a look; refactored the implementation with a leaner approach & added multi-line support. Thanks! |
|
I'll review it again once I get a chance. 🙂 |
|
@DHowett requesting extra eyes on this 👀 would be nice early on so as to alleviate frequent conflicts. |
|
I'll go through this PR after #397 merges, as it introduces the ability to group multiple changes into a single undo. This will be very useful for this PR as well. |
DHowett
left a comment
There was a problem hiding this comment.
thanks so much both of you for doing this!
Closes microsoft#110 Co-authored-by: Leonard Hecker <leonard@hecker.io>
Overview
Closes #110.
Normally, editors do support indentation based on where the cursor is positioned at:
TABshould add an indent from the beginning of the lineTABshould add an indent from the current cursor positionTABshould add an indent relative to that text selectionSHIFT+TABshould do the inverse of all the operations mentioned aboveTABorSHIFT+TAB, should work as explained above for the lines selectedThis PR aims to implement this feature in a simple way.
Demo
Screen.Recording.2025-05-24.at.17.50.50.mov