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

[WIP] Fix whitespace/tab j/k issues #859

Closed
wants to merge 1 commit into from

Conversation

johnfn
Copy link
Member

@johnfn johnfn commented Oct 8, 2016

This is an implementation that sort of works but is annoying.

Does anyone know a better way to do this?

  • @rebornix, others - tabstop does not always report the correct width of a tab - it seems like the setting can be overridden in-editor somehow. Do you know how to get the right width?
  • anyone (but maybe @rebornix knows..?) - is there some provided way to move up/down through a document that has spaces and tabs while keeping the cursor on the right column?

@xconverge
Copy link
Member

xconverge commented Oct 9, 2016

@johnfn I have some stuff stashed from yesterday that is done EXACTLY the same way as this but I didnt get to finish the implementation for up, I only did down and came to similar conclusions that it felt crazy...

What you are looking for is

vscode.window.activeTextEditor.options.tabSize;

I added a getTabSize() to TextEditor that returned this

@johnfn
Copy link
Member Author

johnfn commented Oct 9, 2016

Aww haha man sorry @xconverge! Good find on the tabSize thing though. Perhaps we should use that in Configuration.

You can always let me know on slack or whatever if you're working on a bigger feature. Also don't be afraid of opening WIP PRs earlier rather than later. :)

@xconverge xconverge mentioned this pull request Oct 10, 2016
@rebornix
Copy link
Member

@johnfn I missed this PR for a long time. Yes @xconverge is right, that reading config from activeTextEditor.options is always correct. About moving cursor up and down without calculating desired column ourselves is command cursorMove, you have seen that quite a few times when I implemented those scrolling features.

@xconverge
Copy link
Member

@johnfn @rebornix Is this fixed somehow (assuming vscode reports different character values now?) assuming #842 is now closed?

@johnfn
Copy link
Member Author

johnfn commented Nov 23, 2016

How could this be fixed?? o_O

@xconverge
Copy link
Member

My thought is that vscode may report a tab char as more than 1?

@johnfn
Copy link
Member Author

johnfn commented Nov 23, 2016

That would be weird because then what would it mean to insert at character 1 on a line filled with tabs?

meh, if it works it works :P

@jpoon
Copy link
Member

jpoon commented Feb 21, 2017

Spring cleaning. Closing this PR as there hasn't been movement in awhile. Feel free to re-open.

@jpoon jpoon closed this Feb 21, 2017
@jpoon jpoon deleted the fix-tab-and-whitespace-mixing branch April 25, 2017 07:04
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.

4 participants