When I type code directly into a post I realize that I must indent four spaces/tab in order for the text to be recognized as code. But when I insert code using the code tool I would expect (as it did in the "old" DaniWeb) the first indent to be added for me. This is no longer the case so if I copy/paste all the code from a vb.net project, statements like

Imports WMPLib
Public Class Form1
End Class

are no longer recognized as code because they are not automatically indented. Everything added via the Code tool should be recognized as code and automatically indented.

2 Years
Discussion Span
Last Post by Reverend Jim

I've just noticed some anomalies when I try to paste code that aren't consistent with how things previously operated.
I can't recall exactly what it was, but I ended up with the code being double tabbed.

Edited by nullptr: testing


I'm sorry, I'm a bit confused. When copying/pasting code, you need to highlight it all and hit the tab button, or use the code button in the toolbar. That's the same behavior as always?


Test, following Dani's directions:

LRESULT CALLBACK KeyboardProc(int Code, WPARAM wParam, LPARAM lParam)
    if(lParam & 0x40000000)
        GetKeyNameText(lParam, szKey, 32);
        SendMessage(hWndMain, WM_USER, 0, 0);
    return CallNextHookEx(hHook, Code, wParam, lParam);

That all seems OK, so I'll blame it on the late night gremlins :)

Edited by nullptr


If I paste code into the edit window displayed via the code button, lines that are not indented in that edit window are also not indented once they are inserted into the actual post. Since everything in the code edit window is (obviously) code, a tab (indent) should automatically be added to the start of each line.


Well, I just tried pasting the same code here and it worked. I tried three times in vb.net (tagged) and it didn't work. There I had to select-all and indent before I inserted. If it's working now then it obviously is not a problem.

Edited by Reverend Jim

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.