[code] More on snippets... Am I doing something wrong or just hit the limits?

From: Pedro Andres Aranda Gutierrez <paaguti.att.gmail.com>
Date: Tue, 19 Sep 2017 18:07:42 +0200

Hi Mitchell

I'm trying to move longer language-specific snippets to files and place
them unter ~/.textadept/snippets/<lexer>/

To load them I'm using the following code

events.connect(events.LEXER_LOADED, function(lexer)
  local _lexer_snippets = _USERHOME..'/snippets/'..lexer
  if lfs.attributes(_lexer_snippets) then
    local load_snippets = true
    for _, _val in pairs(textadept.snippets._paths) do
      if _val == _lexer_snippets then load_snippets = false end
    end
    if load_snippets then
      table.insert(textadept.snippets._paths,_lexer_snippets)
    end
  end
... (more code)

That's how I have understood the documentation. This results however in all
language snippets files being available to all lexers and not each fileset
to its lexer.

Is that an anti-feature or am I not understanding the docs ?

Best, /PA

-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellet zu werden
Georg Kreisler
-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Tue 19 Sep 2017 - 12:07:42 EDT

This archive was generated by hypermail 2.2.0 : Wed 20 Sep 2017 - 06:52:56 EDT