This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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*$")) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Client.cpp: определяет точку входа для консольного приложения. | |
// | |
#define _CRT_SECURE_NO_WARNINGS | |
#pragma warning(disable : 4996) | |
#include "stdafx.h" | |
#define _WIN32_WINNT 0x0501 | |
#include <stdio.h> | |
#include <iostream> |