mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
# Conflicts: # CHANGELOG.md
This commit is contained in:
parent
472f179672
commit
37ffbeaf7a
@ -5,6 +5,11 @@ Change Log
|
||||
3.9.7 (unreleased)
|
||||
--------------------------
|
||||
|
||||
### New Features
|
||||
|
||||
- Add new AppleScript/JXA commands `smarten quotes` and `straighten quotes` for `selection` object.
|
||||
|
||||
|
||||
### Fixes
|
||||
|
||||
- Fix the jump button for theme URL.
|
||||
|
@ -439,6 +439,26 @@ For example, when not using the <code>wrap</code> or <code>backwards</code> opti
|
||||
</section>
|
||||
|
||||
|
||||
<section>
|
||||
<h3>smart quotes</h3>
|
||||
|
||||
<dl class="tree">
|
||||
<dt><code class="command">smarten quotes</code></dt>
|
||||
<dd>Convert straight quotes in the selected text to typographical quotes if exists. <span class="added">new on CotEditor 3.9.7</span></dd>
|
||||
|
||||
<dt><code class="command">straighten quotes</code></dt>
|
||||
<dd>Convert typographical quotes in the selected text to straight quotes if exists. <span class="added">new on CotEditor 3.9.7</span></dd>
|
||||
</dl>
|
||||
|
||||
<p>Works only for ‘selection’ objects.</p>
|
||||
|
||||
<figure>
|
||||
<pre class="source"><code class="AppleScript">smarten quotes selection of front document</code></pre>
|
||||
<figcaption>Convert straight quotes in the selected text to typographical quotes.</figcaption>
|
||||
</figure>
|
||||
</section>
|
||||
|
||||
|
||||
<section>
|
||||
<h3>normalize unicode</h3>
|
||||
|
||||
|
@ -17,6 +17,17 @@
|
||||
<h1>Change log of AppleScript support</h1>
|
||||
|
||||
|
||||
<article>
|
||||
<h2>Terminology change on CotEditor 3.9.7</h2>
|
||||
<h3>smart quotes</h3>
|
||||
<p>The following new commands were added to the ‘selection’ object.</p>
|
||||
<ul class="nostyle">
|
||||
<li><code>smarten quotes</code></li>
|
||||
<li><code>straighten quotes</code></li>
|
||||
</ul>
|
||||
</article>
|
||||
|
||||
|
||||
<article>
|
||||
<h2>Terminology change on CotEditor 3.5.0</h2>
|
||||
<h3>editor's opacity</h3>
|
||||
|
@ -438,6 +438,26 @@ lengthが負である場合、指定される範囲は対象ドキュメント
|
||||
</section>
|
||||
|
||||
|
||||
<section>
|
||||
<h3>スマート引用符</h3>
|
||||
|
||||
<dl class="tree">
|
||||
<dt><code class="command">smarten quotes</code></dt>
|
||||
<dd>まっすぐな引用符をカールした引用符に変更する。<span class="added">CotEditor 3.9.7で追加</span></dd>
|
||||
|
||||
<dt><code class="command">straighten quotes</code></dt>
|
||||
<dd>カールした引用符をまっすぐな引用符に変更する。<span class="added">CotEditor 3.9.7で追加</span></dd>
|
||||
</dl>
|
||||
|
||||
<p>対象にできるのは`selection`オブジェクトだけです。</p>
|
||||
|
||||
<figure>
|
||||
<pre class="source"><code class="AppleScript">smarten quotes selection of front document</code></pre>
|
||||
<figcaption>選択位置の引用符をカールしたものに変換する。</figcaption>
|
||||
</figure>
|
||||
</section>
|
||||
|
||||
|
||||
<section>
|
||||
<h3>normalize unicode</h3>
|
||||
|
||||
|
@ -17,6 +17,19 @@
|
||||
<h1>AppleScript対応の仕様改訂履歴</h1>
|
||||
|
||||
|
||||
<article>
|
||||
<h2>CotEditor 3.9.7での仕様改訂</h2>
|
||||
<section>
|
||||
<h3>スマート引用符</h3>
|
||||
<p>selectionオブジェクトに新しく以下のコマンドが追加されました。</p>
|
||||
<ul class="nostyle">
|
||||
<li><code>smarten quotes</code></li>
|
||||
<li><code>straighten quotes</code></li>
|
||||
</ul>
|
||||
</section>
|
||||
</article>
|
||||
|
||||
|
||||
<article>
|
||||
<h2>CotEditor 3.5.0での仕様改訂</h2>
|
||||
<h3>エディタの不透明度</h3>
|
||||
|
@ -146,6 +146,12 @@
|
||||
<responds-to command="uncomment">
|
||||
<cocoa method="handleUncomment:"/>
|
||||
</responds-to>
|
||||
<responds-to command="smarten quotes">
|
||||
<cocoa method="handleSmartenQuotes:"/>
|
||||
</responds-to>
|
||||
<responds-to command="straighten quotes">
|
||||
<cocoa method="handleStraightenQuotes:"/>
|
||||
</responds-to>
|
||||
<responds-to command="normalize unicode">
|
||||
<cocoa method="handleNormalizeUnicode:"/>
|
||||
</responds-to>
|
||||
@ -311,6 +317,16 @@
|
||||
<result type="text"/>
|
||||
</command>
|
||||
|
||||
<command name="smarten quotes" code="cEd1SmQt" description="Convert straight quotes to typographical quotes.">
|
||||
<access-group identifier="com.coteditor.CotEditor.edit" access="rw"/>
|
||||
<direct-parameter type="text selection" description="The selection to normalize."/>
|
||||
</command>
|
||||
|
||||
<command name="straighten quotes" code="cEd1StQt" description="Convert typographical quotes to straight quotes.">
|
||||
<access-group identifier="com.coteditor.CotEditor.edit" access="rw"/>
|
||||
<direct-parameter type="text selection" description="The selection to normalize."/>
|
||||
</command>
|
||||
|
||||
<command name="normalize unicode" code="cEd1UNml" description="Normalize Unicode.">
|
||||
<access-group identifier="com.coteditor.CotEditor.edit" access="rw"/>
|
||||
<direct-parameter type="text selection" description="The selection to normalize."/>
|
||||
|
@ -307,6 +307,20 @@ final class TextSelection: NSObject {
|
||||
}
|
||||
|
||||
|
||||
/// convert straight quotes to typographical pairs
|
||||
@objc func handleSmartenQuotes(_ command: NSScriptCommand) {
|
||||
|
||||
self.textView?.perform(Selector(("replaceQuotesInSelection:")))
|
||||
}
|
||||
|
||||
|
||||
/// convert typographical (curly) quotes to straight
|
||||
@objc func handleStraightenQuotes(_ command: NSScriptCommand) {
|
||||
|
||||
self.textView?.straightenQuotesInSelection(command)
|
||||
}
|
||||
|
||||
|
||||
/// Unicode normalization
|
||||
@objc func handleNormalizeUnicode(_ command: NSScriptCommand) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user