Don't surround bracketize brackets when you're trying to overwrite them
This commit is contained in:
parent
999bf92801
commit
2950c67e3e
1 changed files with 4 additions and 4 deletions
|
|
@ -40,7 +40,7 @@ var CstyleBehaviour = function () {
|
|||
if (text == '{') {
|
||||
var selection = editor.getSelectionRange();
|
||||
var selected = session.doc.getTextRange(selection);
|
||||
if (selected !== "") {
|
||||
if (selected !== "" && selected !== "}") {
|
||||
return {
|
||||
text: '{' + selected + '}',
|
||||
selection: false
|
||||
|
|
@ -100,7 +100,7 @@ var CstyleBehaviour = function () {
|
|||
if (text == '(') {
|
||||
var selection = editor.getSelectionRange();
|
||||
var selected = session.doc.getTextRange(selection);
|
||||
if (selected !== "") {
|
||||
if (selected !== "" && selected !== ")") {
|
||||
return {
|
||||
text: '(' + selected + ')',
|
||||
selection: false
|
||||
|
|
@ -143,7 +143,7 @@ var CstyleBehaviour = function () {
|
|||
if (text == '[') {
|
||||
var selection = editor.getSelectionRange();
|
||||
var selected = session.doc.getTextRange(selection);
|
||||
if (selected !== "") {
|
||||
if (selected !== "" && selected !== "]") {
|
||||
return {
|
||||
text: '[' + selected + ']',
|
||||
selection: false
|
||||
|
|
@ -187,7 +187,7 @@ var CstyleBehaviour = function () {
|
|||
var quote = text;
|
||||
var selection = editor.getSelectionRange();
|
||||
var selected = session.doc.getTextRange(selection);
|
||||
if (selected !== "") {
|
||||
if (selected !== "" && selected !== "'") {
|
||||
return {
|
||||
text: quote + selected + quote,
|
||||
selection: false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue