From 5f4fbc763a90a38508a0a7d4f4ae7a2262ecbd39 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 25 Apr 2018 22:52:33 -0400 Subject: Removed LuaJIT version of Textadept. Also updated to Lua 5.3 syntax where held back by LuaJIT's 5.1/5.2 syntax. --- modules/textadept/editing.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'modules/textadept/editing.lua') diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index b66df48f..26f53449 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -147,7 +147,7 @@ end) -- Highlights matching braces. events.connect(events.UPDATE_UI, function(updated) - if updated and bit32.band(updated, 3) == 0 then return end -- ignore scrolling + if updated and updated & 3 == 0 then return end -- ignore scrolling if M.brace_matches[buffer.char_at[buffer.current_pos]] then local match = buffer:brace_match(buffer.current_pos, 0) if match ~= -1 then @@ -268,8 +268,8 @@ function M.paste() end local indentation = buffer:text_range(buffer:position_from_line(i), buffer.line_indent_position[i]) - local fold_header = i ~= line and bit32.band(buffer.fold_level[i], - buffer.FOLDLEVELHEADERFLAG) > 0 + local fold_header = i ~= line and + buffer.fold_level[i] & buffer.FOLDLEVELHEADERFLAG > 0 if fold_header then indentation = indentation..(buffer.use_tabs and '\t' or string.rep(' ', buffer.tab_width)) @@ -512,8 +512,7 @@ function M.convert_indentation() local e = buffer.line_indent_position[line] local current_indentation, new_indentation = buffer:text_range(s, e), nil if buffer.use_tabs then - -- Need integer division and LuaJIT does not have // operator. - local tabs = math.floor(indent / buffer.tab_width) + local tabs = indent // buffer.tab_width local spaces = math.fmod(indent, buffer.tab_width) new_indentation = string.rep('\t', tabs)..string.rep(' ', spaces) else -- cgit v1.2.3