thetooi / zen-coding

Automatically exported from code.google.com/p/zen-coding
0 stars 0 forks source link

Cursor in wrong position after expansion when editing php files in Dreamweaver CS4 and CS5 #176

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
- In a file with a PHP extension, type "div" (or any expandable tag), then
press Ctrl+, 

What is the expected output? What do you see instead?
- After expansion, instead of the cursor being positioned between the tags,
it is positioned after the closing tag.

- You can rename the file with an HTML extension, and the cursor will be
positioned correctly after expansion.

What version of the product are you using? On what operating system?
- 0.6.0, Dreamweaver CS4 and CS5, Vista Ultimate.

Original issue reported on code.google.com by cliftonk...@gmail.com on 12 May 2010 at 6:49

GoogleCodeExporter commented 9 years ago
I may have solved this problem. I prowled around in the source, and it seemed 
like
the cursor behavior after expansion was being determined by a profile setting 
which
was based on the document type. I found where the profiles were set in 
zen_editor.js,
and there was no option for PHP_MySQL. I added a PHP_MySQL documentType to the 
switch
statement so that any PHP_MySQL documents would be handled like HTML or XHTML 
documents.

Here's the complete function with the added line:

getProfileName: function() {
   switch(dom.documentType) {
      case 'XML':
      case 'XSLT':
      case 'XSLT-fragment':
         return 'xml';
      case 'HTML':
      case 'PHP_MySQL': // *** Added line
         // html or xhtml?
         return dom.source.getText().search(/<!DOCTYPE[^>]+XHTML.+?>/) !== -1 ?
'xhtml' : 'html';
      default:
         return dom.documentType;
      }
}

This seems to have solved the problem with the cursor. The zen_coding.js file is
located in C:\Users\<username>\AppData\Roaming\Adobe\Dreamweaver
CS5\en_US\Configuration\Commands\ZenCoding
on my Windows system.

Original comment by cliftonk...@gmail.com on 15 May 2010 at 7:48

GoogleCodeExporter commented 9 years ago
Should work in new 0.7 version now. I've made similar edit in source. Thanks 
for reporting.

Original comment by GreLIm...@gmail.com on 10 Dec 2010 at 7:28