Re: [code] [textadept] Failed language detection when shebang contains `env`?

From: Mitchell <m.att.foicica.com>
Date: Wed, 13 May 2015 08:39:21 -0400 (EDT)

Hi William,

On Tue, 12 May 2015, William Woodruff wrote:

> Hi all,
>
> I've just started using textadept, and I've noticed that it fails to
> detect some scripting languages
> when the shebang line uses `env` instead of a flat path. For example:
>
> #!/usr/bin/env bash
>
> does not trigger bash's syntax highlighting, while:
>
> #!/bin/bash
>
> does.
>
> I think I've traced this down to modules/textadept/file_types.lua,
> line 33, which uses this regex:
>
>
> '^#!.+/bash'
>
> among others to determine language via shebang. If I'm reading this
> correctly, the problem is with
> the '/' right before bash, and can be corrected simply by removing it.
>
> I don't have any formal experience with Lua and less than 3 hours of
> experience with textadept,
> so I would greatly appreciate a confirmation of this behavior on
> anybody else's system before
> I submit a patch.

You are correct. That will fix the problem. I'll commit a fix; no need for
a patch. This will be fixed in the next nightly.

Thanks for the report!

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 Wed 13 May 2015 - 08:39:21 EDT

This archive was generated by hypermail 2.2.0 : Thu 14 May 2015 - 06:26:54 EDT