From e4a9473cc0a0e259f43c04c17e869f837682b072 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Thu, 10 Dec 2020 20:34:00 +0100 Subject: [PATCH 1/6] Fix syntax in prepare-release workflow --- .github/workflows/prepare-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 6e106557..e007d746 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -86,7 +86,7 @@ jobs: if (content.match('## Unreleased')) { content = content.replace('## Unreleased', `${heading}\n${changelog}`) } else { - content = content.replace('## Version, `${heading}\n${changelog}\n\n$$ Version`) + content = content.replace('## Version', `${heading}\n${changelog}\n\n## Version`) } fs.writeFileSync('CHANGELOG.md', content) From 7b069dfc55ad0867c914e5ad88ab3da60474c247 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Thu, 10 Dec 2020 20:45:19 +0100 Subject: [PATCH 2/6] Update to @actions/github-script v3 This is necessary to be able to pick up the new version of @actions/core version 1.2.6. Without that version, we cannot use exportVariable: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/ --- .github/workflows/prepare-release.yml | 4 ++-- .github/workflows/publish-crate.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index e007d746..23df79df 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -48,7 +48,7 @@ jobs: - name: Update changelog for version ${{ needs.setup.outputs.new-version }} id: changelog - uses: actions/github-script@v2 + uses: actions/github-script@v3 with: script: | var fs = require('fs') @@ -140,7 +140,7 @@ jobs: run: git push origin - name: Create pull request - uses: actions/github-script@v2 + uses: actions/github-script@v3 with: script: | const pr = await github.pulls.create({ diff --git a/.github/workflows/publish-crate.yml b/.github/workflows/publish-crate.yml index 5cc7331c..5f83ec56 100644 --- a/.github/workflows/publish-crate.yml +++ b/.github/workflows/publish-crate.yml @@ -30,7 +30,7 @@ jobs: - name: Lookup ${{ steps.vars.outputs.version }} tag id: need-release - uses: actions/github-script@v2 + uses: actions/github-script@v3 with: script: | const version = '${{ steps.vars.outputs.version }}' From 77c04859489ebf962b7078bb9db475f302c28cf6 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Thu, 10 Dec 2020 21:07:27 +0100 Subject: [PATCH 3/6] Avoid crash in toml-patch The toml-patch JavaScript library used by the set-create-version GitHub action crashes on the multiline TOML string. --- Cargo.toml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8fbcce26..693197ab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,14 +2,7 @@ name = "textwrap" version = "0.13.0" authors = ["Martin Geisler "] -description = """ -Textwrap is a library for word wrapping, indenting, and dedenting -strings. - -You can use it to format strings (such as help and error messages) for -display in commandline applications. It is designed to be efficient -and handle Unicode characters correctly. -""" +description = "Powerful library for word wrapping, indenting, and dedenting strings" documentation = "https://docs.rs/textwrap/" repository = "https://github.com/mgeisler/textwrap" readme = "README.md" From 0cbb9a87a94cb7421c9928d1efd69eb1c506c2dd Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Thu, 10 Dec 2020 22:01:38 +0100 Subject: [PATCH 4/6] Align changelog dates with prepare-release The YYYY-MM-DD format is more uniform so I went with that. --- CHANGELOG.md | 28 ++++++++++++++-------------- tests/version-numbers.rs | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa23db85..18577b22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ This file lists the most important changes made in each release of `textwrap`. -## Version 0.13.0 — December 5th, 2020 +## Version 0.13.0 (2020-12-05) This is a major release which rewrites the core logic, adds many new features, and fixes a couple of bugs. Most programs which use @@ -157,7 +157,7 @@ Thanks to @CryptJar and @Koxiat for their support in the PRs above! * [#216](https://github.com/mgeisler/textwrap/pull/216): Forbid the use of unsafe code. -## Version 0.12.1 — July 3rd, 2020 +## Version 0.12.1 (2020-07-03) This is a bugfix release. @@ -167,7 +167,7 @@ This is a bugfix release. broken and would cause extra whitespace to be inserted when words were longer than the line width. -## Version 0.12.0 — June 26th, 2020 +## Version 0.12.0 (2020-06-26) The code has been updated to the [Rust 2018 edition][rust-2018] and each new release of `textwrap` will only support the latest stable @@ -185,7 +185,7 @@ US-English. This slims down the dependency. * Fixed [#158][issue-158]: Unintended wrapping when using external splitter. * Fixed [#177][issue-177]: Update examples to the 2018 edition. -## Version 0.11.0 — December 9th, 2018 +## Version 0.11.0 (2018-12-09) Due to our dependencies bumping their minimum supported version of Rust, the minimum version of Rust we test against is now 1.22.0. @@ -194,7 +194,7 @@ Rust, the minimum version of Rust we test against is now 1.22.0. trailing newlines. Thanks @bbqsrc! * Fixed [#151][issue-151]: Release of version with hyphenation 0.7. -## Version 0.10.0 — April 28th, 2018 +## Version 0.10.0 (2018-04-28) Due to our dependencies bumping their minimum supported version of Rust, the minimum version of Rust we test against is now 1.17.0. @@ -204,7 +204,7 @@ Rust, the minimum version of Rust we test against is now 1.17.0. * Fixed [#122][issue-122]: Take newlines into account when wrapping. * Fixed [#129][issue-129]: Panic on string with em-dash. -## Version 0.9.0 — October 5th, 2017 +## Version 0.9.0 (2017-10-05) The dependency on `term_size` is now optional, and by default this feature is not enabled. This is a *breaking change* for users of @@ -217,7 +217,7 @@ Added a regression test for the case where `width` is set to * Fixed [#101][issue-101]: Make `term_size` an optional dependency. -## Version 0.8.0 — September 4th, 2017 +## Version 0.8.0 (2017-09-04) The `Wrapper` stuct is now generic over the type of word splitter being used. This means less boxing and a nicer API. The @@ -232,7 +232,7 @@ if you will be iterating over the wrapped lines one by one. @hcpl! * Fixed [#81][issue-81]: Set `html_root_url`. -## Version 0.7.0 — July 20th, 2017 +## Version 0.7.0 (2017-07-20) Version 0.7.0 changes the return type of `Wrapper::wrap` from `Vec` to `Vec>`. This means that the output lines @@ -250,7 +250,7 @@ important for you so we can provide a work around. * Fixed [#58][issue-58]: Add a "fast_wrap" function. * Fixed [#61][issue-61]: Documentation errors. -## Version 0.6.0 — May 22nd, 2017 +## Version 0.6.0 (2017-05-22) Version 0.6.0 adds builder methods to `Wrapper` for easy one-line initialization and configuration: @@ -264,7 +264,7 @@ words, not even at existing hyphens. * Fixed [#28][issue-28]: Support not squeezing whitespace. -## Version 0.5.0 — May 15th, 2017 +## Version 0.5.0 (2017-05-15) Version 0.5.0 has *breaking API changes*. However, this only affects code using the hyphenation feature. The feature is now optional, so @@ -287,22 +287,22 @@ Other changes include optimizations, so version 0.5.0 is roughly * Fixed [#36][issue-36]: Support building without `hyphenation`. * Fixed [#39][issue-39]: Respect non-breaking spaces. -## Version 0.4.0 — January 24th, 2017 +## Version 0.4.0 (2017-01-24) Documented complexities and tested these via `cargo bench`. * Fixed [#13][issue-13]: Immediatedly add word if it fits. * Fixed [#14][issue-14]: Avoid splitting on initial hyphens. -## Version 0.3.0 — January 7th, 2017 +## Version 0.3.0 (2017-01-07) Added support for automatic hyphenation. -## Version 0.2.0 — December 28th, 2016 +## Version 0.2.0 (2016-12-28) Introduced `Wrapper` struct. Added support for wrapping on hyphens. -## Version 0.1.0 — December 17th, 2016 +## Version 0.1.0 (2016-12-17) First public release with support for wrapping strings on whitespace. diff --git a/tests/version-numbers.rs b/tests/version-numbers.rs index 3429514c..9cc785b2 100644 --- a/tests/version-numbers.rs +++ b/tests/version-numbers.rs @@ -7,7 +7,7 @@ fn test_readme_deps() { fn test_changelog() { version_sync::assert_contains_regex!( "CHANGELOG.md", - r"^## Version {version} — .* \d\d?.., 20\d\d$" + r"^## Version {version} \(20\d\d-\d\d-\d\d\)" ); } From feef8b43043a1f001d4ba349a382878d2d573949 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Thu, 10 Dec 2020 21:03:26 +0000 Subject: [PATCH 5/6] Update changelog for version 0.13.1 --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18577b22..56a562ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,18 @@ This file lists the most important changes made in each release of `textwrap`. +## Version 0.13.1 (2020-12-10) + +This is a bugfix release which fixed the width computations for +colored text. + +* [#245](https://github.com/mgeisler/textwrap/pull/245): Support + deleting a word with Ctrl-Backspace in the interactive demo +* [#246](https://github.com/mgeisler/textwrap/pull/246): Show build + type (debug/release) in interactive demo +* [#249](https://github.com/mgeisler/textwrap/pull/249): Correctly + compute width while skipping over ANSI escape sequences + ## Version 0.13.0 (2020-12-05) This is a major release which rewrites the core logic, adds many new From 7b7e45c9f709dd22eaed814f16771d7e228c2490 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Thu, 10 Dec 2020 21:05:06 +0000 Subject: [PATCH 6/6] Bump version to 0.13.1 --- Cargo.toml | 2 +- src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 693197ab..cfe87063 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "textwrap" -version = "0.13.0" +version = "0.13.1" authors = ["Martin Geisler "] description = "Powerful library for word wrapping, indenting, and dedenting strings" documentation = "https://docs.rs/textwrap/" diff --git a/src/lib.rs b/src/lib.rs index 1158abcd..7d0dd191 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -84,7 +84,7 @@ //! //! [textwrap-macros]: https://docs.rs/textwrap-macros/ -#![doc(html_root_url = "https://docs.rs/textwrap/0.13.0")] +#![doc(html_root_url = "https://docs.rs/textwrap/0.13.1")] #![forbid(unsafe_code)] // See https://github.com/mgeisler/textwrap/issues/210 #![deny(missing_docs)] #![deny(missing_debug_implementations)]