MCPcopy Create free account
hub / github.com/BaseXdb/basex / close

Method close

basex-core/src/main/java/org/basex/gui/text/TextEditor.java:882–893  ·  view source on GitHub ↗

Closes a bracket and unindents leading whitespace.

()

Source from the content-addressed store, hash-verified

880 * Closes a bracket and unindents leading whitespace.
881 */
882 private void close() {
883 int p = pos - 1;
884 for(; p >= 0; p--) {
885 final byte b = text[p];
886 if(b == '\n') break;
887 if(!ws(b)) return;
888 }
889 if(++p >= pos) return;
890 start = Math.max(pos - indent(), p);
891 end = Math.max(pos, p);
892 if(start != end) delete();
893 }
894
895 /**
896 * Tries to close an opening tag.

Callers 1

addMethod · 0.95

Calls 4

indentMethod · 0.95
deleteMethod · 0.95
wsMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected