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

Rename indent_list_item command to something else #530

Closed
dufferzafar opened this issue Jun 26, 2018 · 12 comments · Fixed by #607
Closed

Rename indent_list_item command to something else #530

dufferzafar opened this issue Jun 26, 2018 · 12 comments · Fixed by #607
Labels
C: plugins Category: plugin related issue

Comments

@dufferzafar
Copy link

dufferzafar commented Jun 26, 2018

When creating lists, pressing Tab used to indent (indent_list_item command.)

But that feature has stopped working for me.

I now need to select the line and press Tab (indent_list_multiitem command) to have it indented properly.

@felixhao28
Copy link
Contributor

indent_list_item is only triggered when you press 'tab' on an empty list item, with the bullet and a space before caret and nothing after, like this:

* |

I don't remember there was another trigger.

@dufferzafar
Copy link
Author

dufferzafar commented Jun 29, 2018

indent_list_item is only triggered when you press 'tab' on an empty list item, with the bullet and a space before caret and nothing after

@felixhao28 Yes, that is exactly how I'm triggering it.

And I know that the command is being triggered because I have sublime.log_commands(True) in the sublime console.

But, the list item is not being indented!

@felixhao28
Copy link
Contributor

Hmm, sounds like a bug but will you share more information so I can reproduce it? Information includes:

  1. Surrounding text
  2. Sublime Text version
  3. MarkdownEditing plugin version
  4. OS

Or if you know python, you can mess around with the source code and see where went wrong.

@dufferzafar
Copy link
Author

  1. Surrounding text: Nothing, really. I can open a new blank file - type * and press Tab. The command gets triggered, but the line doesn't indent.

  2. Sublime Version: 3.1.1 Build 3176. But I remember this issue has been bugging me for a month or so (I just wasn't free to create a report.)

  3. MarkdownEditing Version: 2.2.7

  4. OS: Manjaro, KDE. But I was on Kubuntu before and this was there too.

Yeah, I know Python and I'll look into the source now.

@dufferzafar
Copy link
Author

dufferzafar commented Jun 29, 2018

Woah, this is a weird one.

So, I used PackageResourceViewer to edit the indent_list_item.py file that you linked, and as soon as I open the file and save it without even making any changes, the bug disappears!

So, when I launch sublime text, and all the plugins get loaded for the first time. Then this bug occurs. As in, indent_list_item gets triggered but doesn't indent.

If I so much as save the indent_list_item.py file - triggering a reload of the plugin - the bug disappears. I'm able to indent items properly.

So the issue isn't with this code, per se. But somewhere else?

I'd like to point here, that indent_list_multiitem which is triggered when you have some text selected is working just fine, in all cases.

@dufferzafar
Copy link
Author

@felixhao28 Any thoughts on why this could be occurring? and how I can fix it?

Most of my sublime text config is here: https://github.com/dufferzafar/sublime-text-3

@dufferzafar
Copy link
Author

With great help from folks (OdatNurd & keith) at the Sublime Discord channel I was able to nail this down.

OdatNurd suggested:

Perhaps there is another plugin defining a command with the same name as the one from the plugin and it loads later, so it doesn't do what you want, but reloading that package file manually replaces the replacement

So I looked into Sublime's console log and found the culprit: Restructured Text (RST) Snippets also has an indent_list_item which overrides the one from this package.

Essentially, these two packages are incompatible as they implement commands with the same name.

Would you be willing to change the name of this command to something else?

RST Snippets was last updated many years ago. So I don't think there's any point in making an issue there. For the time being I'll look into editing the source myself. Will post the diff here later.

@dufferzafar dufferzafar changed the title Indent List Item not working Rename indent_list_item command to something else Jul 8, 2018
@felixhao28
Copy link
Contributor

I see. It's the first time MDE's command conflicts with ones from another plugin. I will consider adding a prefix to all command names.

@felixhao28
Copy link
Contributor

Honestly I thought Sublime Text would limit command namespace to one package so such issues should not happen.

@dufferzafar
Copy link
Author

dufferzafar commented Jul 9, 2018 via email

@felixhao28
Copy link
Contributor

Yes, but changing command name will very likely break user-defined hotkeys and snippets. I need to think of a more elegant solution.

@dufferzafar
Copy link
Author

dufferzafar commented Jul 10, 2018 via email

@deathaxe deathaxe added the C: plugins Category: plugin related issue label Jul 25, 2021
@deathaxe deathaxe mentioned this issue Jul 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: plugins Category: plugin related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants