diff --git a/src/editor/Editor.js b/src/editor/Editor.js index 7cf92d98beb..090ed156f85 100644 --- a/src/editor/Editor.js +++ b/src/editor/Editor.js @@ -88,6 +88,7 @@ define(function (require, exports, module) { CLOSE_TAGS = "closeTags", DRAG_DROP = "dragDropText", HIGHLIGHT_MATCHES = "highlightMatches", + LINEWISE_COPY_CUT = "lineWiseCopyCut", SCROLL_PAST_END = "scrollPastEnd", SHOW_CURSOR_SELECT = "showCursorWhenSelecting", SHOW_LINE_NUMBERS = "showLineNumbers", @@ -120,6 +121,7 @@ define(function (require, exports, module) { cmOptions[CLOSE_TAGS] = "autoCloseTags"; cmOptions[DRAG_DROP] = "dragDrop"; cmOptions[HIGHLIGHT_MATCHES] = "highlightSelectionMatches"; + cmOptions[LINEWISE_COPY_CUT] = "lineWiseCopyCut"; cmOptions[SCROLL_PAST_END] = "scrollPastEnd"; cmOptions[SHOW_CURSOR_SELECT] = "showCursorWhenSelecting"; cmOptions[SHOW_LINE_NUMBERS] = "lineNumbers"; @@ -174,6 +176,9 @@ define(function (require, exports, module) { } } }); + PreferencesManager.definePreference(LINEWISE_COPY_CUT, "boolean", true, { + description: Strings.DESCRIPTION_LINEWISE_COPY_CUT + }); PreferencesManager.definePreference(SCROLL_PAST_END, "boolean", false, { description: Strings.DESCRIPTION_SCROLL_PAST_END }); @@ -401,6 +406,7 @@ define(function (require, exports, module) { indentWithTabs : currentOptions[USE_TAB_CHAR], inputStyle : "textarea", // the "contenteditable" mode used on mobiles could cause issues lineNumbers : currentOptions[SHOW_LINE_NUMBERS], + lineWiseCopyCut : currentOptions[LINEWISE_COPY_CUT], lineWrapping : currentOptions[WORD_WRAP], matchBrackets : { maxScanLineLength: 50000, maxScanLines: 1000 }, matchTags : { bothTags: true }, diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 056fb163aa0..3de1a1b187b 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -744,6 +744,7 @@ define({ "DESCRIPTION_LANGUAGE" : "Language specific settings", "DESCRIPTION_LANGUAGE_FILE_EXTENSIONS" : "Additional mappings from file extension to language name", "DESCRIPTION_LANGUAGE_FILE_NAMES" : "Additional mappings from file name to language name", + "DESCRIPTION_LINEWISE_COPY_CUT" : "Doing copy and cut when there's no selection will copy or cut the whole lines that have cursors in them", "DESCRIPTION_LINTING_ENABLED" : "true to enable Code Inspection", "DESCRIPTION_ASYNC_TIMEOUT" : "The time in milliseconds after which asynchronous linters time out", "DESCRIPTION_LINTING_PREFER" : "Array of linters to run first",