gets indentation size depending whether the tabs or spaces are used
550013
function _getIndentSize(fullPath) {
        return Editor.getUseTabChar(fullPath) ? Editor.getTabSize(fullPath) : Editor.getSpaceUnits(fullPath);
    }
1070060
def _updateTabStopWidth(self):
        
        self.setTabStopWidth(self.fontMetrics().width(' ' * self._indenter.width))
896889
def _get_starting_indent(source):
  """"""
  if source.startswith(" "):
    return sum(1 for _ in itertools.takewhile(lambda c: c in {' ', b' '}, source))
  return 0
307965
def _get_indent(marker, s, tab_width=8):
    """"""
    # Figure out how much the marker is indented.
    INDENT_CHARS = tuple(' \t')
    start = s.index(marker)
    i = start
    while i > 0:
        if s[i - 1] not in INDENT_CHARS:
            break
        i -= 1
    indent = s[i:start]
    indent_width = 0
    for ch in indent:
        if ch == ' ':
            indent_width += 1
        elif ch == '\t':
            indent_width += tab_width - (indent_width % tab_width)
    return indent, indent_width
1042820
def indent(indent_str=None):
    

    def indentation_rule():
        inst = Indentator(indent_str)
        return {'layout_handlers': {
            OpenBlock: layout_handler_openbrace,
            CloseBlock: layout_handler_closebrace,
            EndStatement: layout_handler_semicolon,
            Space: layout_handler_space_imply,
            OptionalSpace: layout_handler_space_optional_pretty,
            RequiredSpace: layout_handler_space_imply,
            Indent: inst.layout_handler_indent,
            Dedent: inst.layout_handler_dedent,
            Newline: inst.layout_handler_newline,
            OptionalNewline: inst.layout_handler_newline_optional,
            (Space, OpenBlock): NotImplemented,
            (Space, EndStatement): layout_handler_semicolon,
            (OptionalSpace, EndStatement): layout_handler_semicolon,
            (Indent, Newline, Dedent): rule_handler_noop,
        }}
    return indentation_rule
575302
def Indentation( logical_line,
                 previous_logical,
                 indent_level,
                 previous_indent_level ):
  """"""
  comment = '' if logical_line else ' (comment)'
  if indent_level % 2:
    code = 'YCM111' if logical_line else 'YCM114'
    message = ' indentation is not a multiple of two spaces' + comment
    yield 0, code + message
  if ( previous_logical.endswith( ':' ) and
       ( indent_level - previous_indent_level != 2 ) ):
    code = 'YCM112' if logical_line else 'YCM115'
    message = ' expected an indented block of {} spaces{}'.format(
      previous_indent_level + 2, comment )
    yield 0, code + message
422877
function checkLength(str) {
        var ctm = ctx.measureText(str);
        return ctm.width <= tm.width;
      }
1362151
def get_block_indentation(self, block_nb):
        """"""
        text = to_text_string(self.document().findBlockByNumber(block_nb).text())
        text = text.replace("\t", " "*self.tab_stop_width_spaces)
        return len(text)-len(text.lstrip())
1333285
function conditionalIndent (result)
  {
    return result.status === STAT.INDENTED ? result.data : indent (result.data, 1, options.indent);
  }
416840
private int getSelectedTab() {
        String theme = "default";
        List<PageParameters.NamedPair> pairs = getPageParameters().getAllNamed();
        theme = pairs.get(0).getValue();
        if ("grid".equals(theme)) {
            return 1;
        } else if ("skies".equals(theme)) {
            return 2;
        } else if ("gray".equals(theme)) {
            return 3;
        } else if ("darkblue".equals(theme)) {
            return 4;
        } else if ("darkgreen".equals(theme)) {
            return 5;
        } else {
            return 0;
        }
    }
423058
def indented_script(self) -> bool:
        '''  '''
        # get all leading space, tab and newline
        leading = INDENTED.match(self._script)
        return 0 if leading is None else len(leading.group(2))
903409
def _get_cols_width(self):
        """"""

        tab = self.grid.current_table
        no_cols = self.grid.code_array.shape[1]
        default_col_width = self.grid.code_array.cell_attributes.\
            default_cell_attributes["column-width"]

        non_standard_col_widths = []
        __col_widths = self.grid.code_array.col_widths
        for __col, __tab in __col_widths:
            if __tab == tab:
                non_standard_col_widths.append(__col_widths[(__col, __tab)])

        cols_width = sum(non_standard_col_widths)
        cols_width += \
            (no_cols - len(non_standard_col_widths)) * default_col_width

        return cols_width
422597
protected function getIndentation()
    {
        if ($this->document) {
            if ($this->document->getConfig()->get(FormatterInterface::CFG_USE_TABS)) {
                $indentation = "\t";
            } else {
                $indentation = str_repeat(' ', $this->document->getConfig()->get(FormatterInterface::CFG_INDENTATION));
            }

            return str_repeat($indentation, $this->indentation);
        }
    }
70728
function expandTabs(content, tabWidth) {
    var idx = 0;

    // while we're not at the end of the string:
    // - is the character at the current position a tab?
    // - yes, replace with spaces and move the current position forward
    // - no, jump to the character after the next newline
    while (idx > -1 && idx < content.length) {
      while (content[idx] === '\t') {
        content = content.substring(0, idx) + repeat(' ', tabWidth) + content.substring(idx+1);
        idx += tabWidth;
      }
      idx = content.indexOf('\n', idx);

      // if there are no `\n` characters, break
      if (idx === -1) { break; }

      idx += 1;
    }

    return content;
  }
610840
private String getRowFormat(List<Integer> widths) {
    StringBuilder rowFormat = new StringBuilder(spaces(this.indentation));
    for (int i=0; i< widths.size(); i++) {
      rowFormat.append("%");
      rowFormat.append(this.flags != null ? this.flags.get(i) : "");
      rowFormat.append(widths.get(i).toString());
      rowFormat.append("s");
      rowFormat.append(spaces(this.delimiterWidth));
    }
    rowFormat.append("\n");

    return rowFormat.toString();
  }
386080
public String tabsToSpaces(String string)
    {
        int iOffset = 0;
        for (int i = 0; i < string.length(); i++)
        {
            if (string.charAt(i) == '\n')
                iOffset = i + 1;
            if (string.charAt(i) == '\t')
            {
                int iSpaces = (i - iOffset) % 4;
                if (iSpaces == 0)
                    iSpaces = 4;
                string = string.substring(0, i) + FOUR_SPACES.substring(0, iSpaces) + string.substring(i + 1);
            }
        }
        return string;
    }
980751
def count_indents_last_line(self, spacecount, tabs=0, back=5):
        
        if not self.has_space():
            return 0
        lines = self.get_surrounding_lines(back, 0)

        for line in reversed(lines):
            if not line.string.isspace():
                return line.count_indents(spacecount, tabs)
        return 0