slynch8 / 10x

10x IDE/Editor
190 stars 34 forks source link

Allow indentation mode to use a mixture of tabs and spaces #2868

Open JPBarrick opened 1 week ago

JPBarrick commented 1 week ago

A reasonably common method of using tabs/spaces is to use tabs for indentation, and use spaces for alignment. This method allows individuals to use their own preference of indentation tab width while keeping things such as tabular code alignment correct.

Currently, selecting a block of code, and then pressing [Tab] will remove preceding spaces and replace them with tab characters. What needs to happen is to just insert the extra tab characters at the beginning of each line.

Perhaps it could be a third IndentMode, e.g. Tabs, Spaces, and Mixed...?

https://github.com/user-attachments/assets/fb722c9b-ed08-42a9-aa51-76f0373c456c

JPBarrick commented 1 week ago

An example of alignment using spaces, and the block indentation using tabs: image

image

In this example, it is important to keep the decimal point aligned in each column, while also keeping the column labels aligned: