| 6386 | } |
| 6387 | |
| 6388 | void Editor::WordSelection ( int pos ) |
| 6389 | { |
| 6390 | if ( pos < wordSelectAnchorStartPos ) { |
| 6391 | // Extend backward to the word containing pos. |
| 6392 | // Skip ExtendWordSelect if the line is empty or if pos is after the last character. |
| 6393 | // This ensures that a series of empty lines isn't counted as a single "word". |
| 6394 | if ( !pdoc->IsLineEndPosition ( pos ) ) { |
| 6395 | pos = pdoc->ExtendWordSelect ( pdoc->MovePositionOutsideChar ( pos + 1, 1 ), -1 ); |
| 6396 | } |
| 6397 | TrimAndSetSelection ( pos, wordSelectAnchorEndPos ); |
| 6398 | } else if ( pos > wordSelectAnchorEndPos ) { |
| 6399 | // Extend forward to the word containing the character to the left of pos. |
| 6400 | // Skip ExtendWordSelect if the line is empty or if pos is the first position on the line. |
| 6401 | // This ensures that a series of empty lines isn't counted as a single "word". |
| 6402 | if ( pos > pdoc->LineStart ( pdoc->LineFromPosition ( pos ) ) ) { |
| 6403 | pos = pdoc->ExtendWordSelect ( pdoc->MovePositionOutsideChar ( pos - 1, -1 ), 1 ); |
| 6404 | } |
| 6405 | TrimAndSetSelection ( pos, wordSelectAnchorStartPos ); |
| 6406 | } else { |
| 6407 | // Select only the anchored word |
| 6408 | if ( pos >= originalAnchorPos ) { |
| 6409 | TrimAndSetSelection ( wordSelectAnchorEndPos, wordSelectAnchorStartPos ); |
| 6410 | } else { |
| 6411 | TrimAndSetSelection ( wordSelectAnchorStartPos, wordSelectAnchorEndPos ); |
| 6412 | } |
| 6413 | } |
| 6414 | } |
| 6415 | |
| 6416 | void Editor::DwellEnd ( bool mouseMoved ) |
| 6417 | { |
nothing calls this directly
no test coverage detected