From ad79afc01bebd1a16f30f8c08b873ff52224bd19 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Fri, 18 Nov 2016 23:15:36 +0100 Subject: 2016-11-18 22:26:00 --- context/data/scite/context/scite-ctx.lua | 46 +++++++++++++++++---- doc/context/documents/general/qrcs/setup-cs.pdf | Bin 831068 -> 831067 bytes doc/context/documents/general/qrcs/setup-de.pdf | Bin 830428 -> 830431 bytes doc/context/documents/general/qrcs/setup-en.pdf | Bin 835952 -> 835956 bytes doc/context/documents/general/qrcs/setup-fr.pdf | Bin 828483 -> 828475 bytes doc/context/documents/general/qrcs/setup-it.pdf | Bin 830381 -> 830371 bytes doc/context/documents/general/qrcs/setup-nl.pdf | Bin 827405 -> 827400 bytes doc/context/documents/general/qrcs/setup-ro.pdf | Bin 826925 -> 826913 bytes tex/context/base/mkii/cont-new.mkii | 2 +- tex/context/base/mkii/context.mkii | 2 +- tex/context/base/mkiv/cont-new.mkiv | 2 +- tex/context/base/mkiv/context.mkiv | 2 +- tex/context/base/mkiv/font-pre.mkiv | 11 ++++- tex/context/base/mkiv/math-ini.mkiv | 6 +-- tex/context/base/mkiv/node-ref.lua | 2 +- tex/context/base/mkiv/status-files.pdf | Bin 25644 -> 25651 bytes tex/context/base/mkiv/status-lua.pdf | Bin 368477 -> 368477 bytes tex/context/base/mkiv/strc-lst.mkvi | 2 + tex/context/base/mkiv/strc-not.mkvi | 2 +- tex/context/interface/mkiv/i-context.pdf | Bin 835952 -> 835956 bytes tex/context/interface/mkiv/i-readme.pdf | Bin 60767 -> 60766 bytes tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 22 files changed, 61 insertions(+), 18 deletions(-) diff --git a/context/data/scite/context/scite-ctx.lua b/context/data/scite/context/scite-ctx.lua index 73ccc2b3f..d9e42a82f 100644 --- a/context/data/scite/context/scite-ctx.lua +++ b/context/data/scite/context/scite-ctx.lua @@ -72,7 +72,7 @@ props = props or { } -- setmetatable(props,{ __index = function(k,v) props[k] = "unknown" return "unknown" end } ) -local byte, lower, upper, gsub, sub, find, rep, match, gmatch, format = string.byte, string.lower, string.upper, string.gsub, string.sub, string.find, string.rep, string.match, string.gmatch, string.format +local byte, lower, upper, gsub, sub, find, rep, match, gmatch, format, char = string.byte, string.lower, string.upper, string.gsub, string.sub, string.find, string.rep, string.match, string.gmatch, string.format, string.char local sort, concat = table.sort, table.concat local crlf = "\n" @@ -262,6 +262,30 @@ end local magicstring = rep("", 2) +local l2 = char(0xC0) +local l3 = char(0xE0) +local l4 = char(0xF0) + +local function utflen(str) + local n = 0 + local l = 0 + for s in gmatch(str,".") do + if l > 0 then + l = l - 1 + else + n = n + 1 + if s >= l4 then + l = 3 + elseif s >= l3 then + l = 2 + elseif s >= l2 then + l = 1 + end + end + end + return n +end + function wrap_text() -- We always go to the end of a line, so in fact some of @@ -295,6 +319,7 @@ function wrap_text() local replacement = { } local templine = '' + local tempsize = 0 local indentation = rep(' ',startcolumn) local selection = editor:GetSelText() @@ -307,13 +332,20 @@ function wrap_text() replacement[#replacement+1] = templine replacement[#replacement+1] = "" templine = '' - elseif #templine + #snippet > length then - replacement[#replacement+1] = templine - templine = indentation .. snippet - elseif #templine == 0 then - templine = indentation .. snippet + tempsize = 0 else - templine = templine .. ' ' .. snippet + local snipsize = utflen(snippet) + if tempsize + snipsize > length then + replacement[#replacement+1] = templine + templine = indentation .. snippet + tempsize = startcolumn + snipsize + elseif tempsize == 0 then + templine = indentation .. snippet + tempsize = tempsize + startcolumn + snipsize + else + templine = templine .. ' ' .. snippet + tempsize = tempsize + 1 + snipsize + end end end diff --git a/doc/context/documents/general/qrcs/setup-cs.pdf b/doc/context/documents/general/qrcs/setup-cs.pdf index 3aa1c50e5..d00d4b211 100644 Binary files a/doc/context/documents/general/qrcs/setup-cs.pdf and b/doc/context/documents/general/qrcs/setup-cs.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-de.pdf b/doc/context/documents/general/qrcs/setup-de.pdf index fe7792c63..7d2ae1989 100644 Binary files a/doc/context/documents/general/qrcs/setup-de.pdf and b/doc/context/documents/general/qrcs/setup-de.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-en.pdf b/doc/context/documents/general/qrcs/setup-en.pdf index 4d982bbe8..ba645e318 100644 Binary files a/doc/context/documents/general/qrcs/setup-en.pdf and b/doc/context/documents/general/qrcs/setup-en.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-fr.pdf b/doc/context/documents/general/qrcs/setup-fr.pdf index 0a15af9ea..2d430bd19 100644 Binary files a/doc/context/documents/general/qrcs/setup-fr.pdf and b/doc/context/documents/general/qrcs/setup-fr.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-it.pdf b/doc/context/documents/general/qrcs/setup-it.pdf index e2cbfea14..d5fd76018 100644 Binary files a/doc/context/documents/general/qrcs/setup-it.pdf and b/doc/context/documents/general/qrcs/setup-it.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-nl.pdf b/doc/context/documents/general/qrcs/setup-nl.pdf index 19055aac0..97e1ba49d 100644 Binary files a/doc/context/documents/general/qrcs/setup-nl.pdf and b/doc/context/documents/general/qrcs/setup-nl.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-ro.pdf b/doc/context/documents/general/qrcs/setup-ro.pdf index 5e178b6cc..084e77c05 100644 Binary files a/doc/context/documents/general/qrcs/setup-ro.pdf and b/doc/context/documents/general/qrcs/setup-ro.pdf differ diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index c72cea29a..0d8872594 100644 --- a/tex/context/base/mkii/cont-new.mkii +++ b/tex/context/base/mkii/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2016.11.17 14:19} +\newcontextversion{2016.11.18 22:20} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii index 08a53e31f..ac560b607 100644 --- a/tex/context/base/mkii/context.mkii +++ b/tex/context/base/mkii/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2016.11.17 14:19} +\edef\contextversion{2016.11.18 22:20} %D For those who want to use this: diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index ef43de58e..7a5ca1f7b 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2016.11.17 14:19} +\newcontextversion{2016.11.18 22:20} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index 86d730f92..57f84ee79 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -39,7 +39,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2016.11.17 14:19} +\edef\contextversion{2016.11.18 22:20} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/mkiv/font-pre.mkiv b/tex/context/base/mkiv/font-pre.mkiv index d3a4d5584..6dfc6d3d3 100644 --- a/tex/context/base/mkiv/font-pre.mkiv +++ b/tex/context/base/mkiv/font-pre.mkiv @@ -706,7 +706,8 @@ \definefont[infofont] [file:dejavusansmono at 6pt] % todo \the\everybodyfont \definefont[infofontbold][file:dejavusansmono-bold at 6pt] % todo \the\everybodyfont -%D Optimization (later we overload in math): +%D Optimization (later we overload in math). Also needed in order to get \type {\ss} +%D properly defined. \unexpanded\def\normaltf{\let\fontalternative\s!tf\font_helpers_synchronize_font} \unexpanded\def\normalbf{\let\fontalternative\s!bf\font_helpers_synchronize_font} @@ -722,6 +723,14 @@ \let\bi\normalbi \let\bs\normalbs +\unexpanded\def\normalrm{\font_helpers_set_current_font_style{\s!rm}} +\unexpanded\def\normalss{\font_helpers_set_current_font_style{\s!ss}} +\unexpanded\def\normaltt{\font_helpers_set_current_font_style{\s!tt}} + +\let\rm\normalrm +\let\ss\normalss +\let\tt\normaltt + \protect \endinput % LM math vs CM math (analysis by Taco): diff --git a/tex/context/base/mkiv/math-ini.mkiv b/tex/context/base/mkiv/math-ini.mkiv index d1a339e82..cf8dbf625 100644 --- a/tex/context/base/mkiv/math-ini.mkiv +++ b/tex/context/base/mkiv/math-ini.mkiv @@ -460,9 +460,9 @@ \ifdefined\normalbi\else\let\normalbi\bi\fi \unexpanded\def\bi{\ifmmode\mathbi\else\normalbi\fi} \ifdefined\normalbs\else\let\normalbs\bs\fi \unexpanded\def\bs{\ifmmode\mathbs\else\normalbs\fi} -\let\normalrm\rm \unexpanded\def\rm{\ifmmode\mathrm\else\normalrm\fi} -\let\normalss\ss \unexpanded\def\ss{\ifmmode\mathss\else\normalss\fi} -\let\normaltt\tt \unexpanded\def\tt{\ifmmode\mathtt\else\normaltt\fi} +\unexpanded\def\rm{\ifmmode\mathrm\else\normalrm\fi} +\unexpanded\def\ss{\ifmmode\mathss\else\normalss\fi} +\unexpanded\def\tt{\ifmmode\mathtt\else\normaltt\fi} \ifdefined\mr \else \let\mr\relax \fi \ifdefined\mb \else \let\mb\relax \fi diff --git a/tex/context/base/mkiv/node-ref.lua b/tex/context/base/mkiv/node-ref.lua index d709eb811..7520b18ae 100644 --- a/tex/context/base/mkiv/node-ref.lua +++ b/tex/context/base/mkiv/node-ref.lua @@ -625,7 +625,7 @@ local function makereference(width,height,depth,reference) -- height and depth a nofreferences = nofreferences + 1 local result, current, texts if show_references then - local d = sr[1] + local d = resolved if d then local r = d.reference local p = d.prefix diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf index 6e8fc1812..c5314a03a 100644 Binary files a/tex/context/base/mkiv/status-files.pdf and b/tex/context/base/mkiv/status-files.pdf differ diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf index c2a03b263..e97bc9c18 100644 Binary files a/tex/context/base/mkiv/status-lua.pdf and b/tex/context/base/mkiv/status-lua.pdf differ diff --git a/tex/context/base/mkiv/strc-lst.mkvi b/tex/context/base/mkiv/strc-lst.mkvi index 5c2bd74e5..4309ae93a 100644 --- a/tex/context/base/mkiv/strc-lst.mkvi +++ b/tex/context/base/mkiv/strc-lst.mkvi @@ -271,6 +271,7 @@ \def\strc_lists_place_indeed#tag#list#settings% {\begingroup + \the\t_lists_every_renderingcleanup % \let\currentlistentrylocation\empty \edef\currentlist{#tag}% \setupcurrentlist[#settings]% \the\everystructurelist @@ -527,6 +528,7 @@ \unexpanded\def\strclistsentryprocess#tag#method#index#extra% This one is called at the lua end! {\clf_pushlist#index\relax + %\let\currentlistentrylocation\empty \edef\currentlist {#tag}% \edef\currentlistmethod{#method}% \edef\currentlistindex {#index}% diff --git a/tex/context/base/mkiv/strc-not.mkvi b/tex/context/base/mkiv/strc-not.mkvi index 81d534937..e1c445ab6 100644 --- a/tex/context/base/mkiv/strc-not.mkvi +++ b/tex/context/base/mkiv/strc-not.mkvi @@ -1063,7 +1063,7 @@ \placenoterule \noteparameter\c!after}% \expandafter\endgroup\expandafter - \s_strc_notes_distance\the\ht\scratchbox\relax} + \s_strc_notes_distance\the\htdp\scratchbox\relax} % also dp now \def\strc_notes_set_columns {\c_strc_notes_columns\noteparameter\c!n\relax diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf index 4d982bbe8..ba645e318 100644 Binary files a/tex/context/interface/mkiv/i-context.pdf and b/tex/context/interface/mkiv/i-context.pdf differ diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf index d17b063bb..cc1285fb9 100644 Binary files a/tex/context/interface/mkiv/i-readme.pdf and b/tex/context/interface/mkiv/i-readme.pdf differ diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index b4f4937bb..18ed3da02 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 11/17/16 14:19:30 +-- merge date : 11/18/16 22:20:13 do -- begin closure to overcome local limits and interference -- cgit v1.2.3