[squeak-smalltalk/squeak-object-memory] `changeEmphasis:` in text editors not working for forward selection before already analogously emphasized text (Issue #158)

Christoph Thiede via Squeak-dev <[email protected]> Thu, 11 Jun 2026 15:12:24 -0700
Newsgroups gmane.comp.lang.smalltalk.squeak.general
Message-ID <squeak-smalltalk/squeak-object-memory/issues/[email protected]>
LinqLover created an issue (squeak-smalltalk/squeak-object-memory#158)

STR:

1. ```smalltalk
   'abc' asText
   	addAttribute: TextEmphasis bold from: 3 to: 3;
   	edit
   ```
2. Forward-select `ab` (from left to right)
3. Press Cmd+7 (for bold)

Expected: `ab` is bold

Actual: Nothing changes

This is due to `TextEditor>>#changeEmphasis:` determining the previous attributes from the character at the point index, being `c` in this case. Probably it should collect the attributes within the entire ranges instead and then toggle their global appearance (some -> all -> none -> all -> ...).

-- 
Reply to this email directly or view it on GitHub:
https://github.com/squeak-smalltalk/squeak-object-memory/issues/158
You are receiving this because you are subscribed to this thread.

Message ID: <squeak-smalltalk/squeak-object-memory/issues/[email protected]>

Squeak-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]