1- local Compat = require (' render-markdown.lib.compat' )
21local Context = require (' render-markdown.request.context' )
32local Decorator = require (' render-markdown.lib.decorator' )
4- local Env = require (' render-markdown.lib.env' )
53local Extmark = require (' render-markdown.lib.extmark' )
6- local Iter = require (' render-markdown.lib.iter' )
74local Range = require (' render-markdown.lib.range' )
5+ local compat = require (' render-markdown.lib.compat' )
6+ local env = require (' render-markdown.lib.env' )
87local handlers = require (' render-markdown.core.handlers' )
8+ local iter = require (' render-markdown.lib.iter' )
99local log = require (' render-markdown.core.log' )
1010local state = require (' render-markdown.state' )
1111
@@ -79,10 +79,10 @@ function Updater.new(buf, win, force)
7979end
8080
8181function Updater :start ()
82- if not Env .valid (self .buf , self .win ) then
82+ if not env .valid (self .buf , self .win ) then
8383 return
8484 end
85- if Env .buf .empty (self .buf ) then
85+ if env .buf .empty (self .buf ) then
8686 return
8787 end
8888 self .decorator :schedule (
@@ -105,19 +105,19 @@ end
105105
106106--- @private
107107function Updater :run ()
108- if not Env .valid (self .buf , self .win ) then
108+ if not env .valid (self .buf , self .win ) then
109109 return
110110 end
111- self .mode = Env .mode .get () -- mode is only available after this point
111+ self .mode = env .mode .get () -- mode is only available after this point
112112 local render = self .config .enabled
113113 and self .config .resolved :render (self .mode )
114- and not Env .win .get (self .win , ' diff' )
115- and Env .win .view (self .win ).leftcol == 0
114+ and not env .win .get (self .win , ' diff' )
115+ and env .win .view (self .win ).leftcol == 0
116116 log .buf (' info' , ' Render' , self .buf , render )
117117 local next_state = render and ' rendered' or ' default'
118- for _ , win in ipairs (Env .buf .windows (self .buf )) do
118+ for _ , win in ipairs (env .buf .windows (self .buf )) do
119119 for name , value in pairs (self .config .win_options ) do
120- Env .win .set (win , name , value [next_state ])
120+ env .win .set (win , name , value [next_state ])
121121 end
122122 end
123123 if not render then
@@ -145,7 +145,7 @@ function Updater:render()
145145 local extmarks = self :get_extmarks ()
146146 self .decorator :set (extmarks )
147147 if initial then
148- Compat .fix_lsp_window (self .buf , self .win , extmarks )
148+ compat .fix_lsp_window (self .buf , self .win , extmarks )
149149 M .config .on .initial ({ buf = self .buf , win = self .win })
150150 end
151151 end
@@ -173,7 +173,7 @@ function Updater:get_extmarks()
173173 -- make sure injections are processed
174174 context .view :parse (parser )
175175 local marks = handlers .run (context , parser )
176- return Iter .list .map (marks , Extmark .new )
176+ return iter .list .map (marks , Extmark .new )
177177end
178178
179179--- @private
@@ -182,15 +182,15 @@ function Updater:hidden()
182182 -- anti-conceal is not enabled -> hide nothing
183183 -- in disabled mode -> hide nothing
184184 local config = self .config .anti_conceal
185- if not config .enabled or Env .mode .is (self .mode , config .disabled_modes ) then
185+ if not config .enabled or env .mode .is (self .mode , config .disabled_modes ) then
186186 return nil
187187 end
188188 -- row is not known -> buffer is not active -> hide nothing
189- local row = Env .row .get (self .buf , self .win )
189+ local row = env .row .get (self .buf , self .win )
190190 if not row then
191191 return nil
192192 end
193- if Env .mode .is (self .mode , { ' v' , ' V' , ' \22 ' }) then
193+ if env .mode .is (self .mode , { ' v' , ' V' , ' \22 ' }) then
194194 local start = vim .fn .getpos (' v' )[2 ] - 1
195195 return Range .new (math.min (row , start ), math.max (row , start ))
196196 else
0 commit comments