Update Note_Write_Helper.xml

Contrast_Picker
Arcidayne 9 years ago
parent bd92a1bae1
commit 0ec71d40d1

@ -81,22 +81,29 @@ function note_wrap(str, limit, indent, indent1)
indent1 = indent1 or indent indent1 = indent1 or indent
limit = limit or 79 limit = limit or 79
local here = 1-#indent1 local here = 1-#indent1
local last_color = ''
return indent1..str:gsub("(%s+)()(%S+)()", return indent1..str:gsub("(%s+)()(%S+)()",
function(sp, st, word, fi) function(sp, st, word, fi)
local delta = 0 local delta = 0
word:gsub('@([@%a])', local color_before_current_word = last_color
function(c) word:gsub('()@([@%a])',
if c == '@' then delta = delta + 1 function(pos, c)
elseif c == 'x' then delta = delta + 5 if c == '@' then
else delta = delta + 2 delta = delta + 1
end elseif c == 'x' then
end) delta = delta + 5
here = here + delta last_color = word:sub(pos, pos+4)
if fi-here > limit then else
here = st - #indent + delta delta = delta + 2
return "\n"..indent..word last_color = word:sub(pos, pos+1)
end end
end) end)
here = here + delta
if fi-here > limit then
here = st - #indent + delta
return "\n"..indent..color_before_current_word..word
end
end)
end end
]]> ]]>
</script> </script>

Loading…
Cancel
Save