Skip to content

Commit

Permalink
Autoindent now cursor snaps to prevent awkward cursor movement
Browse files Browse the repository at this point in the history
  • Loading branch information
curlpipe committed Oct 30, 2024
1 parent 7e3727f commit f23531b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/autoindent.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--[[
Auto Indent v0.11
Auto Indent v0.12
Helps you when programming by guessing where indentation should go
and then automatically applying these guesses as you program
Expand Down Expand Up @@ -114,6 +114,7 @@ function autoindent:set_indent(y, new_indent)
-- Place the cursor at a sensible position
if x < 0 then x = 0 end
editor:move_to(x, y)
editor:cursor_snap()
end

-- Get how indented a line is at a certain y index
Expand Down

0 comments on commit f23531b

Please sign in to comment.