Skip to content

Commit 0d73cc2

Browse files
jaihindhreddytonsky
authored andcommitted
Eval form on the left if rest of the line is whitespace
1 parent 9b4ab95 commit 0d73cc2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

package.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,13 @@ def expand_until(view, point, scopes):
359359
return sublime.Region(begin, end)
360360

361361
def topmost_form(view, point):
362+
# move left if point is in whitespace and the rest of the line is also whitespace
363+
line = view.line(point)
364+
rest_of_line = view.substr(sublime.Region(point, line.b))
365+
if rest_of_line.isspace() or not rest_of_line:
366+
while point-1 > line.a and view.substr(point-1).isspace():
367+
point -= 1
368+
362369
region = expand_until(view, point, {'source.clojure '})
363370
if region \
364371
and view.substr(region).startswith("(comment") \

0 commit comments

Comments
 (0)