Skip to content

feat: 모양 복사/붙이기 (Ctrl+Alt+C/V) 구현#828

Open
oksure wants to merge 2 commits into
edwardkim:develfrom
oksure:contrib/format-copy-paste
Open

feat: 모양 복사/붙이기 (Ctrl+Alt+C/V) 구현#828
oksure wants to merge 2 commits into
edwardkim:develfrom
oksure:contrib/format-copy-paste

Conversation

@oksure
Copy link
Copy Markdown
Contributor

@oksure oksure commented May 11, 2026

변경 내용

edit:format-copy TODO 스텁을 구현하고, 대응하는 edit:format-paste 커맨드를 추가합니다.

구현 사항

  • 모양 복사 (Ctrl+Alt+C): 커서 위치의 글자 서식(CharProperties)과 문단 서식(ParaProperties)을 캡처
  • 모양 붙이기 (Ctrl+Alt+V): 캡처된 서식을 현재 선택 영역에 적용
  • 한글 IME 키 (ㅊ/ㅍ) 매핑 포함
  • 내부 ID(charShapeId, fontId, paraShapeId 등)는 제외하고 시각 속성만 복사

변경 파일

파일 변경
input-handler.ts performFormatCopy(), performFormatPaste(), hasFormatClipboard() 추가
edit.ts edit:format-copy 구현 + edit:format-paste 커맨드 추가
shortcut-map.ts Ctrl+Alt+C/V 단축키 등록

테스트

  • cargo test 통과
  • cargo clippy -- -D warnings 경고 없음

감사합니다.

- edit:format-copy 커맨드: 커서 위치의 글자/문단 서식 캡처
- edit:format-paste 커맨드: 캡처된 서식을 선택 영역에 적용
- Ctrl+Alt+C / Ctrl+Alt+V 단축키 등록 (한글 IME 포함)
- 내부 ID(charShapeId, paraShapeId 등) 제외하고 시각 속성만 복사
Copilot AI review requested due to automatic review settings May 11, 2026 08:17
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

Adds “모양 복사/붙이기” 기능을 커맨드/단축키 체계에 연결해, 커서 위치의 서식(글자/문단)을 캡처한 뒤 선택 영역에 적용할 수 있도록 확장하는 PR입니다.

Changes:

  • InputHandler에 서식 클립보드 저장/적용 로직(performFormatCopy/performFormatPaste/hasFormatClipboard) 추가
  • edit:format-copy TODO 구현 및 edit:format-paste 커맨드 신규 추가
  • Ctrl+Alt+C/V 및 한글 IME(ㅊ/ㅍ) 단축키 매핑 추가

Reviewed changes

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

File Description
rhwp-studio/src/engine/input-handler.ts 서식 캡처/적용을 위한 내부 클립보드 및 적용 메서드 추가
rhwp-studio/src/command/commands/edit.ts 모양 복사/붙이기 커맨드 구현 및 등록
rhwp-studio/src/command/shortcut-map.ts Ctrl+Alt+C/V 및 ㅊ/ㅍ 단축키 등록

💡 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 +2440 to +2441
const { charShapeId, fontId, fontIds, paraShapeId, ...charRest } = charProps as any;
const { paraShapeId: _psId, ...paraRest } = paraProps as any;
Comment thread rhwp-studio/src/engine/input-handler.ts Outdated
Comment on lines +2440 to +2441
const { charShapeId, fontId, fontIds, paraShapeId, ...charRest } = charProps as any;
const { paraShapeId: _psId, ...paraRest } = paraProps as any;
Comment on lines +2445 to +2451
performFormatPaste(): void {
if (!this.formatClipboard) return;
if (!this.cursor.hasSelection()) return;
const sel = this.cursor.getSelectionOrdered();
if (!sel) return;
this.applyCharPropsToRange(sel.start, sel.end, this.formatClipboard.char);
this.applyParaPropsToRange(sel.start, sel.end, this.formatClipboard.para);
{
id: 'edit:format-paste',
label: '모양 붙이기',
icon: 'icon-format-paste',
- as any 제거, Partial<CharProperties> 타입으로 구조 분해
- borderFillId, numberingId도 복사 대상에서 제외
- icon-format-paste → icon-format-copy 재사용 (CSS 스프라이트 미등록)
@oksure
Copy link
Copy Markdown
Contributor Author

oksure commented May 11, 2026

Copilot 리뷰 반영 (06fd552): as any 제거 + borderFillId/numberingId 제외 추가 + icon-format-paste → icon-format-copy 재사용

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