Skip to content

feat: Ctrl+E 지우기 커맨드 구현#822

Open
oksure wants to merge 2 commits into
edwardkim:develfrom
oksure:contrib/edit-delete-cmd
Open

feat: Ctrl+E 지우기 커맨드 구현#822
oksure wants to merge 2 commits into
edwardkim:develfrom
oksure:contrib/edit-delete-cmd

Conversation

@oksure
Copy link
Copy Markdown
Contributor

@oksure oksure commented May 11, 2026

요약

편집 메뉴의 "지우기"(Ctrl+E) 커맨드를 구현합니다. 기존 TODO 스텁을 실동작 코드로 대체합니다.

동작

  • 선택 영역 있음: 선택된 텍스트/개체 삭제
  • 선택 영역 없음: 커서 위치에서 전방 1문자 삭제 (Delete 키와 동일)

변경 파일

파일 변경
commands/edit.ts canExecute: () => falsectx.hasDocument, execute 구현
input-handler.ts performDelete() 공개 메서드 추가
shortcut-map.ts Ctrl+E / Ctrl+ㄷ (한글 IME) 매핑 추가

감사합니다.

- 선택 영역이 있으면 선택 삭제
- 선택 영역이 없으면 전방 1문자 삭제 (Delete 키와 동일)
- shortcut-map에 Ctrl+E / Ctrl+ㄷ (한글 IME) 매핑 추가
- canExecute: () => false → (ctx) => ctx.hasDocument로 활성화
Copilot AI review requested due to automatic review settings May 11, 2026 06:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

편집 메뉴의 “지우기”(Ctrl+E) 커맨드를 실제 동작하도록 구현하고, 커맨드 시스템/단축키 매핑에 연결하는 변경입니다.

Changes:

  • edit:delete 커맨드의 canExecute/execute를 구현하여 InputHandler를 통해 삭제 동작을 수행하도록 추가
  • 커맨드 시스템에서 호출 가능한 InputHandler.performDelete() 공개 메서드 추가
  • 기본 단축키에 Ctrl+E 및 한글 IME용 Ctrl+ㄷedit:delete로 매핑 추가

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
rhwp-studio/src/engine/input-handler.ts 커맨드 시스템에서 호출할 삭제 동작 진입점(performDelete) 추가
rhwp-studio/src/command/shortcut-map.ts Ctrl+E/Ctrl+ㄷedit:delete 단축키 매핑 추가
rhwp-studio/src/command/commands/edit.ts edit:delete 커맨드 실행 가능 조건 및 실행 로직 구현

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rhwp-studio/src/engine/input-handler.ts Outdated
Comment on lines +2261 to +2268
/** 지우기 (커맨드 시스템용) — 선택 있으면 선택 삭제, 없으면 전방 1문자 삭제 */
performDelete(): void {
if (this.cursor.hasSelection()) {
this.deleteSelection();
} else {
const pos = this.cursor.getPosition();
this.handleDelete(pos, this.cursor.isInCell());
}
Comment on lines +18 to +19
[{ key: 'e', ctrl: true }, 'edit:delete'],
[{ key: 'ㄷ', ctrl: true }, 'edit:delete'],
Copilot 리뷰 반영:
- 그림/도형 개체 선택 상태에서 performDelete() 호출 시 개체 삭제
- shape/line/group은 deleteShapeControl, image는 deletePictureControl 사용
- exitPictureObjectSelectionAndAfterEdit()로 선택 모드 탈출
@oksure
Copy link
Copy Markdown
Contributor Author

oksure commented May 11, 2026

Copilot 리뷰 반영 (cd13f45):

  1. 개체 선택 삭제: performDelete()가 그림/도형 개체 선택 모드를 먼저 확인하고, 해당 개체를 삭제 후 선택 모드를 탈출합니다.
  2. Ctrl+E 키 라우팅: 개체 선택 모드에서 Ctrl+E를 눌렀을 때 선택이 먼저 해제되는 문제는 keydown 핸들러의 디스패치 순서(7→8번)에 기인합니다. 이 PR 범위에서는 performDelete()의 개체 처리로 메뉴 경유 삭제를 지원하고, 키보드 라우팅 순서 변경은 별도 이슈로 분리하는 것이 적절해 보입니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants