Re: More intelligent quote insertion

From: Vais Salikhov <>
Date: Sat, 9 May 2009 00:00:47 -0400


There is a char_added handler in modules/textadept/editing.lua that
implements the functionality you are looking to enhance. More
intelligent quote insertion would be nice ; )

You may also want to delete the automatically added matching character
if the character that triggered it's insertion is deleted, i.e. the
character was typed by mistake.

Another enhancement a-la Textmate would be to implement skipping over
the inserted character if it is typed in explicitly instead of ending
up with two quotes - one automatically inserted and another manually
inserted. Good luck, happy hacking!


On May 8, 2009, at 11:24 PM, Justin <> wrote:

> Would it be possible to do more intelligent quote insertion? The
> current situation: whenever I enter a single quote or double quote,
> another one is automatically inserted, and my caret is advanced one
> character so that I can enter a string. That's awesome for new
> strings. But what about for strings that are already opened? Say for
> example I type "this is a string" and I delete the last double quote.
> When I go to close that string again, it will insert two double quotes
> instead of just ending the current string.
> I wouldn't mind doing this myself, either. Could someone tell me where
> to find the functions and events that control this?
> >
Received on Sat 09 May 2009 - 00:00:47 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:37:51 EST