Re: [code] [textadept] associate file extension to lexer

From: Mitchell <m.att.foicica.com>
Date: Thu, 24 Dec 2015 09:21:31 -0500 (EST)

Hi Thorsten,

On Thu, 24 Dec 2015, Thorsten Kampe wrote:

> Hi,
>
> how can I associate a file extension to a lexer?
> http://foicica.com/textadept/manual.html#Preferences suggests..
>
> ```
> -- Recognize .luadoc files as Lua code.
> textadept.file_types.extensions.luadoc = 'lua'
> ```
>
> Unfortunately that does not work with an extension like `.local`:
>
> [string "textadept.file_types.extensions.local = 'lua'..."]:1: <name>
> expected near 'local'

'local' is a reserved word in Lua. You'll have to use the [] syntax:

    textadept.file_types.extensions['local'] = ...

Cheers,
Mitchell

-- 
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 Thu 24 Dec 2015 - 09:21:31 EST

This archive was generated by hypermail 2.2.0 : Fri 25 Dec 2015 - 06:31:00 EST