|
|
@@ -309,7 +309,7 @@ editor.buffer:on_buffer_event(function(event_data)
|
|
|
end
|
|
|
end)
|
|
|
|
|
|
--- Manual highlight key (C-l) for any language
|
|
|
+-- Manual highlight key (original C-l for syntax highlighting)
|
|
|
bind_key("C-l", function()
|
|
|
highlight_buffer()
|
|
|
|
|
|
@@ -324,5 +324,45 @@ bind_key("C-l", function()
|
|
|
message(string.format("Highlighted! Applied %d styled ranges", styles_count))
|
|
|
end)
|
|
|
|
|
|
--- Welcome message
|
|
|
-message("Lumacs ready! C-s=save, C-l=highlight, M-arrows=swap lines, C-i=info, Esc/Q=quit")
|
|
|
+-- Test Escape key binding
|
|
|
+bind_key("Escape", function()
|
|
|
+ message("Escape pressed! (Direct binding works)")
|
|
|
+end)
|
|
|
+
|
|
|
+-- C-x sequence bindings (Emacs style)
|
|
|
+bind_key("C-x o", function()
|
|
|
+ editor:next_window()
|
|
|
+ message("Switched window with C-x o")
|
|
|
+end)
|
|
|
+
|
|
|
+bind_key("C-x 2", function()
|
|
|
+ editor:split_horizontally()
|
|
|
+ message("Split horizontally with C-x 2")
|
|
|
+end)
|
|
|
+
|
|
|
+bind_key("C-x 3", function()
|
|
|
+ editor:split_vertically()
|
|
|
+ message("Split vertically with C-x 3")
|
|
|
+end)
|
|
|
+
|
|
|
+bind_key("C-x 0", function()
|
|
|
+ editor:close_window()
|
|
|
+ message("Closed window with C-x 0")
|
|
|
+end)
|
|
|
+
|
|
|
+-- Test control keys (ncurses versions)
|
|
|
+bind_key("C-k", function()
|
|
|
+ message("C-k pressed! (Control key working with ncurses)")
|
|
|
+end)
|
|
|
+
|
|
|
+bind_key("C-s", function()
|
|
|
+ local buf = editor.buffer
|
|
|
+ if buf:save() then
|
|
|
+ message("Buffer saved with C-s (ncurses)!")
|
|
|
+ else
|
|
|
+ message("Failed to save buffer")
|
|
|
+ end
|
|
|
+end)
|
|
|
+
|
|
|
+-- Welcome message for ncurses version
|
|
|
+message("Lumacs (ncurses) ready! C-l=highlight, C-k=test, C-s=save, M-arrows=swap, C-x sequences, Esc=test")
|