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

Meta and tab on OS X broken? #179

Open
wcray opened this issue Aug 21, 2017 · 3 comments
Open

Meta and tab on OS X broken? #179

wcray opened this issue Aug 21, 2017 · 3 comments

Comments

@wcray
Copy link

wcray commented Aug 21, 2017

Sublime Text 3 (build 3126), OS X 10.11.5. Plain-vanilla sublemacspro configuration. Plain-vanilla (as far as I can recall, sublime text).

None of Option, Alt, Command, or escape, appear to invoke the expected Meta-key functionality. Ctrl+ functions work as expected. This is true regardless of the true/false status of sbp_use_alt_bindings and sbp_use_super_bindings.

Tab looks like it is cycling through completions if you're within a word, otherwise it inserts a tab (or spaces), rather than invoking reindent

I'm guessing this might be a configuration/interaction problem, rather than a code-side bug, but I'm not sure where to start looking. If someone could give me some hints where to start, I'm happy to help.

@wcray
Copy link
Author

wcray commented Aug 21, 2017

And, bizarrely, I have screwed around with the settings for a few hours, and all of the sudden Option+ seems to be working - even after I delete all of the User settings and put everything back to defaults...

Tab still isn't working properly. We'll see if this behavior persists.

@canoeberry
Copy link
Collaborator

canoeberry commented Aug 26, 2017 via email

@wcray
Copy link
Author

wcray commented Aug 29, 2017

Unfortunately I kind of gave up on pursuing this when I came to the conclusion that coercing reindentation to behave like emacs reindentation was beyond what could be accomplished by simple configuration modifications to Sublime Text and sublime-emacs/sublemacspro.

I believe I have isolated the Tab issue to the Default (OSX).sublime-keymap configuration for "tab". The last two context lines, to my eye, don't appear to make sense, and seem to be the culprit that was preventing Tab from invoking reindentation.

{ "key": "preceding_text", "operator": "regex_match", "operand": "^$", "match_all": true },
{ "key": "following_text", "operator": "regex_match", "operand": "^$", "match_all": true }

I'm a little rusty these days so I could be wrong (I spent a few decades deep in Regex-land in a previous life), but -- those lines appear to require empty lines before and after the current cursor context, to enable the reindent interpretation of Tab. That's decidedly not what an emacs user used to CC-mode reindentation would expect to be correct behavior.

Removing these context-requirement lines causes Tab to work as expected (though I haven't gotten my head around how to write an appropriate replacement that requires a code-containing buffer context for re-indent, so that normal tabs can be used in text buffers).

I wish I had time to write a proper re-indentation module for Sublime Text. With Sublime-emacs/sublemacpro to port over functionality that I rely on like the kill ring, Sublime Text is /so/ close to being a solid replacement for emacs. I really wish I could get there.

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

No branches or pull requests

2 participants