CodeEditApp / CodeEditSourceEditor

A code editor view written in Swift powered by tree-sitter.
https://codeeditapp.github.io/CodeEditSourceEditor/documentation/codeeditsourceeditor
MIT License
504 stars 74 forks source link

Respect User Indent Settings #147

Closed thecoolwinter closed 1 year ago

thecoolwinter commented 1 year ago

Description

Adds an indentOption binding to the initializer to determine the editor's behavior on a tab key press. Before, our indent string was determined by creating a string repeating the space character tabWidth times. tabWidth should be used for the number of spaces a tab character takes up visually, and will have to be in a different PR. This PR also removes the TabReplacementFilter object as it's no longer needed.

IndentOption is a Codable-conforming enum that can be either spaces with a number of spaces to insert, or tabs. The Codable inheritance was added due to the fact that this option will most likely be stored for user preferences.

This PR will have a related PR in CodeEdit for the settings required to enable this functionality.

Related Issues

Screenshots

https://user-images.githubusercontent.com/35942988/219971634-f28b7644-d64c-4f79-8f47-e6de54f6b498.mov

lukepistrol commented 1 year ago

Is this still WIP?