File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed
Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -110,8 +110,11 @@ function M.indentexpr(linenr)
110110 end
111111
112112 local sorry = sorry_at (linenr - 2 , # last - 1 )
113- if sorry and not last :find ' :=' then
114- return math.max (0 , sorry - shiftwidth - 1 )
113+ if sorry then
114+ local before = last :sub (1 , sorry )
115+ if not before :find ' :=%s*' and not before :find ' from%s*' then
116+ return math.max (0 , sorry - shiftwidth - 1 )
117+ end
115118 end
116119
117120 local _ , last_indent = last :find ' ^%s*'
Original file line number Diff line number Diff line change @@ -141,6 +141,24 @@ describe('indent', function()
141141 )
142142 )
143143
144+ it (
145+ ' is not confused by sorry after from' ,
146+ helpers .clean_buffer (
147+ [[
148+ example : 37 = 37 := by
149+ suffices h : 73 = 73 from sorry
150+ ]] ,
151+ function ()
152+ helpers .feed ' Gorfl'
153+ assert .contents .are [[
154+ example : 37 = 37 := by
155+ suffices h : 73 = 73 from sorry
156+ rfl
157+ ]]
158+ end
159+ )
160+ )
161+
144162 it (
145163 ' dedents after focused sorry' ,
146164 helpers .clean_buffer (
You can’t perform that action at this time.
0 commit comments