MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / FindColumn

Method FindColumn

scintilla/src/Document.cxx:1166–1188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1164}
1165
1166int Document::FindColumn(int line, int column) {
1167 int position = LineStart(line);
1168 if ((line >= 0) && (line < LinesTotal())) {
1169 int columnCurrent = 0;
1170 while ((columnCurrent < column) && (position < Length())) {
1171 char ch = cb.CharAt(position);
1172 if (ch == '\t') {
1173 columnCurrent = NextTab(columnCurrent, tabInChars);
1174 if (columnCurrent > column)
1175 return position;
1176 position++;
1177 } else if (ch == '\r') {
1178 return position;
1179 } else if (ch == '\n') {
1180 return position;
1181 } else {
1182 columnCurrent++;
1183 position = NextPosition(position, 1);
1184 }
1185 }
1186 }
1187 return position;
1188}
1189
1190void Document::Indent(bool forwards, int lineBottom, int lineTop) {
1191 // Dedent - suck white space off the front of the line to dedent by equivalent of a tab

Callers 2

LayoutLineMethod · 0.80
WndProcMethod · 0.80

Calls 3

LineStartFunction · 0.85
NextTabFunction · 0.85
CharAtMethod · 0.45

Tested by

no test coverage detected