textModelGuides.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*---------------------------------------------------------------------------------------------
  2. * Copyright (c) Microsoft Corporation. All rights reserved.
  3. * Licensed under the MIT License. See License.txt in the project root for license information.
  4. *--------------------------------------------------------------------------------------------*/
  5. export var HorizontalGuidesState;
  6. (function (HorizontalGuidesState) {
  7. HorizontalGuidesState[HorizontalGuidesState["Disabled"] = 0] = "Disabled";
  8. HorizontalGuidesState[HorizontalGuidesState["EnabledForActive"] = 1] = "EnabledForActive";
  9. HorizontalGuidesState[HorizontalGuidesState["Enabled"] = 2] = "Enabled";
  10. })(HorizontalGuidesState || (HorizontalGuidesState = {}));
  11. export class IndentGuide {
  12. constructor(visibleColumn, column, className,
  13. /**
  14. * If set, this indent guide is a horizontal guide (no vertical part).
  15. * It starts at visibleColumn and continues until endColumn.
  16. */
  17. horizontalLine,
  18. /**
  19. * If set (!= -1), only show this guide for wrapped lines that don't contain this model column, but are after it.
  20. */
  21. forWrappedLinesAfterColumn, forWrappedLinesBeforeOrAtColumn) {
  22. this.visibleColumn = visibleColumn;
  23. this.column = column;
  24. this.className = className;
  25. this.horizontalLine = horizontalLine;
  26. this.forWrappedLinesAfterColumn = forWrappedLinesAfterColumn;
  27. this.forWrappedLinesBeforeOrAtColumn = forWrappedLinesBeforeOrAtColumn;
  28. if ((visibleColumn !== -1) === (column !== -1)) {
  29. throw new Error();
  30. }
  31. }
  32. }
  33. export class IndentGuideHorizontalLine {
  34. constructor(top, endColumn) {
  35. this.top = top;
  36. this.endColumn = endColumn;
  37. }
  38. }