This commit is contained in:
Liang Ding 2014-11-08 14:28:41 +08:00
parent 984d93773e
commit 0dfa779ebb
7 changed files with 40 additions and 23 deletions

View File

@ -8,6 +8,7 @@ import (
func main() { func main() {
for i := 0; i < 50; i++ { for i := 0; i < 50; i++ {
fmt.Println("Hello, 世界", pkg.Now()) fmt.Println("Hello, 世界", pkg.Now())
time.Sleep(time.Second) time.Sleep(time.Second)

View File

@ -74,8 +74,8 @@
"show_expr_info": "Show Expression Info", "show_expr_info": "Show Expression Info",
"find_usages": "Find Usages", "find_usages": "Find Usages",
"delete_line": "Delete Line", "delete_line": "Delete Line",
"copy_line_up": "Copy Line Up", "copy_lines_up": "Copy Lines Up",
"copy_line_down": "Copy Line Down", "copy_lines_down": "Copy Lines Down",
"save_editor_file": "Save File", "save_editor_file": "Save File",
"save_all_editors_files": "Save All", "save_all_editors_files": "Save All",
"close_editor": "Close File", "close_editor": "Close File",

View File

@ -74,8 +74,8 @@
"show_expr_info": "式の情報を表示", "show_expr_info": "式の情報を表示",
"find_usages": "使用方法を検索する", "find_usages": "使用方法を検索する",
"delete_line": "行を削除", "delete_line": "行を削除",
"copy_line_up": "前行にコピー", "copy_lines_up": "フロントへのコピー",
"copy_line_down": "次行にコピー", "copy_lines_down": "一番下にコピー",
"save_editor_file": "保存", "save_editor_file": "保存",
"save_all_editors_files": "全てを保存", "save_all_editors_files": "全てを保存",
"close_editor": "エディタを閉じる", "close_editor": "エディタを閉じる",

View File

@ -74,8 +74,8 @@
"show_expr_info": "查看表达式信息", "show_expr_info": "查看表达式信息",
"find_usages": "查找使用", "find_usages": "查找使用",
"delete_line": "删除当前行", "delete_line": "删除当前行",
"copy_line_up": "复制当前行到上一行", "copy_lines_up": "复制到上方",
"copy_line_down": "复制当前行到下一行", "copy_lines_down": "复制到下方",
"save_editor_file": "保存当前编辑器文件", "save_editor_file": "保存当前编辑器文件",
"save_all_editors_files": "保存所有编辑器文件", "save_all_editors_files": "保存所有编辑器文件",
"close_editor": "关闭当前编辑器", "close_editor": "关闭当前编辑器",

View File

@ -74,8 +74,8 @@
"show_expr_info": "查看表達式信息", "show_expr_info": "查看表達式信息",
"find_usages": "尋找使用", "find_usages": "尋找使用",
"delete_line": "删除當前行", "delete_line": "删除當前行",
"copy_line_up": "插入當前行到上一行", "copy_lines_up": "複製到上方",
"copy_line_down": "插入當前行到下一行", "copy_lines_down": "複製到下方",
"save_editor_file": "保存當前編輯器文件", "save_editor_file": "保存當前編輯器文件",
"save_all_editors_files": "保存所有編輯器文件", "save_all_editors_files": "保存所有編輯器文件",
"close_editor": "關閉當前編輯器", "close_editor": "關閉當前編輯器",

View File

@ -628,26 +628,42 @@ var editors = {
} }
}, },
"Shift-Ctrl-Up": function (cm) { "Shift-Ctrl-Up": function (cm) {
var cursor = cm.getCursor(); var content = '',
var line = cursor.line; selectoion = cm.listSelections()[0],
var content = cm.getLine(line); cursor = cm.getCursor();
if (0 === line) { var from = selectoion.anchor.line,
cm.replaceRange("", CodeMirror.Pos(0)); to = selectoion.head.line;
line++; if (from > to) {
from = selectoion.head.line;
to = selectoion.anchor.line;
} }
cm.replaceRange("\n" + content, CodeMirror.Pos(line - 1)); for (var i = from, max = to; i <= max; i++) {
content += '\n' + cm.getLine(i);
}
cm.replaceRange(content, CodeMirror.Pos(to));
cm.setCursor(cursor); cm.setCursor(cursor);
}, },
"Shift-Ctrl-Down": function (cm) { "Shift-Ctrl-Down": function (cm) {
var cursor = cm.getCursor(); var content = '',
var line = cursor.line; selectoion = cm.listSelections()[0],
var content = cm.getLine(line); cursor = cm.getCursor();
cm.replaceRange("\n", CodeMirror.Pos(line)); var from = selectoion.anchor.line,
cm.replaceRange(content, CodeMirror.Pos(line + 1)); to = selectoion.head.line;
cm.setCursor(CodeMirror.Pos(line + 1, cursor.ch)); if (from > to) {
from = selectoion.head.line;
to = selectoion.anchor.line;
}
for (var i = from, max = to; i <= max; i++) {
content += '\n' + cm.getLine(i);
}
cm.replaceRange(content, CodeMirror.Pos(to));
cm.setCursor(CodeMirror.Pos(to + (to - from) + 1, cursor.ch));
} }
} }
}); });

View File

@ -15,8 +15,8 @@
<li>Alt-Shift-F{{.i18n.colon}}{{.i18n.format}}</li> <li>Alt-Shift-F{{.i18n.colon}}{{.i18n.format}}</li>
<li>Ctrl-L{{.i18n.colon}}{{.i18n.goto_line}}</li> <li>Ctrl-L{{.i18n.colon}}{{.i18n.goto_line}}</li>
<li>Ctrl-E{{.i18n.colon}}{{.i18n.delete_line}}</li> <li>Ctrl-E{{.i18n.colon}}{{.i18n.delete_line}}</li>
<li>Shift-Ctrl-Up{{.i18n.colon}}{{.i18n.copy_line_up}}</li> <li>Shift-Ctrl-Up{{.i18n.colon}}{{.i18n.copy_lines_up}}</li>
<li>Shift-Ctrl-Down{{.i18n.colon}}{{.i18n.copy_line_down}}</li> <li>Shift-Ctrl-Down{{.i18n.colon}}{{.i18n.copy_lines_down}}</li>
<li>Ctrl-S{{.i18n.colon}}{{.i18n.save_editor_file}}</li> <li>Ctrl-S{{.i18n.colon}}{{.i18n.save_editor_file}}</li>
<li>Shift-Ctrl-S{{.i18n.colon}}{{.i18n.save_all_editors_files}}</li> <li>Shift-Ctrl-S{{.i18n.colon}}{{.i18n.save_all_editors_files}}</li>
<li>Ctrl-Q{{.i18n.colon}}{{.i18n.close_editor}}</li> <li>Ctrl-Q{{.i18n.colon}}{{.i18n.close_editor}}</li>