Commit 248b58f
authored
Make STTextView first responder when opening an empty file (CodeEdit #696) (#144)
# Description
<!--- REQUIRED: Describe what changed in detail -->
* In `STTextViewController.swift`, the `setCursorPosition` function was
changed so that, if the currently open file is empty, the cursor is
automatically set to the first position and active. This behavior is
similar to other text editors e.g. VSCode.
A related PR is opened in CodeEdit, which works in tandem with this one,
so that newly-created files automatically open in a new editor tab.
# Related Issue
<!--- REQUIRED: Tag all related issues (e.g. * #23) -->
* [#696](CodeEditApp/CodeEdit#696) from
CodeEdit.
* PR [#1057](CodeEditApp/CodeEdit#1057) from
CodeEdit.
# 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] My changes generate no new warnings
- [x] My code builds and runs on my machine
- [x] I documented my code
- [x] Review requested
# Screenshots1 parent d83b449 commit 248b58f
1 file changed
+10
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
324 | 334 | | |
325 | 335 | | |
326 | 336 | | |
| |||
0 commit comments