Closed ousia closed 2 years ago
The m
function is defined here:
https://github.com/orbitalquark/textadept/blob/default/modules/textadept/keys.lua#L281
If you didn't copy all that into your init.lua
it will not work.
The wrap mode definition is here: https://github.com/orbitalquark/textadept/blob/default/modules/textadept/menu.lua#L256
function()
local first_visible_line = view.first_visible_line
local display_line = view:visible_from_doc_line(first_visible_line)
view.wrap_mode = view.wrap_mode == 0 and view.WRAP_WHITESPACE or 0
view:line_scroll(0, first_visible_line - display_line)
end
It's probably easiest if you copy that to your init.lua
and assign it to your shortcut.
Hola Pablo
what Linux is that? Maybe you need to tune the keyboard module...
Best, /PA
@rgieseke, many thanks for your help.
Copying the function allows me to have another shortcut to toggle wrap mode.
This is really great and I’m already using it.
But I also want to disable the following shortcut:
I need to disable it, because pressing Alt Gr + º
to get \
in a Spanish keyboard (see image above) triggers the previous shortcut.
@paaguti, many thanks for your reply.
Linux is fine. Windows is the misbehaving OS here.
I need to disable it, because pressing Alt Gr + º to get \ in a Spanish keyboard (see image above) triggers the previous shortcut.
You can set the value to nil
:
keys['ctrl+alt+\\'] = nil
This was exactly what I needed, @rgieseke.
BTW, in the email message I got (exactly the unfinished expression):
keys['ctrl+alt+\'] = nil
Another issue with the interface.
@orbitalquark,
I’m afraid I can only avoid this issue by adding to init.lua
:
keys['ctrl+alt+\\'] = nil
Textadept 11.4 beta now uses Gtk 3 instead of Gtk 2 (Gtk is a cross-platform GUI toolkit). I suspect key handling has changed slightly, but I don't know exactly. I came up with key bindings based on a US English key layout, so there may be issues on international keyboards. Sorry about that.
This might be fixed in GTK+4 (who knows).
This is fine for me. It might be interesting to warn users about this possible unintended interaction.
I’m afraid I cannot get
\
using a Spanish keyboard (requires Alt Gr with the to get the char).Here you have the key (top left one):
From 11.4beta, I toggle wrap mode, but in Windows only.
It works fine with 11.3 in Windows, or 11.4beta in Linux.
In Linux, I need Ctrl+Alt (besides Alt Gr to get the char).
As a workaround I tried to reassign another key:
But that didn’t work (and the API seems not to contain any information to toggle wrap mode).
Besides the bug, is there any way to assign toggle wrap mode to a different keystroke?
Many thanks for your help.