Re: How to disable autocompletion of quotes, brackets etc?

From: phayz <russelldicken....at.gmail.com>
Date: Tue, 23 Mar 2010 19:49:58 -0700 (PDT)

On Mar 24, 11:47 am, mitchell <mforal.n....at.gmail.com> wrote:
> Hi,
>
> > Change textadept/modules/textadept/editing.lua's line 24 from
> >   AUTOPAIR = true
> > to
> >   AUTOPAIR = false
>
> Instead of editing the module, you can put
>
> _m.textadept.editing.AUTOPAIR = false
>
> in your ~/.textadept/init.lua after loading the 'textadept' module.
>
>
>
> > I also have a small patch (that I've been trying to get Mitchell to
> > accept) that allows you to undo an accidental auto-pairing with the
> > backspace key.
>
> Sorry Brian, this patch slipped through my memory. I will apply it
> soon.
>
> Thanks,
> Mitchell
>
>
>
> > -- Causes backspace to eliminate accidentally-added matching
> > characters
> > textadept.events.add_handler('keypress',
> >         function(code, shift, control, alt)
> >                 -- Backspace (from <gdk/gdkkeysyms.h>)
> >                 if code == 0xff08 and buffer.selections == 1 then
> >                         local buffer = buffer
> >                         local current_pos = buffer.current_pos
> >                         if char_matches[buffer.char_at[current_pos - 1]]
> >                                 and buffer.char_at[current_pos] ==
> >                                 string.byte(char_matches[buffer.char_at[current_pos - 1]]) then
> >                                 buffer:char_right()
> >                                 buffer:delete_back()
> >                         end
> >                 end
> >         end)
>
> > - Brian
>
> > On Mar 23, 3:38 pm, phayz <russelldicken....at.gmail.com> wrote:
>
> > > The subject says it all, I hope. I don't want quotes, brackets etc
> > > being autocompleted but I don't know how to turn this off. Can someone
> > > please tell me how to do this?
>
> > > Regards,
>
> > > Russell Dickenson

Cool! Now that I worked out why a personal init.lua file wasn't
working for me I have the following lines just before the init.lua's
final "end" statement -

  -- Personal customisations/configuration options
  -- Hide the Project Manager (AKA sidebar) by settings its width to 0
  textadept.pm.width = 0
  require 'modules/bufferutils' -- buffer utilities
  -- Don't insert the matching bracket, apostrophe, etc when one is
typed
  _m.textadept.editing.AUTOPAIR = false

The AUTOPAIR statement doesn't look to have taken effect because I'm
still getting apostrophes, brackets etc being automatically inserted
when I type just one in.

Have I misunderstood the instructions as to what is to go where?

Regards,

Russell Dickenson
Received on Tue 23 Mar 2010 - 22:49:58 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:40:53 EST