File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 2626
2727--- @return nil
2828function M .move_out ()
29+ -- Move cursor to first non-whitespace character of current line (like normal! ^)
30+ local current_row = vim .fn .line (' .' )
31+ local current_col = vim .fn .col (' .' )
32+ local current_line = require (' treewalker.lines' ).get_line (current_row )
33+ if current_line then
34+ local start_col = require (' treewalker.lines' ).get_start_col (current_line )
35+ -- Only move if we're not already at the first non-whitespace character
36+ if current_col ~= start_col then
37+ vim .api .nvim_win_set_cursor (0 , { current_row , start_col - 1 }) -- Convert to 0-indexed
38+ end
39+ end
40+
2941 local node = nodes .get_current ()
3042 local target , row = targets .out (node )
3143 if not (target and row ) then
You can’t perform that action at this time.
0 commit comments