Skip to content

Commit

Permalink
Fix crash when removing ghost lines. I hope this fixes the issue #80
Browse files Browse the repository at this point in the history
…(GitHub)
  • Loading branch information
sdottaka committed Apr 15, 2018
1 parent 402f452 commit 3bade75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Externals/crystaledit/editlib/LineInfo.cpp
Expand Up @@ -216,7 +216,8 @@ void LineInfo::Delete(size_t nStartChar, size_t nEndChar)
sizeof (TCHAR) * (FullLength() - nEndChar));
}
m_nLength -= (nEndChar - nStartChar);
m_pcLine[FullLength()] = '\0';
if (m_pcLine)
m_pcLine[FullLength()] = '\0';
}

/**
Expand Down
6 changes: 5 additions & 1 deletion Src/GhostTextBuffer.cpp
Expand Up @@ -412,8 +412,12 @@ DeleteText2 (CCrystalTextView * pSource, int nStartLine, int nStartChar,
{
return false;
}
InternalDeleteGhostLine(pSource, nEndLine2 + 1, nEndLine - (nEndLine2 + 1) + 1);
}
else
{
InternalDeleteGhostLine(pSource, nEndLine2 + 1, nEndLine - (nEndLine2 + 1));
}
InternalDeleteGhostLine(pSource, nEndLine2 + 1, nEndLine - (nEndLine2 + 1) + 1);
}

if (nStartChar != 0 || nEndChar != 0)
Expand Down

0 comments on commit 3bade75

Please sign in to comment.