(wip) advanced langtons ant

(wip) advanced langtons ant
This commit is contained in:
2025-11-12 00:58:34 +01:00
parent c57f07ffc2
commit 25ec8d2585
42 changed files with 3283 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
const Constants = preload("res://addons/godot_vim/constants.gd")
const Mode = Constants.Mode
func execute(api : Dictionary, args: String):
api.command_line.search_pattern = args.substr(1)
var rmatch: RegExMatch = api.vim_plugin.search_regex(
api.code_edit,
api.command_line.search_pattern,
api.cursor.get_caret_pos() + Vector2i.RIGHT
)
if rmatch != null:
var pos: Vector2i = api.vim_plugin.idx_to_pos(api.code_edit, rmatch.get_start())
api.cursor.set_caret_pos(pos.y, pos.x)
else:
api.status_bar.display_error('Pattern not found: "%s"' % [api.command_line.search_pattern])
api.cursor.set_mode(Mode.NORMAL)