diff --git a/Example/Example.csproj b/Example/Example.csproj index 634b82843..35262be58 100644 --- a/Example/Example.csproj +++ b/Example/Example.csproj @@ -1,7 +1,7 @@  Exe - net6.0 + net7.0 diff --git a/README.md b/README.md index f5dc01918..9d462cefc 100644 --- a/README.md +++ b/README.md @@ -7,15 +7,12 @@ [![License](https://img.shields.io/github/license/gui-cs/gui.cs.svg)](LICENSE) ![Bugs](https://img.shields.io/github/issues/gui-cs/gui.cs/bug) -***The current release of Tmerinal.Gui [(v1.10)](https://www.nuget.org/packages/Terminal.Gui) is stable, rich, and broadly used. The team is now focused on designing and building a significant upgrade we're referring to as `v2`. Therefore, `v1` is now in maintenance mode.*** +***The current, stable, release of Terminal.Gui is [v1.x](https://www.nuget.org/packages/Terminal.Gui). It is stable, rich, and broadly used. The team is now focused on designing and building a significant upgrade we're referring to as `v2`. Therefore:*** + * *`v1` is now in maintenance mode, meaning we will accept PRs for v1.x (the `develop` branch) only for issues impacting existing functionality.* + * *All new development happens on the `v2_develop` branch. See the V2 discussion [here](https://github.com/gui-cs/Terminal.Gui/discussions/1940).* + * *Developers are encouraged to continue building on [v1.x](https://www.nuget.org/packages/Terminal.Gui) until we announce `v2` is stable.* -***This means we will accept PRs for v1.x (the `develop` branch) only for issues impacting existing functionality. All new development will happen on the `v2_develop` branch. See the V2 discussion [here](https://github.com/gui-cs/Terminal.Gui/discussions/1940).*** - -***Developers are encouraged to continue building on `v1` until we announce `v2` is stable.*** - -# Terminal.Gui - Cross Platform Terminal UI toolkit for .NET - -A toolkit for building rich console apps for .NET, .NET Core, and Mono that works on Windows, the Mac, and Linux/Unix. +**Terminal.Gui**: A toolkit for building rich console apps for .NET, .NET Core, and Mono that works on Windows, the Mac, and Linux/Unix. ![Sample app](docfx/images/sample.gif) diff --git a/ReactiveExample/ReactiveExample.csproj b/ReactiveExample/ReactiveExample.csproj index 7a22c463a..d1c8c9d18 100644 --- a/ReactiveExample/ReactiveExample.csproj +++ b/ReactiveExample/ReactiveExample.csproj @@ -1,7 +1,7 @@  Exe - net6.0 + net7.0 diff --git a/Terminal.Gui/ConsoleDrivers/CursesDriver/binding.cs b/Terminal.Gui/ConsoleDrivers/CursesDriver/binding.cs index 42612b3ae..587a43e71 100644 --- a/Terminal.Gui/ConsoleDrivers/CursesDriver/binding.cs +++ b/Terminal.Gui/ConsoleDrivers/CursesDriver/binding.cs @@ -331,6 +331,7 @@ namespace Unix.Terminal { #pragma warning disable RCS1102 // Make class static. internal class Delegates { #pragma warning restore RCS1102 // Make class static. +#pragma warning disable CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language. public delegate IntPtr initscr (); public delegate int endwin (); public delegate bool isendwin (); @@ -555,4 +556,5 @@ namespace Unix.Terminal { } } #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member +#pragma warning restore CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language. } diff --git a/Terminal.Gui/README.md b/Terminal.Gui/README.md index 37a026fd7..81d337f30 100644 --- a/Terminal.Gui/README.md +++ b/Terminal.Gui/README.md @@ -49,6 +49,16 @@ Doing so will update the `.csproj` files in your branch with version info, which ## Publishing a Release of Terminal.Gui +First, use the [Semantic Versioning](https://semver.org/) rules.to determine the new verison number. + +Given a version number MAJOR.MINOR.PATCH, increment the: + +* MAJOR version when you make incompatible API changes +* MINOR version when you add functionality in a backwards compatible manner +* PATCH version when you make backwards compatible bug fixes + +Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format. + To release a new version (e.g. with a higher `major`, `minor`, or `patch` value) tag a commit using `git tag` and then push that tag directly to the `main` branch on `github.com/gui-cs/Terminal.Gui` (`upstream`). The `tag` must be of the form `v..`, e.g. `v2.3.4`. @@ -67,7 +77,7 @@ The PR title should be of the form "Release v2.3.4" ```powershell git checkout develop git pull upstream develop -git checkout -b v_2_3_4 +git checkout -b v2_3_4 git add . git commit -m "Release v2.3.4" git push @@ -117,13 +127,8 @@ https://www.nuget.org/packages/Terminal.Gui ### 10) Add a new Release in Github: https://github.com/gui-cs/Terminal.Gui/releases -Generate release notes with the list of PRs since the last release +Generate release notes with the list of PRs since the last release. -Use `gh` to get a list with just titles to make it easy to paste into release notes: - -```powershell -gh pr list --limit 500 --search "is:pr is:closed is:merged closed:>=2021-05-18" -``` ### 11) Update the `develop` branch with the new version ```powershell diff --git a/Terminal.Gui/Views/TextView.cs b/Terminal.Gui/Views/TextView.cs index 7cb797b11..7a06f733a 100644 --- a/Terminal.Gui/Views/TextView.cs +++ b/Terminal.Gui/Views/TextView.cs @@ -387,7 +387,7 @@ namespace Terminal.Gui { pos = new Point (col, i); col += (textToReplace.Length - matchText.Length); } - if (col + 1 > txt.Length) { + if (col < 0 || col + 1 > txt.Length) { break; } col = txt.IndexOf (matchText, col + 1); diff --git a/Terminal.Gui/Windows/FileDialog.cs b/Terminal.Gui/Windows/FileDialog.cs index c2d20f3f1..c5070d96a 100644 --- a/Terminal.Gui/Windows/FileDialog.cs +++ b/Terminal.Gui/Windows/FileDialog.cs @@ -914,7 +914,7 @@ namespace Terminal.Gui { /// The message. /// The allowed types. public SaveDialog (ustring title, ustring message, List allowedTypes = null) - : base (title, prompt: Strings.fdSave, nameFieldLabel: $"{Strings.fdSaveAs}:", message: message, allowedTypes) { } + : base (title, prompt: Strings.fdSave, nameFieldLabel: $"{Strings.fdSaveAs}", message: message, allowedTypes) { } /// /// Gets the name of the file the user selected for saving, or null diff --git a/Terminal_Gui.ndproj b/Terminal_Gui.ndproj deleted file mode 100644 index 1f8ef6df2..000000000 --- a/Terminal_Gui.ndproj +++ /dev/null @@ -1,512 +0,0 @@ - - - .\NDependOut - - - - . - - - - .NET 7.0 - - - True - True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 1 - 0 - 0 - $ManDay$ - 50 - USD - After - 18 - 240 - 8 - 5 - 10 - 20 - 50 - 1200000000 - 12000000000 - 72000000000 - 360000000000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/UICatalog/UICatalog.csproj b/UICatalog/UICatalog.csproj index c561c4f88..7dac6ac09 100644 --- a/UICatalog/UICatalog.csproj +++ b/UICatalog/UICatalog.csproj @@ -22,7 +22,7 @@ - + diff --git a/UnitTests/Views/TextViewTests.cs b/UnitTests/Views/TextViewTests.cs index 5add478f6..1b83d3d51 100644 --- a/UnitTests/Views/TextViewTests.cs +++ b/UnitTests/Views/TextViewTests.cs @@ -949,7 +949,7 @@ namespace Terminal.Gui.ViewTests { Assert.Equal (0, _textView.CursorPosition.X); Assert.Equal (0, _textView.CursorPosition.Y); Assert.Equal ("This is the second line.", _textView.Text.ToString ()); - Assert.Equal ($"This is the first line.{Environment.NewLine}", Clipboard.Contents.ToString()); + Assert.Equal ($"This is the first line.{Environment.NewLine}", Clipboard.Contents.ToString ()); break; case 2: _textView.ProcessKey (new KeyEvent (Key.K | Key.CtrlMask, new KeyModifiers ())); @@ -985,7 +985,7 @@ namespace Terminal.Gui.ViewTests { _textView.ProcessKey (new KeyEvent (Key.K | Key.AltMask, new KeyModifiers ())); Assert.Equal (0, _textView.CursorPosition.X); Assert.Equal (1, _textView.CursorPosition.Y); - Assert.Equal ($"This is the first line.{Environment.NewLine}", _textView.Text.ToString()); + Assert.Equal ($"This is the first line.{Environment.NewLine}", _textView.Text.ToString ()); Assert.Equal ($"This is the second line.", Clipboard.Contents.ToString ()); break; case 1: @@ -6815,5 +6815,17 @@ This is the second line. Assert.Equal (1, eventcount); Assert.Equal ($"This is the first line.{Environment.NewLine}This is the second line.{Environment.NewLine}", tv.Text); } + + [Fact] + public void ReplaceAllText_Does_Not_Throw_Exception () + { + var textToFind = "hello! hello!"; + var textToReplace = "hello!"; + var tv = new TextView () { Width = 20, Height = 3, Text = textToFind }; + + var exception = Record.Exception (() => tv.ReplaceAllText (textToFind, false, false, textToReplace)); + Assert.Null (exception); + Assert.Equal (textToReplace, tv.Text); + } } } \ No newline at end of file