bvd757 commited on
Commit
b24410c
·
1 Parent(s): b418157

fix highlight

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. search_errors_logic.py +1 -0
app.py CHANGED
@@ -138,7 +138,7 @@ def main():
138
  else:
139
  text, errors = check_text(text, tool, mode="chat_gpt")
140
  if not errors:
141
- st.success("Ошибок не найдено! 👍")
142
  else:
143
  sorted_errors = sorted(errors, key=lambda x: x['start'])
144
 
 
138
  else:
139
  text, errors = check_text(text, tool, mode="chat_gpt")
140
  if not errors:
141
+ st.success("Ошибок не найдено.")
142
  else:
143
  sorted_errors = sorted(errors, key=lambda x: x['start'])
144
 
search_errors_logic.py CHANGED
@@ -175,6 +175,7 @@ def add_comments_to_text(text, errors, add_errors=False):
175
  if add_errors:
176
  inp = inp[:-1] + ' - ' + error['message'] + ')'
177
  text = text[:error['end']] + inp + text[error['end']:]
 
178
  shift += len(inp)
179
 
180
  return text.replace("\n", " ")
 
175
  if add_errors:
176
  inp = inp[:-1] + ' - ' + error['message'] + ')'
177
  text = text[:error['end']] + inp + text[error['end']:]
178
+ error["end"] += len(inp)
179
  shift += len(inp)
180
 
181
  return text.replace("\n", " ")