Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: newline when empty flag #49

Merged
merged 5 commits into from
Jul 10, 2024
Merged

feat: newline when empty flag #49

merged 5 commits into from
Jul 10, 2024

Conversation

pygrum
Copy link
Collaborator

@pygrum pygrum commented Jul 10, 2024

Feature description

Added NewlineWhenEmpty flag to Console object, which prints newlines before and after user input, even if the user input was empty. This was originally default behaviour, which lead to unwanted gaps when hitting enter, Ctrl-C, or any 'empty' character.

Hitting enter with NewlineWhenEmpty set:

➜  go run main.go

app > 


app > 


app > 

Hitting enter without NewlineWhenEmpty set (default):

➜  testenv go run main.go                                  

app > 
app > 
app > 
app > 

In addition to NewlineWhenEmpty, console field EmptyChars is created to modify which characters a line must be made up of to be considered empty. By default these are:

  • tab character
  • space character

and of course, no input at all.

@pygrum pygrum requested review from moloch-- and lesnuages July 10, 2024 18:38
@pygrum pygrum merged commit e608d68 into main Jul 10, 2024
7 checks passed
@pygrum pygrum deleted the no-newline-when-empty branch July 10, 2024 19:55
renovate bot referenced this pull request in jippi/dottie Jul 12, 2024
… go.mod (#64)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[github.com/reeflective/console](https://github.com/reeflective/console)
| `v0.1.15` -> `v0.1.16` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2freeflective%2fconsole/v0.1.16?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2freeflective%2fconsole/v0.1.16?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2freeflective%2fconsole/v0.1.15/v0.1.16?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2freeflective%2fconsole/v0.1.15/v0.1.16?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>reeflective/console (github.com/reeflective/console)</summary>

###
[`v0.1.16`](https://github.com/reeflective/console/releases/tag/v0.1.16)

[Compare
Source](https://github.com/reeflective/console/compare/v0.1.15...v0.1.16)

#### What's Changed

- feat: newline when empty flag by
[@&#8203;pygrum](https://github.com/pygrum) in
[https://github.com/reeflective/console/pull/49](https://github.com/reeflective/console/pull/49)
- feat: custom shell highlight by
[@&#8203;pygrum](https://github.com/pygrum) in
[https://github.com/reeflective/console/pull/50](https://github.com/reeflective/console/pull/50)

**Full Changelog**:
reeflective/console@v0.1.15...v0.1.16

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* */8 * * *" (UTC), Automerge - At
any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/jippi/dottie).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjUuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant