[code] More on the backtick in Spanish keyboards

From: Pedro Andres Aranda Gutierrez <paaguti.att.gmail.com>
Date: Tue, 10 Oct 2017 14:45:04 +0200

Hi,

I have continued to work on this in order to make typeover, keypairs, etc.
work consistently.

I have come up with a single function to treat all insertions and typeovers
and the kernel of this function is:

    if buffer.selection_start == buffer.selection_end then
      if textadept.editing.typeover_chars and
textadept.editing.typeover_chars[code] then
        if buffer.char_at[buffer.current_pos] == code then
          buffer:char_right()
          return true
        end
      end
    else
      if textadept.editing.auto_pairs and
textadept.editing.auto_pairs[altcode] then

textadept.editing.enclose(string.char(code),textadept.editing.auto_pairs[code])
        return true
      end
    end

AFAIK, this is also done in modules/textadept/editing.lua in two hooks. Now
my questions:

1) Why not reorganise editing.lua to make this code be called in one hook
and not in two?
2) Why not make this code a public function that can be called from outside
for things like patching the behaviour of a strange keyboard (that is used
by 'a couple million' ;-) people on this planet) ?

Mitchell, let me know if this makes sense to you and I will try to provide
a sensible patch set

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 10 Oct 2017 - 08:45:04 EDT

This archive was generated by hypermail 2.2.0 : Wed 11 Oct 2017 - 06:37:57 EDT