Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab handling #2487

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Tab handling #2487

wants to merge 6 commits into from

Conversation

harshad1
Copy link
Collaborator

In this PR we add support for using the TAB key for indenting (SHIFT-TAB to deindent). Made some associated fixes too.


ext = ext.trim();
ext = ext.startsWith(".") ? ext.substring(1) : ext;
return _extSettingCache.contains(ext) || _extSettingCache.contains("*");
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uniformly dropping leading dots

isEmpty = (lineEnd - lineStart) == indent;
isEmpty = line.trim().isEmpty();
final int[] counts = GsTextUtils.countChars(line, 0, textOffset, ' ', '\t');
indent = counts[0] + counts[1] * 4;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Treating a tab as 4 spaces


public ListLine(CharSequence text, int position, FormatPatterns patterns) {
this.text = text;
this.patterns = patterns;

lineStart = TextViewUtils.getLineStart(text, position);
lineEnd = TextViewUtils.getLineEnd(text, position);
indent = TextViewUtils.getNextNonWhitespace(text, lineStart) - lineStart;
textOffset = TextViewUtils.getNextNonWhitespace(text, lineStart);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is number of characters to the first non-whitespace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant