Merge pull request #91 from Melix19/remove_horizontal_scrollbar
Remove AlwaysHorizontalScrollbar flag to BeginChild
diff --git a/TextEditor.cpp b/TextEditor.cpp
index 9153bc1..8901f07 100644
--- a/TextEditor.cpp
+++ b/TextEditor.cpp
@@ -104,7 +104,9 @@
{
istart = 0;
++lstart;
- result += '\n';
+
+ if (lstart < lend)
+ result += '\n';
}
}
@@ -716,6 +718,8 @@
Undo();
else if (!IsReadOnly() && ctrl && !shift && !alt && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Y)))
Redo();
+ else if (!IsReadOnly() && ctrl && shift && !alt && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Z)))
+ Redo();
else if (!ctrl && !alt && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_UpArrow)))
MoveUp(1, shift);
else if (!ctrl && !alt && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_DownArrow)))
@@ -1870,7 +1874,11 @@
u.mRemovedStart = u.mRemovedEnd = GetActualCursorCoordinates();
--u.mRemovedStart.mColumn;
- --mState.mCursorPosition.mColumn;
+
+ if (line[cindex].mChar == '\t')
+ mState.mCursorPosition.mColumn -= mTabSize;
+ else
+ --mState.mCursorPosition.mColumn;
while (cindex < line.size() && cend-- > cindex)
{