Skip to content

Commit

Permalink
fix selected multiple lines emphasize action is bad. [#27](#27)
Browse files Browse the repository at this point in the history
modify mac install ui
  • Loading branch information
zhuzhuyule committed Mar 28, 2018
1 parent 6835e9d commit ba4667d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Binary file modified icons/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "HexoEditor",
"version": "1.5.28",
"version": "1.5.29",
"description": "This is markdown editor for Hexo.",
"main": "app/index.js",
"scripts": {
Expand Down Expand Up @@ -41,12 +41,12 @@
"iconSize": 80,
"contents": [
{
"x": 192,
"y": 344
"x": 80,
"y": 200
},
{
"x": 448,
"y": 344,
"x": 334,
"y": 200,
"type": "link",
"path": "/Applications"
}
Expand Down
8 changes: 6 additions & 2 deletions views/main/CodeMirror/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,10 +613,14 @@ module.exports = (() => {
var newModifiers = changeModifiers(wordsInfo.modifiers, item, reg);
//计算 修饰符 变化长度
var changeLength = newModifiers.length - wordsInfo.modifiers.length;

//修改选词位置信息 及 包含修饰符后的 位置信息
wordsInfo.range.startWord.ch += changeLength;
wordsInfo.range.endWord.ch += changeLength;
// wordsInfo.range.end.ch += changeLength*2; //修饰符变化,尾部位置双倍长度变化
if( wordsInfo.range.endWord.line === wordsInfo.range.startWord.line){
//同行情况下,末尾选中位置也 增加或者减少 变化的长度
wordsInfo.range.endWord.ch += changeLength;
// wordsInfo.range.end.ch += changeLength*2; //修饰符变化,尾部位置双倍长度变化
}

editor.replaceRange(newModifiers + wordsInfo.words + reverseStr(newModifiers), wordsInfo.range.start, wordsInfo.range.end);
editor.setSelection(wordsInfo.range.startWord, wordsInfo.range.endWord);
Expand Down

0 comments on commit ba4667d

Please sign in to comment.