Commit ace0f2c
authored
Implement Tab Width (#172)
<!--- IMPORTANT: If this PR addresses multiple unrelated issues, it will
be closed until separated. -->
### Description
This PR adds the tab stops implementation. It was previously thought to
not function as expected but after comparing to other editors this is
the correct implementation. Adding tab stops makes it so tabs stop at
intervals along the document, so a tab will not act like a space but
rather a break in the line until the next tab stop. Like so:
```
Raw: |\t1\t2\t3
Visual:|----1---2---3
Raw: |\tabc\t2\t3
Visual:|----abc-2---3
```
### Related Issues
<!--- REQUIRED: Tag all related issues (e.g. * #123) -->
<!--- If this PR resolves the issue please specify (e.g. * closes #123)
-->
<!--- If this PR addresses multiple issues, these issues must be related
to one other -->
* Closes #80
### Checklist
<!--- Add things that are not yet implemented above -->
- [x] I read and understood the [contributing
guide](https://github.com/CodeEditApp/CodeEdit/blob/main/CONTRIBUTING.md)
as well as the [code of
conduct](https://github.com/CodeEditApp/CodeEdit/blob/main/CODE_OF_CONDUCT.md)
- [x] The issues this PR addresses are related to each other
- [x] My changes generate no new warnings
- [x] My code builds and runs on my machine
- [x] My changes are all related to the related issue above
- [x] I documented my code
### Screenshots
Screen recording shows the width being updated in real time using a
placeholder preference, as well as editing a line with tabs showing the
tab stops go backwards only when needed.
https://user-images.githubusercontent.com/35942988/229870857-2cb2e40b-4c61-43ce-96c7-f79a8514cfbd.mov
<!--- REQUIRED: if issue is UI related -->
<!--- IMPORTANT: Fill out all required fields. Otherwise we might close
this PR temporarily -->1 parent 169e4ea commit ace0f2c
File tree
1 file changed
+2
-4
lines changed- Sources/CodeEditTextView/Controller
1 file changed
+2
-4
lines changedLines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
| 236 | + | |
| 237 | + | |
240 | 238 | | |
241 | 239 | | |
242 | 240 | | |
| |||
0 commit comments