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

Toplevel.EnsureVisibleBounds throws an exception if border is null. #2267

Closed
BDisp opened this issue Jan 3, 2023 · 0 comments · Fixed by #2268
Closed

Toplevel.EnsureVisibleBounds throws an exception if border is null. #2267

BDisp opened this issue Jan 3, 2023 · 0 comments · Fixed by #2268
Labels

Comments

@BDisp
Copy link
Collaborator

BDisp commented Jan 3, 2023

This unit test proves that:

public void EnsureVisibleBounds_With_Border_Null_Not_Throws ()
{
	var top = new Toplevel ();
	Application.Begin (top);

	var exception = Record.Exception (() => ((FakeDriver)Application.Driver).SetBufferSize (0, 10));
	Assert.Null (exception);

	exception = Record.Exception (() => ((FakeDriver)Application.Driver).SetBufferSize (10, 0));
	Assert.Null (exception);
}

Here a print screen of the error if the console height is resized to zero:

imagem

BDisp added a commit to BDisp/Terminal.Gui that referenced this issue Jan 3, 2023
@tig tig added the bug label Jan 3, 2023
@tig tig closed this as completed in #2268 Jan 13, 2023
tig added a commit that referenced this issue Jan 13, 2023
Fixes #2267. Toplevel.EnsureVisibleBounds throws an exception if border is null.
BDisp added a commit to BDisp/Terminal.Gui that referenced this issue Jan 18, 2023
tig added a commit that referenced this issue Feb 25, 2023
* Changed ansi esc sequence used on exit.

* Changed ansi esc sequence used on exit.

* Improves HeightAsBuffer although currently only works on Windows.

* Fixes #2267. Toplevel.EnsureVisibleBounds throws an exception if border is null.

* Changing comment as requested.

* Fixes indentation.

* Seems not needed for now, maybe some update, comment for now.

* Renamed HeightAsBuffer to EnableConsoleScrolling and made it obsolete.

* Add comment on remarks for EnableConsoleScrolling.

* merged @BDisp's EnableConsoleScrolling PR

* Fixes buffer for Windows Terminal.

* Fixes issue in Windows Terminal on resizing causing some lines not be drawing after exceptions.

* merge #9

* merged #9

* use ESC [ ? 1047

* Tweaks with new esc codes

* Fixed curses driver to not nuke scroll buffer and to resize properly

* merge

* Cleand up netdriver escape codes

* fixed spaces->tabs

* fixed spaces->tabs

* fixed spaces->tabs

* fixed spaces->tabs

* fixed merge issue and  spaces->tabs

* fixed spaces->tabs

* fixed spaces->tabs

* fixed spaces->tabs

* fixed  build error

* removed old comments

* Resolving merge conflicts.

* Ensuring reset the EnableConsoleScrolling.

* Changing from HeightAsBuffer to EnableConsoleScrolling.

* Done requested changes.

* Reformatting.

* Rename to EscSeqReqStatus.

* Removing Console.Out.Flush ();

---------

Co-authored-by: Charlie Kindel <tig@users.noreply.github.com>
Co-authored-by: Tig Kindel <tig@kindel.com>
tznind pushed a commit to tznind/gui.cs that referenced this issue May 7, 2023
…2375)

* Changed ansi esc sequence used on exit.

* Changed ansi esc sequence used on exit.

* Improves HeightAsBuffer although currently only works on Windows.

* Fixes gui-cs#2267. Toplevel.EnsureVisibleBounds throws an exception if border is null.

* Changing comment as requested.

* Fixes indentation.

* Seems not needed for now, maybe some update, comment for now.

* Renamed HeightAsBuffer to EnableConsoleScrolling and made it obsolete.

* Add comment on remarks for EnableConsoleScrolling.

* merged @BDisp's EnableConsoleScrolling PR

* Fixes buffer for Windows Terminal.

* Fixes issue in Windows Terminal on resizing causing some lines not be drawing after exceptions.

* merge #9

* merged #9

* use ESC [ ? 1047

* Tweaks with new esc codes

* Fixed curses driver to not nuke scroll buffer and to resize properly

* merge

* Cleand up netdriver escape codes

* fixed spaces->tabs

* fixed spaces->tabs

* fixed spaces->tabs

* fixed spaces->tabs

* fixed merge issue and  spaces->tabs

* fixed spaces->tabs

* fixed spaces->tabs

* fixed spaces->tabs

* fixed  build error

* removed old comments

* Resolving merge conflicts.

* Ensuring reset the EnableConsoleScrolling.

* Changing from HeightAsBuffer to EnableConsoleScrolling.

* Done requested changes.

* Reformatting.

* Rename to EscSeqReqStatus.

* Removing Console.Out.Flush ();

---------

Co-authored-by: Charlie Kindel <tig@users.noreply.github.com>
Co-authored-by: Tig Kindel <tig@kindel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants