@@ -8,7 +8,7 @@ export const map_display_pos_to_raw_pos = (
88 let last_raw_index = 0
99
1010 const regex =
11- / ` ( [ ^ \s ` ] * \. [ ^ \s ` ] + ) ` | ( # C h a n g e s : [ ^ \s , ; : ! ? ] + ) | ( # S e l e c t i o n ) | ( # S a v e d C o n t e x t : (?: W o r k s p a c e S t a t e | J S O N ) \s + " ( [ ^ " ] + ) " ) / g
11+ / ` ( [ ^ \s ` ] * \. [ ^ \s ` ] + ) ` | ( # C h a n g e s : [ ^ \s , ; : ! ? ] + ) | ( # S e l e c t i o n ) | ( # S a v e d C o n t e x t : (?: W o r k s p a c e S t a t e | J S O N ) \s + " ( [ ^ " ] + ) " ) | ( # C o m m i t : [ ^ : ] + : ( [ ^ \s " ] + ) \s + " [ ^ " ] * " ) / g
1212 let match
1313
1414 while ( ( match = regex . exec ( raw_text ) ) !== null ) {
@@ -17,6 +17,8 @@ export const map_display_pos_to_raw_pos = (
1717 const selection_keyword = match [ 3 ]
1818 const saved_context_keyword = match [ 4 ]
1919 const context_name = match [ 5 ]
20+ const commit_keyword = match [ 6 ]
21+ const commit_hash = match [ 7 ]
2022
2123 let is_replacement_match = false
2224 let display_match_length = 0
@@ -35,6 +37,10 @@ export const map_display_pos_to_raw_pos = (
3537 } else if ( saved_context_keyword ) {
3638 display_match_length = `Context "${ context_name } "` . length
3739 is_replacement_match = true
40+ } else if ( commit_keyword ) {
41+ const short_hash = commit_hash . substring ( 0 , 7 )
42+ display_match_length = short_hash . length
43+ is_replacement_match = true
3844 }
3945
4046 if ( ! is_replacement_match ) {
@@ -79,7 +85,7 @@ export const map_raw_pos_to_display_pos = (
7985 let last_raw_index = 0
8086
8187 const regex =
82- / ` ( [ ^ \s ` ] * \. [ ^ \s ` ] + ) ` | ( # C h a n g e s : [ ^ \s , ; : ! ? ] + ) | ( # S e l e c t i o n ) | ( # S a v e d C o n t e x t : (?: W o r k s p a c e S t a t e | J S O N ) \s + " ( [ ^ " ] + ) " ) / g
88+ / ` ( [ ^ \s ` ] * \. [ ^ \s ` ] + ) ` | ( # C h a n g e s : [ ^ \s , ; : ! ? ] + ) | ( # S e l e c t i o n ) | ( # S a v e d C o n t e x t : (?: W o r k s p a c e S t a t e | J S O N ) \s + " ( [ ^ " ] + ) " ) | ( # C o m m i t : [ ^ : ] + : ( [ ^ \s " ] + ) \s + " [ ^ " ] * " ) / g
8389 let match
8490
8591 while ( ( match = regex . exec ( raw_text ) ) !== null ) {
@@ -88,6 +94,8 @@ export const map_raw_pos_to_display_pos = (
8894 const selection_keyword = match [ 3 ]
8995 const saved_context_keyword = match [ 4 ]
9096 const context_name = match [ 5 ]
97+ const commit_keyword = match [ 6 ]
98+ const commit_hash = match [ 7 ]
9199
92100 let is_replacement_match = false
93101 let display_match_length = 0
@@ -106,6 +114,10 @@ export const map_raw_pos_to_display_pos = (
106114 } else if ( saved_context_keyword ) {
107115 display_match_length = `Context "${ context_name } "` . length
108116 is_replacement_match = true
117+ } else if ( commit_keyword ) {
118+ const short_hash = commit_hash . substring ( 0 , 7 )
119+ display_match_length = short_hash . length
120+ is_replacement_match = true
109121 }
110122
111123 if ( ! is_replacement_match ) {
0 commit comments