Jump to content

line break bug in Urwigo Builder 1.14.4469.18959


Krolock

Recommended Posts

If you define a line break in lua like

local nr = 1
local message = "Row ".. nr ..[[
Row ]] .. (nr+1)

in an external lua file and build the project, the resulting _cartrigde.lua contains the following code:

local nr = 1
local message = "Row ".. nr ..[[Row ]] .. (nr+1)

The line break only disappears if no charactor or only whitespace are written behind the square brackets "[["

 

If you define code like

local nr = 1
local message = "Row ".. nr ..[[ Bla
Row ]] .. (nr+1)

the line break won't disappear

 

It does not matter if you write the code in an external file or in urwigo directly. If you activate the "Inline lua 'require'" checkbox, the line break will disappear.

 

see the given example as attachement

 

Krolock

LineBreakTest.zip

Link to comment

While searching for informations to "line breaks", I found this unanswered question.

 

It is correct behavior. The Lua definition says

 

For convenience, when the opening long bracket is immediately followed by a newline, the newline is not included in the string.

You could find this in the Lua 5.1 manual in section 2.1 - "Lexical Conventions".

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...