SublimeText / AdvancedNewFile

File creation plugin for Sublime Text

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Syntax highlighting after rename extension works only after file reopen

aleos7 opened this issue · comments

After creating file in Sublime Text 3 I sometimes forgot explicity set file extension (.rb in my case) when saving it. Add source code to file, e.g. "class ClassName ... def ... end end". All text is gray colored as expected (file hasn't extension at the moment). Catch this behavior. Rename file adding to them .rb extension. But all text stayed gray. Close file. Open it. At the moment syntax is highlighted like ruby color scheme as .rb extension "say".

@aleos7 is this sitll an issue? I just tried on latest version of the plugin and it appears to work as expected. Note I was using the rename function within AdvancedNewFile.

@skuroda Yes, it is. I've check out versions. Sublime Text 3 has version 3126, plugin version is 1.7.0. I'm renaming file through popuup menu on file in sublime too. The behaviour seems strange ...

Ah, you're using the context menu. That's independent of this plugin (which also provides renaming capability).

Try using ANF: Rename File from command menu. Alternatively, you can create a Side Bar.sublime-menu file in your User package with the content

[
    { "caption": "ANF: Rename", "command": "advanced_new_file_move_at", "args": {"files": []} },
]

to use the ANF version of the command.

Thank you! Sorry for my wrong use case for ANF.

No problem at all! My apologies for taking so long to look into it.

Fixed command name in previous comment. Should be advanced_new_file_move_at

Thank you very much!