Page MenuHomePhabricator

SimSik: in-word composing
Closed, ResolvedPublic

Description

Enter composing mode and working when cursor is in the middle of a word.

Event Timeline

iongchun created this task.Jul 10 2017, 9:06 AM

Input state: unchanged
Tailing text
Input state + tailing text = display state,
for correction, suggestion
Composing text + tailing text = composing region

iongchun added a comment.EditedJul 24 2017, 10:51 AM

Issue: tonal mark

Scenario 1: tonal mark moves backward
lê_ng > delete > l_n̂g (from l_ng)

Scenario 2: tonal mark moves forward
li_ú > input "A" > liá_u (from lia_ú)
p_n̄g > input "o" > pō_ng (from po_n̄g)

Another tone mark issue: glotal (4th & 8th tone)

Plan B

Composing state:
separated from input state
for input composing (append, delete)

Composing cursor:
after the last grapheme of composing state

Plan B

initComposing:
Parsed into input state and composing state
Composing is subset of input state, before cursor,
without tone

updateComposingText:
Composing cursor is lengh of text of composing state,
possibility with or without tone.

inputComposing:
Using composing state to edit/delete.
Recreate input state.

iongchun added a comment.EditedAug 15 2017, 3:02 PM

updateView refactory:

Fields for actions:

  • ComposingCorrection: not in used now
  • SelectionEnd and DeleteAfter: combined together to delete selection
  • DeleteBefore: it is used to:
    • delete characters before cursor in non-text mode
    • delete characters before cursor in text, non-composing mode
    • delete characters before cursor in text, composing mode, and composing not started In other words, it is used to delete characters before cursor without composing region
  • CommitText:
    • In non-text mode, it is used to commit character and text before cursor
    • In text, non-composing mode, it is used to commit character before cursor
    • In text, composing mode, it is used to:
      • commit text before cursor without composing region
      • commit text before changed composing region
      • commit composing text then reset composing state
      • commit text then discard composing region when correction text is clicked
      • commit text then discard composing region when candidate text is clicked
    • It is also used to commit special symbols before cursor
  • ComposingText: it is used to update text composing region after state update
  • ComposingCursor: it is used to update cursor inside composing region after state update
  • ComposingStart/End: it is used to update composing region after parsing
    • After input started
    • After switch back from ASCII keyboard
    • After cursor/selection update
    • After delete characters before cursor without composing region
    • After deleting with composing state updated
    • After inserting with composing state updated

updateView refactory: (continued)

Order for actions:

a.

  1. SelectionEnd (with SelectionStart)
  2. DeleteAfter

b. DeleteBefore (could be 1)

The order for a and b is not important.

c. CommitText (so it will not be deleted by DeleteBefore)

d. ComposingStart/End: was affected by DeleteBefore, CommitText

e. ComposingText

f. ComposingCursor

iongchun closed this task as Resolved.Aug 17 2017, 5:21 PM

Released in 1.4