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

Greater sign does not work in my Windows Sublime installation #106

Open
gfranz opened this issue Nov 28, 2012 · 88 comments
Open

Greater sign does not work in my Windows Sublime installation #106

gfranz opened this issue Nov 28, 2012 · 88 comments

Comments

@gfranz
Copy link

gfranz commented Nov 28, 2012

Funnily enough in the CFML (do not use) syntax it works. Just in the ColdFusion Markup and Coldfusion Component Syntax it does not work.

HELP!

Gert

@gfranz
Copy link
Author

gfranz commented Nov 28, 2012

Seems like my Key Bindings and User Bindings are empty. So I assume that has to do with it. I really wonder since syntax highlighting works and so the package must have been installed properly.

@gfranz
Copy link
Author

gfranz commented Nov 28, 2012

Fixed it by installing everything again. Thanks anyway

@gfranz gfranz closed this as completed Nov 28, 2012
@danwatt
Copy link

danwatt commented Dec 17, 2012

This exact issue happens to me periodically as well on my Mac installation. The only solution is to remove the package and re-add it.

@atomi atomi reopened this Dec 17, 2012
@atomi
Copy link
Contributor

atomi commented Dec 17, 2012

Hey @danwatt
Is there a specific region in the editor where the greater than sign isn't working, or is it just not working anywhere in the editor? Does this happen in cfscript or cfscript cfc's as well? If you open a new empty cfm file is the greater than sign still not working there either? Does copying and pasting a greater than sign work? When this happens again can you check to see if you remove the sublime-keymap files from the ColdFusion folder and restart Sublime fixes the problem.

Unfortunately I'm going to need more information since, I just haven't been able to replicate this issue.
Thanks.

@danwatt
Copy link

danwatt commented Dec 17, 2012

I have for sure encountered this in CFMs that have CFScript blocks in them. I have not tried creating a new empty file. Copy and pasting works fine.

I will check the keymap file next time it happens, and post a gist of a file that exhibits this behavior.

@atomi
Copy link
Contributor

atomi commented Feb 5, 2013

If you're having problems with this please let me know the following:

Enter console (`ctrl+``) and type:

view.window().run_command('close_cftag')

it should print the character > at your cursor.

What does the console pane output when you enter

sublime.log_input(True)
sublime.log_commands(True)

and type the > character in a cfm file?

Is the > key not working in both cfc and cfm files or in just some parts of some files?
If it's just some parts please post the relevant code.

@irlTopper
Copy link

Hi Atomi,

Just to be clear and sorry if I didn't mention this already – I am using Sublime Text 3 and the dev version.

Thanks for the reply here. Unfortunately this didn't work for me.
When I run view.window().run_command('close_cftag'), nothing happens (no character prints at cursor).

After turning on the logging, I get:
chr evt: > (0x3e)
command: close_cftag

Both cfm and cfc files have this problem.

">" doesn't work in any part of file.

I hope that helps.

Thanks,
Peter

@danwatt
Copy link

danwatt commented Feb 7, 2013

Typing a '>' into a CFM:
chr evt: > (0x3e)
command: close_cftag

view.window().run_command('close_cftag') - does nothing

Sublime 2.0.1 b 2217
Coldfusion package 2012.12.08.14.27.36

@atomi
Copy link
Contributor

atomi commented Feb 7, 2013

Yeah I don't know. It looks like the command close_cftag is being called but not actually running.

Are you guys getting completions?

You could try adding a print statements to various parts of the run() method in the CloseCftagCommand class to see if it prints to console.

Here is the relevant command source code for Sublime Text 2
https://github.com/SublimeText/ColdFusion/blob/master/coldfusiontagcompletions.py#L22
and Sublime Text 3
https://github.com/SublimeText/ColdFusion/blob/development/coldfusion-plugin.py#L116

If you do see your print statement being executed try to return out of the command by adding return None
immediately after the code that inserts the > character.

        # insert the ">" char
        for region in self.view.sel():
            self.view.insert(edit, region.end(), ">")

The for region in self.view.sel() statement loops over a list containing the currently selected regions.
The self.view.insert(edit, region.end(), ">") statement tells Sublime to insert the > character at the end of every region that is selected (which translates to the cursor position)

If you don't see your print statements being executed check the console log `ctrl+`` for any errors, if you don't see any try introducing bad code in the run() method of the CloseCftagCommand class to check if Sublime is indeed running the command. Post back any relevant console information if you can.

I've tried clean installs on both versions in both builds and they are both working for me so I'm having a really hard time figuring out what could possibly be going wrong here. I'm really sorry I can't be more helpful.

Correction: region.end() returns the greater of properties a or b of that region which doesn't necessarily translate to the cursor's position. This should be changed to region.b although inconsequential in this case as the region properties are both the same when there is no selection.

@irlTopper
Copy link

Thanks for all the help with this. I didn't have time to try this I'm afraid and for now, I've just gone back to SBT2.
Thanks anyhow and please keep up great work.

On 7 Feb 2013, at 23:16, atomi [email protected] wrote:

Yeah I don't know. It looks like the command close_cftag is being called but not actually running.

Are you guys getting completions?

You could try adding a print statements to various parts of the run() method in the CloseCftagCommand class to see if it prints to console.

Here is the relevant command source code for Sublime Text 2
https://github.com/SublimeText/ColdFusion/blob/master/coldfusiontagcompletions.py#L22
and Sublime Text 3
https://github.com/SublimeText/ColdFusion/blob/development/coldfusion-plugin.py#L116

If you do see your print statement being executed try to return out of the command by adding return None
immediately after the code that inserts the > character.

    # insert the ">" char
    for region in self.view.sel():
        self.view.insert(edit, region.end(), ">")

The for region in self.view.sel() statement loops over a list containing the currently selected regions.
The self.view.insert(edit, region.end(), ">") statement tells Sublime to insert the > character at the end of every region that is selected (which translates to the carat position)

If you don't see your print statements being executed check the console log for any errors, if you don't see any try introducing bad code in the run() method of the CloseCftagCommand class to check if indeed it is running the command. Post back any relevant console information.

I've tried clean installs on both versions in both builds and they are both working for me so I'm having a really hard time figuring out what could possibly be going wrong here. I'm really sorry I can't be more helpful.


Reply to this email directly or view it on GitHub.

@jamie-pate
Copy link

WIERD, reinstalling from git developer branch didn't fix, but touching the coldfusion-plugin.py did. (no source changes)

All i did was add and remove print statements and it works fine now.

I suspect some cache or pyc file somewhere? dunno, just happy it works for me now ;D

@atomi
Copy link
Contributor

atomi commented Feb 12, 2013

Thanks for the update @jamie-pate
There have been a lot of API and feature changes made during this beta period of Sublime Text 3.
It's great that development is continuing at this pace but some stuff is still in a state of flux.
So, I'm holding off on updating this package for a little bit.
Don't let that stop you guys from contributing if you feel like it.
The completions stuff in development branch is actually really basic API code.

@jamie-pate
Copy link

ok, i think i know what it is...
it's a startup timing issue, the CloseCFTagCommand class doesn't get created in time or something.
If i load ST3 the > key doesn't work, but when I reload the plugin (by modifying coldfusion-plugin.py) it starts working..

I've noticed this type of issue a lot with migrating plugins to ST3

@tollus
Copy link
Contributor

tollus commented Feb 25, 2013

Sorry @atomi the previous error was invalid because it was cf9, here's the error I've been seeing. (I removed the previous comment)


reloading plugin ColdFusion.coldfusion-plugin
Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 70, in reload_plugin
    m = importlib.import_module(modulename)
  File "X/importlib/__init__.py", line 88, in import_module
  File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 586, in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1023, in load_module
  File "<frozen importlib._bootstrap>", line 1004, in load_module
  File "<frozen importlib._bootstrap>", line 562, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 869, in _load_module
  File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
  File "C:\Users\<user>\AppData\Roaming\Sublime Text 3\Packages\ColdFusion\coldfusion-plugin.py", line 7, in <module>
    import ColdFusion.dictionaries as dic
  File "C:\Users\<user>\AppData\Roaming\Sublime Text 3\Packages\ColdFusion\dictionaries\__init__.py", line 13, in <module>
    _init()
  File "C:\Users\<user>\AppData\Roaming\Sublime Text 3\Packages\ColdFusion\dictionaries\__init__.py", line 8, in _init
    lang = __import__(s.get('dictionary','cf10'),globals(),locals(),['*'],1)
TypeError: __import__() argument 1 must be str, not None

@atomi
Copy link
Contributor

atomi commented Feb 25, 2013

Thanks @tollus I'll take a look at it

@atomi
Copy link
Contributor

atomi commented Feb 26, 2013

Hi @tollus the API for Sublime Text 3 was changed in this most recent build to allow some API calls to populate data prior to plugin_loaded() (like settings calls and version info). This also means that the development branch of the ColdFusion plugin will need to be updated to accommodate the changes.

@tollus
Copy link
Contributor

tollus commented Feb 26, 2013

@atomi This code change seemed to fix the issue, though I don't know if this makes me miss something?

--- a/dictionaries/__init__.py
+++ b/dictionaries/__init__.py
@@ -9,7 +9,7 @@ def _init():


 # load dictionary selectors and completions for ST2
-if sublime.version():
+if int(sublime.version()) < 3000:
     _init()

 # load dictionary selectors and completions for ST3

@atomi
Copy link
Contributor

atomi commented Feb 26, 2013

@tollus Yeah that hack is there because before 3013, sublime.version() and sublime.load_settings() would always be null in ST3 so we had to wait to run _init() until after plugin_loaded()

@tollus
Copy link
Contributor

tollus commented Feb 26, 2013

oh okay, so maybe it's as simple as just combining those two statements for the fix?

if sublime.version() and int(sublime.version()) < 3000:
     _init()

@atomi
Copy link
Contributor

atomi commented Feb 26, 2013

I think if sublime.load_settings() is working in 3013 we shouldn't need _init() at all or plugin_loaded().

@tollus
Copy link
Contributor

tollus commented Feb 26, 2013

Ah, okay, sounds good to me. Let me know when you make the change and I can test it for you.

@atomi
Copy link
Contributor

atomi commented Feb 26, 2013

@tollus Your fix

if sublime.version() and int(sublime.version()) < 3000:
     _init()

should be fine.

@Critter
Copy link

Critter commented Jun 18, 2013

@atomi what and where do I need to edit to fix this?

@atomi
Copy link
Contributor

atomi commented Jun 18, 2013

@Critter I haven't been able to reproduce this and I've been using this plugin almost daily. I would try removing the plugin and restarting Sublime then re-installing.

@atomi
Copy link
Contributor

atomi commented Jun 18, 2013

@Critter I'll take another look through at the close_tag command for you when I get a chance.

@Critter
Copy link

Critter commented Jun 18, 2013

I'll give reinstalling a go in the meantime... Thanks.

@atomi
Copy link
Contributor

atomi commented Aug 22, 2014

Unfortunately it doesn't happen on my build @redtopia so tell me when it happens. I made some updates right now but I suspect it's being caused by Sublime bailing and not loading the coldfusion-plugin.py file when it encounters something it didn't expect. I just started doing some CF again so I'll try to make some more updates in the coming weeks.

@redtopia
Copy link

Not sure, but it might happen after I wake my machine up... sometimes windows reports some sort of funky process error, and I think it might be sublime, but I'm not sure.

@Whiteboxwebby
Copy link

This is my first ever post here so am not sure how much information you will need so here goes. I am running OS X mavericks with ST3 3065 I have package control installed and I manually installed coldfusion via the git instructions, I have tried the uninstall of the plugin option I made sure I removed all record of it, I tried the touching the file suggestion earlier, that didnt work. I have restarted my machine a couple of times.
I am still not able to to use the > key at all, the only way I am able to even get the language to show up in the list is to include the ColdFusion.sublime-package file that I had from a previous attempted installation. I also tried copying the folder from Contents/MacOS/Packages/ into the Installed packages folder to see if that would work and nothing happened, so does anyone have any other suggestions/instructions on how to do it properly if I have done it wrong or am I to resign myself to just doing copy paste?

@franktudor
Copy link

using the dev package solved this problem for me...Thanks for having this discussion. I am enjoying Sublime with CF :)

@palmerlovett
Copy link

Oh joy! This works. Thanks for the tip. Finally I can edit these files at work with syntax highlighting.

@samwscott
Copy link

I've been struggling with this issue for a couple days. None of the above solutions worked for me. I've removed and reinstalled different versions and builds of Sublime, removed and reinstalled the package via git and zip; checked out different branches, created new branches to test... all without success.

By using sublime.log_commands(True) in the console, I could see that it was calling the close_cftag command. I changed the command name in Default.sublime-keymap and added some messages and new commands to coldfusion-plugin.py. No matter what, any commands defined in coldfusion-plugin.py would not run and no error was thrown. I created a new .py file in %APPDATA%\Packages and my "Hello, World!" command ran just fine when mapped to the ">" key. That's when I realized there might be a path issue.

It turns out, I had been placing the ColdFusion package in the wrong folder. I assumed the "User" folder was where I (the user) was supposed to store my packages so I was putting it here:
%APPDATA%\Packages\User\ColdFusion What's confusing is that the syntax highlighting works fine for cfm and cfc files when the package is placed here so I just assumed I installed it properly. (@atomi - you may be able to replicate what people are experiencing by dropping the package in this folder)

As soon as I moved the package to %APPDATA%\Packages\ColdFusion everything worked just fine.

tl;dr - make sure package is installed here: %APPDATA%\Packages\ColdFusion

edit: Going back through the thread, I see that most have not made the mistake I did. Oh well, hope this helps someone.

@cfgois
Copy link

cfgois commented Nov 6, 2014

@samwscott THANK YOU

@robred
Copy link

robred commented Nov 6, 2014

This has worked for me on the various ST3 dev builds on my Win 7, 8.x, and Mac laptops. Thanks!

@Whiteboxwebby
Copy link

can you have a look at my thread then robred and tell me what I am doing wrong please? :)

@Lukenickerson
Copy link

I had this problem (Windows 7, Sublime Text 3 demo) when the package was in a folder named %APPDATA%\Sublime Text 3\Packages\User\ColdFusion-development\. I renamed the folder to just ColdFusion, restarted, and I was able to type > again.

@kjerk
Copy link

kjerk commented Feb 12, 2015

As @Lukenickerson said, the folder has to be named ColdFusion or the > key stops working as a side effect of some paths not working anymore.
I've tried modifying all the hard coded paths I could find, but even after that there must be some kind of linkage issue with coldfusion-plugin.py because it just doesn't work without keeping the folder as "ColdFusion".
I was trying to organize my plugins by cloning them into folders with a prefix that indicates what they are and '>' stopped working 😣

@timmaybrown
Copy link

This happened to me today and was fixed by re-cloning the Development branch of the git repo.

I had noticed that the console had other warnings going on when I tried to run the close_tag command in the console. *I mention it as a side note since I'm not entirely sure if that was the culprit, but after a re-install of the development branch and removal of the folder from my project that had the offending files, have since gone away. The warnings were related to the contentbox api docs. I'll restore those files and see if sublime freaks out about them again. I also wonder if some other package or some other internal sublime text issue like I just mentioned might have been preventing the Coldfusion plugin from functioning properly.

@teaman
Copy link

teaman commented Mar 31, 2015

I ran into this issue today after downloading ST3 beta and then installing the ColdFusion plugin from github.com. I used the .zip download, unzipped it and placed the inner directory Coldfusion (renamed from Coldfusion-master) into the Packages directory. I launch ST3 and at first it only exhibited this issue with not being able to type the greater-than symbol. But then it started auto-deleting the plugin directory from the Packages directory after launch of ST3. I would paste it back in there from my Downloads directory where I had unzipped the .zip file and renamed it. But repeatedly I would launch ST3 and watch it vanish.

I finally resolved the issue when another developer here said he used the git method of installing and has had no issues. So I installed git (the command line version) and then used the git method to install the plugin. Now it not only doesn't delete itself but I can type the greater-than character! :)
Just thought you all should know my experience with this issue. So bizarre.

@atuttle
Copy link

atuttle commented Mar 31, 2015

Did you get a zip of the development branch?

@teaman
Copy link

teaman commented Apr 2, 2015

I don't know... I just grabbed whatever is in the right side bar to Download .zip.

@timmaybrown
Copy link

The read.me says to grab the development branch otherwise in my experience a lot of things, such as this, don't work as expected.

-tim

On Apr 2, 2015, at 1:17 AM, "Bruce H." [email protected] wrote:

I don't know... I just grabbed whatever is in the right side bar to Download .zip.


Reply to this email directly or view it on GitHub.

@atuttle
Copy link

atuttle commented Apr 2, 2015

And indeed, in this very ticket, I gave a direct link to the development branch zip, in June 2014. Here it is again:

https://github.com/SublimeText/ColdFusion/archive/development.zip

@nathanstanford2
Copy link

Think I know what's going on with this. It appears there are currently 2 default key maps in the Default.sublime-keymap. I removed the "move" keymap and it's now working again.

    { "keys": [">"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
        [
            { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
            { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
            { "key": "selector", "operator": "equal", "operand": "meta.tag"},
            { "key": "following_text", "operator": "regex_contains", "operand": "^>", "match_all": true }
        ]
    },
    // Auto-close ColdFusion block tags
    { "keys": [">"], "command": "close_cftag", "context":
        [
            // selectors aren't working as I expect, we'll just use general scopes here
            { "key": "selector", "operator": "equal", "operand": "text.html.cfm, source.cfscript.cfc"},
            { "key": "following_text", "operator": "not_regex_contains", "operand": "^>", "match_all": true }
        ]
    },

@nathanstanford2
Copy link

Actually, it looks like this is the main part of the issue in the first key map.

{ "key": "selector", "operator": "equal", "operand": "meta.tag"},
{ "key": "following_text", "operator": "regex_contains", "operand": "^>", "match_all": true }

@deltaforce
Copy link

I am also having this issue, but with ST2 (not 3). Got it installe don several machines with same problem on all of them. Doesn't even work in a blank file.
Have tried re-installing, to no avail.

If I use the "CFML (do not use)" syntax, then it works.

@johnbocook
Copy link

nathanstandford2 hit it on the head. I tried all the other methods above with st3 and nothing seemed to work. I commented out that second key mapping block and the > key is working great.

@sfeldkamp
Copy link

If you download the .zip file of the development branch (instead of cloning with git) make sure you rename the package from 'ColdFusion-development' to 'ColdFusion' when you install it.

This fixed the issue for me. Another symptom that will tell you a rename is needed is if you browse to the plugin default settings through the Preferences menu and the file is blank and prompts you to save it when you close it.

@zadams125
Copy link

Using Sublime 3 portable version.
Installed development branch, however I am still unable to type the ">"...please help!!

@deltaforce
Copy link

still have that issue on version 2

On Wed, Aug 26, 2015 at 4:59 PM, zadams125 [email protected] wrote:

Using Sublime 3 portable version.

Installed development branch, however I am still unable to type the
">"...please help!!


Reply to this email directly or view it on GitHub
#106 (comment)
.

Russ Michaels
Blog: www.michaels.me.uk
skype: russmichaels

My other sites/projects
www.bluethunder.co : SME hosting solutions
www.cfmldeveloper.com : ColdFusion/Railo developer hosting
www.cfsearch.com : ColdFusion search engine
www.cflive.net : Live CFML console/testing tool

@umbraesoulsbane
Copy link

Just wanted to say I resolved by issue by going to preferences > browse packages and deleting everything in the ColdFusion folder and dumping the contents of the development package (https://github.com/SublimeText/ColdFusion/archive/development.zip) in it. I restarted Sublime Text 3 for good measure.

Until then I was just copying and pasting the > to get around it. However, I am glad to have the issue resolved.

@holttim
Copy link

holttim commented Sep 7, 2015

I resolved this problem by restarting Sublime Text.

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

No branches or pull requests