@@ -77,7 +77,9 @@ ensure_correct_str_txt <- function(pd, text) {
77
77
problematic_strings $ text <- NULL
78
78
problematic_strings $ short <- NULL
79
79
new_strings <- merge(problematic_strings , parent_of_problematic_strings ,
80
- by.x = " parent" , by.y = " id"
80
+ by.x = " parent" ,
81
+ by.y = " id" ,
82
+ suffixes = c(" " , " parent" )
81
83
) %> %
82
84
as_tibble()
83
85
@@ -87,8 +89,12 @@ ensure_correct_str_txt <- function(pd, text) {
87
89
" Please file an issue on GitHub (https://github.com/r-lib/styler/issues)" ,
88
90
), call. = FALSE )
89
91
}
92
+ names_to_keep <- setdiff(
93
+ names(new_strings ),
94
+ paste0(line_col_names(), " parent" )
95
+ )
90
96
bind_rows(
91
- new_strings ,
97
+ new_strings [, names_to_keep ] ,
92
98
pd [is_unaffected_token , ],
93
99
pd [is_parent_of_problematic_string , ]
94
100
) %> %
@@ -115,8 +121,8 @@ identify_insufficiently_parsed_stings <- function(pd, text) {
115
121
116
122
# ' @importFrom purrr map2_lgl
117
123
lines_and_cols_match <- function (data ) {
118
- left <- paste0(line_col_names(), " .x " )
119
- right <- paste0(line_col_names(), " .y " )
124
+ left <- paste0(line_col_names(), " " )
125
+ right <- paste0(line_col_names(), " parent " )
120
126
map2_lgl(left , right ,
121
127
two_cols_match ,
122
128
data = data
0 commit comments