}
else if (!wcscmp(szValueName, L"WindowPosition"))
{
- TermInfo->AutoPosition = FALSE;
+ TermInfo->AutoPosition = FALSE;
TermInfo->WindowOrigin.x = LOWORD(Value);
TermInfo->WindowOrigin.y = HIWORD(Value);
RetVal = TRUE;
GuiInfo->FontWeight = GuiData->GuiInfo.FontWeight;
GuiInfo->UseRasterFonts = GuiData->GuiInfo.UseRasterFonts;
GuiInfo->FullScreen = GuiData->GuiInfo.FullScreen;
- /// GuiInfo->WindowPosition = GuiData->GuiInfo.WindowPosition;
GuiInfo->AutoPosition = GuiData->GuiInfo.AutoPosition;
GuiInfo->WindowOrigin = GuiData->GuiInfo.WindowOrigin;
/* Offsetize */
Console->Selection.srSelection.Right,
Console->Selection.srSelection.Bottom);
+#ifdef IS_WHITESPACE
+#undef IS_WHITESPACE
+#endif
+#define IS_WHITESPACE(c) ((c) == L'\0' || (c) == L' ' || (c) == L'\t')
+
/* Basic size for one line... */
size = selWidth;
/* ... and for the other lines, add newline characters if needed. */
for (yPos = 0; yPos < selHeight; yPos++)
{
+ ULONG length = selWidth;
+
ptr = ConioCoordToPointer(Buffer,
Console->Selection.srSelection.Left,
Console->Selection.srSelection.Top + yPos);
+
+ /* Trim whitespace from the right */
+ while (length > 0)
+ {
+ if (IS_WHITESPACE(ptr[length-1].Char.UnicodeChar))
+ --length;
+ else
+ break;
+ }
+
/* Copy only the characters, leave attributes alone */
- for (xPos = 0; xPos < selWidth; xPos++)
+ for (xPos = 0; xPos < length; xPos++)
{
/*
* Sometimes, applications can put NULL chars into the screen-buffer
* (this behaviour is allowed). Detect this and replace by a space.
- * FIXME - HACK: Improve the way we're doing that (i.e., put spaces
- * instead of NULLs (or even, nothing) only if it exists a non-null
- * char *after* those NULLs, before the end-of-line of the selection.
- * Do the same concerning spaces -- i.e. trailing spaces --).
*/
dstPos[xPos] = (ptr[xPos].Char.UnicodeChar ? ptr[xPos].Char.UnicodeChar : L' ');
}
- dstPos += selWidth;
+ dstPos += length;
/* Add newline characters if we are not in inline-text copy mode */
if (!InlineCopyMode)