<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">According to the Smalltalk Editor Help:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><font face="Menlo" class="">Cmd-"   <span class="Apple-tab-span" style="white-space:pre">                  </span>Enclose within double quotes, or remove enclosing double quotes</font></div></blockquote><div class=""><br class=""></div><div class="">However, it surrounds my text with an apostrophe (“single-quote”) character instead of a quote (“double-quote”) character.</div><div class=""><br class=""></div><div class="">Specifically, if I have the following in the Workspace (or any other editor):</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">   </span><font face="Menlo" class="">Hello, world</font></div><div class=""><br class=""></div><div class="">And I highlight it and press <<font face="Menlo" class="">cmd-“</font>>, the result is:</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">    </span><font face="Menlo" class="">‘Hello, world'</font></div><div class=""><br class=""></div><div class="">But, I would have expected it to result with:</div><div class=""><br class=""></div><div class=""><div class=""><span class="Apple-tab-span" style="white-space: pre;">  </span>"<font face="Menlo" class="">Hello, world"</font></div></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class="">I used this as an opportunity to explore the system, and (after quite a while! 😉), I added a Transcript statement, as follows:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><font face="Menlo" class="">Texteditor>>>enclose: aKeyboardEvent</font></div><font face="Menlo" class=""><span class="Apple-tab-span" style="white-space:pre">      </span>"Insert or remove bracket characters around the current selection."<br class=""><span class="Apple-tab-span" style="white-space:pre">  </span>"This is a user command, and generates undo"<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>| left right startIndex stopIndex oldSelection which |<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><b style="font-size: 14px;" class="">Transcript show: ('kbd: [{1}]' format: {aKeyboardEvent keyCharacter }); newLine.</b><br class=""><span class="Apple-tab-span" style="white-space:pre">      </span>startIndex _ self startIndex.<br class=""><span class="Apple-tab-span" style="white-space:pre">  </span>stopIndex _ self stopIndex.<br class=""><span class="Apple-tab-span" style="white-space:pre">    </span>oldSelection _ self selection.<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>which _ '([<{"''`' indexOf: aKeyboardEvent keyCharacter ifAbsent: [ ^true ].<br class=""><span class="Apple-tab-span" style="white-space:pre">   </span>left _ '([<{"''`' at: which.<br class=""><span class="Apple-tab-span" style="white-space:pre">   </span>right _ ')]>}"''`' at: which.<br class=""><span class="Apple-tab-span" style="white-space:pre">  </span>((startIndex > 1 and: [stopIndex <= model textSize])<br class=""><span class="Apple-tab-span" style="white-space:pre">                     </span>and: [ (model actualContents at: startIndex-1) = left and: [(model actualContents at: stopIndex) = right]])<br class=""><span class="Apple-tab-span" style="white-space:pre">            </span>ifTrue: [<br class=""><span class="Apple-tab-span" style="white-space:pre">                      </span>"already enclosed; strip off brackets"<br class=""><span class="Apple-tab-span" style="white-space:pre">                       </span>self selectFrom: startIndex-1 to: stopIndex.<br class=""><span class="Apple-tab-span" style="white-space:pre">                   </span>self replaceSelectionWith: oldSelection]<br class=""><span class="Apple-tab-span" style="white-space:pre">               </span>ifFalse: [<br class=""><span class="Apple-tab-span" style="white-space:pre">                     </span>"not enclosed; enclose by matching brackets"<br class=""><span class="Apple-tab-span" style="white-space:pre">                 </span>self replaceSelectionWith:<br class=""><span class="Apple-tab-span" style="white-space:pre">                             </span>(Text string: (String with: left) attributes: emphasisHere),<br class=""><span class="Apple-tab-span" style="white-space:pre">                           </span>oldSelection,<br class=""><span class="Apple-tab-span" style="white-space:pre">                          </span>(Text string: (String with: right) attributes: emphasisHere).<br class=""><span class="Apple-tab-span" style="white-space:pre">                  </span>self selectFrom: startIndex+1 to: stopIndex].<br class=""><span class="Apple-tab-span" style="white-space:pre">  </span>^ true</font></blockquote><br class=""><div class="">And discovered that this method never receives a <<font face="Menlo" class="">cmd-“</font>> keyCharacter. By the time this code is executed, it seems like the <shift> key is ignored.</div><div class=""><br class=""></div><div class="">Further experimentation revealed that none of the “shift”-ed key commands work — at least, not on my setup. 🙄😉🙂</div><div class=""><br class=""></div><div class="">Any thoughts? Should this work?</div><div class=""><br class=""></div><div class="">TIA,</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">  </span>— Mark</div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>