forked from bartvdbraak/blender
patch #3830 Fix for commenting a block of text with highlight enabled
Highlighting would not update when you un/commented a block of code. Contributed by Ricki Myers (themyers).
This commit is contained in:
parent
f146e0e04e
commit
977c201bc0
@ -1539,7 +1539,14 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
}
|
||||
break; /* BREAK C */
|
||||
case DKEY:
|
||||
if (G.qual == LR_CTRLKEY) {
|
||||
if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY)) {
|
||||
//uncommenting
|
||||
txt_order_cursors(text);
|
||||
uncomment(text);
|
||||
do_draw = 1;
|
||||
if (st->showsyntax) get_format_string();
|
||||
break;
|
||||
} else if (G.qual == LR_CTRLKEY) {
|
||||
txt_delete_char(text);
|
||||
if (st->showsyntax) get_format_string();
|
||||
do_draw= 1;
|
||||
|
@ -365,6 +365,7 @@ static void do_text_formatmenu(void *arg, int event)
|
||||
if ( txt_has_sel(text)) {
|
||||
txt_order_cursors(text);
|
||||
comment(text);
|
||||
if (st->showsyntax) get_format_string();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@ -372,6 +373,7 @@ static void do_text_formatmenu(void *arg, int event)
|
||||
if ( txt_has_sel(text)) {
|
||||
txt_order_cursors(text);
|
||||
uncomment(text);
|
||||
if (st->showsyntax) get_format_string();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@ -437,7 +439,7 @@ static uiBlock *text_formatmenu(void *arg_unused)
|
||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unindent|Shift Tab", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
|
||||
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Comment", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Uncomment", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Uncomment|Ctrl Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
|
||||
|
||||
if(curarea->headertype==HEADERTOP) {
|
||||
uiBlockSetDirection(block, UI_DOWN);
|
||||
|
Loading…
Reference in New Issue
Block a user