@@ -58,6 +58,7 @@ use helix_view::{
5858} ;
5959
6060use anyhow:: { anyhow, bail, ensure, Context as _} ;
61+ use arc_swap:: access:: DynAccess ;
6162use insert:: * ;
6263use movement:: Movement ;
6364
@@ -4152,7 +4153,9 @@ pub mod insert {
41524153 let ( view, doc) = current_ref ! ( cx. editor) ;
41534154 let text = doc. text ( ) ;
41544155 let selection = doc. selection ( view. id ) ;
4155- let auto_pairs = doc. auto_pairs ( cx. editor , view, doc) ;
4156+
4157+ let loader: & helix_core:: syntax:: Loader = & cx. editor . syn_loader . load ( ) ;
4158+ let auto_pairs = doc. auto_pairs ( cx. editor , loader, view, doc) ;
41564159
41574160 let transaction = auto_pairs
41584161 . as_ref ( )
@@ -4320,11 +4323,12 @@ pub mod insert {
43204323 ) ,
43214324 } ;
43224325
4326+ let loader: & helix_core:: syntax:: Loader = & cx. editor . syn_loader . load ( ) ;
43234327 // If we are between pairs (such as brackets), we want to
43244328 // insert an additional line which is indented one level
43254329 // more and place the cursor there
43264330 let on_auto_pair = doc
4327- . auto_pairs ( cx. editor , view, doc)
4331+ . auto_pairs ( cx. editor , loader , view, doc)
43284332 . as_deref ( )
43294333 . and_then ( |pairs| pairs. get ( prev) )
43304334 . is_some_and ( |pair| pair. open == prev && pair. close == curr) ;
@@ -4414,8 +4418,8 @@ pub mod insert {
44144418 let tab_width = doc. tab_width ( ) ;
44154419 let indent_width = doc. indent_width ( ) ;
44164420
4417- let auto_pairs = doc . auto_pairs ( cx. editor , view , doc ) ;
4418- let auto_pairs = auto_pairs . as_deref ( ) ;
4421+ let loader : & helix_core :: syntax :: Loader = & cx. editor . syn_loader . load ( ) ;
4422+ let auto_pairs = doc . auto_pairs ( cx . editor , loader , view , doc ) ;
44194423
44204424 let transaction =
44214425 Transaction :: delete_by_selection ( doc. text ( ) , doc. selection ( view. id ) , |range| {
0 commit comments