XAlign icon indicating copy to clipboard operation
XAlign copied to clipboard

Aligned text block introduces extra newlines.

Open DominikDeak opened this issue 10 years ago • 3 comments

When I apply the align command on the following block:

  const API::Resource::Key Version = API::Resource::Key::Generate("Core::Version");
  const API::Resource::Key ProductName = API::Resource::Key::Generate("Core::ProductName");
  const API::Resource::Key AuthorName = API::Resource::Key::Generate("Core::AuthorName");
  const API::Resource::Key OrganisationName = API::Resource::Key::Generate("Core::OrganisationName");

The resulting aligned block will have extra newlines inserted:

  const API::Resource::Key Version          = API::Resource::Key::Generate("Core::Version");

  const API::Resource::Key ProductName      = API::Resource::Key::Generate("Core::ProductName");

  const API::Resource::Key AuthorName       = API::Resource::Key::Generate("Core::AuthorName");

  const API::Resource::Key OrganisationName = API::Resource::Key::Generate("Core::OrganisationName");

The source file in question is in UTF-8 format, with Windows (CRLF) encoding.

DominikDeak avatar Sep 09 '14 12:09 DominikDeak

Maybe this line is too long ?
const API::Resource::Key OrganisationName = API::Resource::Key::Generate("Core::OrganisationName");

The following may help: Cancel the line-wrapping in Preferences -> Text Editing -> Indentation -> Line wrapping, then try again.

qfish avatar Sep 10 '14 16:09 qfish

i've got the same issue.... canceling line-wrap did not help i even get some extra lines when aligning short code lines

this defines:

#define make_int2 (int2)
#define make_float4 (float4)
#define make_float2 (float2)
#define make_ushort4 (ushort4)
#define make_float3 (float3)
#define make_ushort3 (ushort3)

become:

#define make_int2    (int2)

#define make_float4  (float4)

#define make_float2  (float2)

#define make_ushort4 (ushort4)

#define make_float3  (float3)

#define make_ushort3 (ushort3)

jstuth avatar Oct 30 '14 12:10 jstuth

This is still an ongoing problem in the latest version.

Test file: https://www.dropbox.com/s/bbnnv3t54e25b77/test.zip?dl=0

DominikDeak avatar Jul 06 '15 08:07 DominikDeak