Commits

Robert Gieseke  committed 987e79e

Update with Textadept 7 beta 4 API changes

  • Participants
  • Parent commits 593ca1e

Comments (0)

Files changed (1)

File quicknav.lua

 
 ]]
 
-_M.textredux = require 'textredux'
+local textredux = require 'textredux'
 
 local M = {}
 
 local function set_buffer_properties(buffer)
   -- setup margins for explore buffer
   -- right aligned text margin is used to display line numbers
-  buffer.margin_type_n[0] = buffer.SC_MARGIN_RTEXT
+  buffer.margin_type_n[0] = buffer.MARGIN_RTEXT
   lno_width =  buffer:text_width(0, 'H') * (('' .. buffer.data['source_properties'].line_count):len())
 end
 
   local fold_level = buffer.fold_level[lno]
   -- fold_level is an int combined with a bit mask
 
-  local level = bit32.band(fold_level - buffer.SC_FOLDLEVELBASE, buffer.SC_FOLDLEVELNUMBERMASK)
-  local header = bit32.band(fold_level, buffer.SC_FOLDLEVELHEADERFLAG) ==  buffer.SC_FOLDLEVELHEADERFLAG
+  local level = bit32.band(fold_level - buffer.FOLDLEVELBASE, buffer.FOLDLEVELNUMBERMASK)
+  local header = bit32.band(fold_level, buffer.FOLDLEVELHEADERFLAG) ==  buffer.FOLDLEVELHEADERFLAG
   return header, level
 end
 
 
   -- build search flags
   local search_flags = 0
-  if opts.regex then search_flags = bit32.bor(search_flags, buffer.SCFIND_REGEXP) end
-  if opts.strictcase then search_flags = bit32.bor(search_flags, buffer.SCFIND_MATCHCASE) end
-  if opts.token or opts.defn then search_flags = bit32.bor(search_flags, buffer.SCFIND_WORDSTART) end
+  if opts.regex then search_flags = bit32.bor(search_flags, buffer.FIND_REGEXP) end
+  if opts.strictcase then search_flags = bit32.bor(search_flags, buffer.FIND_MATCHCASE) end
+  if opts.token or opts.defn then search_flags = bit32.bor(search_flags, buffer.FIND_WORDSTART) end
 
   -- clear results
   hide_result_lines(buffer)
   save_buffer_margins(_G.buffer, source_properties)
 
   -- the explore buffer accepts user input and previews search results
-  local explore_buffer = _M.textredux.core.buffer.new('Find: '..source_properties.filename)
+  local explore_buffer = textredux.core.buffer.new('Find: '..source_properties.filename)
   explore_buffer:show()
 
   -- setup indicator to hightlight matches