Skip to content

Commit

Permalink
Revert two cursor changes that cause crashing and rendering art… (#3292)
Browse files Browse the repository at this point in the history
Revert "Fix cursor redrawing crash (#2965)"
This reverts commit 926a2e3.

Revert "Fix double width cursor for CJK characters (#2932)"
This reverts commit eafa884.

Fixes #3277.
Fully reverts #2965, #2932.
  • Loading branch information
DHowett authored and miniksa committed Oct 22, 2019
1 parent 06f2706 commit d6790c0
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 23 deletions.
19 changes: 0 additions & 19 deletions src/cascadia/TerminalCore/Terminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,6 @@ void Terminal::UpdateSettings(winrt::Microsoft::Terminal::Settings::ICoreSetting
proposedTop -= (proposedBottom - bufferSize.Y);
}

Cursor& cursor = _buffer->GetCursor();
auto cursorPosition = cursor.GetPosition();

// If the cursor is positioned beyond the range of the viewport, then
// set the cursor position to a legal value.
cursorPosition.X = std::min(cursorPosition.X, static_cast<SHORT>(viewportSize.X - 1));
cursorPosition.Y = std::min(cursorPosition.Y, static_cast<SHORT>(viewportSize.Y - 1));

cursor.StartDeferDrawing();
cursor.SetPosition(cursorPosition);
cursor.EndDeferDrawing();

_mutableViewport = Viewport::FromDimensions({ 0, proposedTop }, viewportSize);
_scrollOffset = 0;
_NotifyScrollEvent();
Expand Down Expand Up @@ -437,11 +425,6 @@ void Terminal::_WriteBuffer(const std::wstring_view& stringView)
}
}

if (proposedCursorPosition.X > bufferSize.RightInclusive())
{
proposedCursorPosition.X = 0;
}

// If we're about to scroll past the bottom of the buffer, instead cycle the buffer.
const auto newRows = proposedCursorPosition.Y - bufferSize.Height() + 1;
if (newRows > 0)
Expand Down Expand Up @@ -550,8 +533,6 @@ void Terminal::_InitializeColorTable()
// - isVisible: whether the cursor should be visible
void Terminal::SetCursorVisible(const bool isVisible) noexcept
{
auto lock = LockForWriting();

auto& cursor = _buffer->GetCursor();
cursor.SetIsVisible(isVisible);
}
Expand Down
1 change: 0 additions & 1 deletion src/cascadia/TerminalCore/Terminal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "../../terminal/input/terminalInput.hpp"

#include "../../types/inc/Viewport.hpp"
#include "../../types/inc/GlyphWidth.hpp"
#include "../../types/IUiaData.h"
#include "../../cascadia/terminalcore/ITerminalApi.hpp"
#include "../../cascadia/terminalcore/ITerminalInput.hpp"
Expand Down
4 changes: 1 addition & 3 deletions src/cascadia/TerminalCore/terminalrenderdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ COLORREF Terminal::GetCursorColor() const noexcept

bool Terminal::IsCursorDoubleWidth() const noexcept
{
const auto position = _buffer->GetCursor().GetPosition();
TextBufferTextIterator it(TextBufferCellIterator(*_buffer, position));
return IsGlyphFullWidth(*it);
return false;
}

const std::vector<RenderOverlay> Terminal::GetOverlays() const noexcept
Expand Down

0 comments on commit d6790c0

Please sign in to comment.