From 9905267e4deedda4fc4e15458a2f6cbfeb391dfc Mon Sep 17 00:00:00 2001 From: nightwing Date: Tue, 24 Feb 2015 21:02:52 +0400 Subject: [PATCH] fix gutter in static highlight when wrapping is enabled --- demo/static-highlighter.html | 26 +++++++++++++++++++++++--- lib/ace/ext/static.css | 10 ++++++---- lib/ace/ext/static_highlight.js | 3 ++- lib/ace/ext/static_highlight_test.js | 8 ++++---- lib/ace/layer/text.js | 14 +++++++------- lib/ace/layer/text_test.js | 2 +- 6 files changed, 43 insertions(+), 20 deletions(-) diff --git a/demo/static-highlighter.html b/demo/static-highlighter.html index 39546541..eaf0dd53 100644 --- a/demo/static-highlighter.html +++ b/demo/static-highlighter.html @@ -2,13 +2,13 @@ - Static Code highlighter using Ace - + Static Code highlighter using Ace + @@ -35,6 +35,26 @@ function wobble (flam) { + +
+--[[-- +num_args takes in 5.1 byte code and extracts the number of arguments from its function header. +--]]-- + +function int(t) + return t:byte(1) + t:byte(2) * 0x100 + t:byte(3) * 0x10000 + t:byte(4) * 0x1000000 +end + +function num_args(func) + local dump = string.dump(func) + local offset, cursor = int(dump:sub(13)), offset + 26 + --Get the params and var flag (whether there's a ... in the param) + return dump:sub(cursor):byte(), dump:sub(cursor+1):byte() +end + +
+ +