Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Switching programming languages clears editor undo history

Abierto
#365 3 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@Chingyong0905 ya está trabajando en esto.

Desde el 19/10/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

Observed behavior

Switching programming languages clears the code editor's undo history, even though the code itself is preserved.

As a result, users cannot undo previous edits or recover accidentally deleted code after switching back to the original language.

Expected behavior

Each programming language should retain its own undo/redo history when switching between languages during an interview.

Reproduction
  1. Start a coding interview, select Python (for example), and enter a few lines of code.
  2. Delete a line and press Ctrl+Z to confirm that undo works.
  3. Delete the line again.
  4. Switch to any other supported programming language, then switch back to Python.
  5. Press Ctrl+Z again. The deleted line can no longer be restored after switching back to Python.
    This issue occurs regardless of which programming language is selected during the switch.
Proposed approach

Keep a separate in-page undo/redo history for each programming language. Switching languages selects that language's history without recording the switch as a text edit. After switching away and back in reproduction step 4, Ctrl+Z in step 5 should restore the deleted line in the original language without changing another language's code.

Record edits through the existing input handling and applyEditorEdit, including Tab, Shift+Tab, Ctrl+/, and the starter-code restore in #398. Preserve selection bounds and direction, including the behavior addressed by #390. Undo/redo must also update the saved code, editor display, and existing code synchronization.

This requires custom history management. Simply using insertText for language swaps would retain native history but make the swaps themselves undoable, so it would not meet the expected behavior.

CodeTrial version

codetrial 0.1.0 (5b4d8c7)

Environment

OS: Windows 11 Home Single Language, Version 25H2 (Build 26200.9711)
Browser: Google Chrome 155.0.8059.80 (64-bit)
Language: All supported programming languages (Python, JavaScript, C, C++, Java)
Interview loop: Coding interview
Problem: Sensor Calibration Index (LeetCode 108)
REACTO or STAR step: Code
Reconnect: None

Sanitized evidence

No response

Public data confirmation
  • I removed credentials, session tokens, candidate recordings, and personal interview content from this public report.
Lenguaje dominante
Rust
Estrellas
177
Forks
100
Merge medio
1 d 9 h
PR fusionados (30 d)
151

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de sysprog21/codetrial

Todos los issues de sysprog21/codetrial

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.