Skip to content

Instantly share code, notes, and snippets.

@jenokizm
jenokizm / Client.cpp
Created May 21, 2018 19:42
boost asio problem back message
// Client.cpp: определяет точку входа для консольного приложения.
//
#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable : 4996)
#include "stdafx.h"
#define _WIN32_WINNT 0x0501
#include <stdio.h>
#include <iostream>
private void Scintilla_InsertCheck(object sender, InsertCheckEventArgs e)
{
if ((e.Text.EndsWith("" + Constants.vbCr) || e.Text.EndsWith("" + Constants.vbLf))) {
int startPos = Scintilla.Lines(Scintilla.LineFromPosition(Scintilla.CurrentPosition)).Position;
int endPos = e.Position;
string curLineText = Scintilla.GetTextRange(startPos, (endPos - startPos)); //Text until the caret so that the whitespace is always equal in every line.
Match indent = Regex.Match(curLineText, "^[ \\t]*");
e.Text = (e.Text + indent.Value);
if (Regex.IsMatch(curLineText, "{\\s*$")) {