FIXED: Emmet abbrev !

Report issues, odd behaviors or submit a detailed bug report.
Post Reply
Alextp
Posts: 69
Joined: 23 Aug 2014 23:36

FIXED: Emmet abbrev !

Post by Alextp »

! expands to
<!DOCTYPE html>
<html lang="${1:lang}">
<head>
<meta charset="${1:charset}"/>
<title>${1:Document}</title>
</head>
<body>

</body>
</html>
via emmet.pas. this is not ok, my code makes 3 multi-carets (index 1). 3 carets with different content:
lang
charset
Document

User avatar
Rickard Johansson
Site Admin
Posts: 6001
Joined: 19 Jul 2006 14:29

Re: Emmet abbrev !

Post by Rickard Johansson »

It seems I fixed this in the editor code before inserting the expanded code in RJ TextEd. I'll see if I can do this in emmet.pas instead.

User avatar
Rickard Johansson
Site Admin
Posts: 6001
Joined: 19 Jul 2006 14:29

Re: Emmet abbrev !

Post by Rickard Johansson »

Should work now in Emmet.pas version 1.14 and in RJ TextEd v14.50.

Thanks!

Alextp
Posts: 69
Joined: 23 Aug 2014 23:36

Re: FIXED: Emmet abbrev !

Post by Alextp »

with Emmet.pas 1.14 I see

Code: Select all

<!DOCTYPE html>
<html lang="${1:lang}">
<head>
	<meta charset="${2:charset}"/>
	<title>${2:Document}</title>
</head>
<body>
	|
</body>
</html>
2 tab stops with index=2.

User avatar
Rickard Johansson
Site Admin
Posts: 6001
Joined: 19 Jul 2006 14:29

Re: FIXED: Emmet abbrev !

Post by Rickard Johansson »

There is a typo in the snippets file.

doc=html>(head>meta[charset=${1:charset}]+title{${1:Document}})+body

should be

doc=html>(head>meta[charset=${1:charset}]+title{${2:Document}})+body

Alextp
Posts: 69
Joined: 23 Aug 2014 23:36

Re: FIXED: Emmet abbrev !

Post by Alextp »

now ! gives

Code: Select all

<!DOCTYPE html>
<html lang="${1:lang}">
<head>
	<meta charset="${2:charset}"/>
	<title>${3:Document}</title>
</head>
<body>
	|
</body>
</html>
not good, cause | and numbered stops. my program cannot handle | and numbered stops, it wants only | or only numbered stops 1,2,3,4...

User avatar
Rickard Johansson
Site Admin
Posts: 6001
Joined: 19 Jul 2006 14:29

Re: FIXED: Emmet abbrev !

Post by Rickard Johansson »

Added an option to always return indexed tab stops ${x} in v1.15.

Only HTML, XML ... are affected by this option because you can combine abbreviations. E.g. CSS only expand a snippet - so indexed tab stops and cursor positions are never mixed.

Alextp
Posts: 69
Joined: 23 Aug 2014 23:36

Re: FIXED: Emmet abbrev !

Post by Alextp »

thanks. can you add the option for this please? - if snippet has several tabstops and tabstops are mixed | and ${n} - like for abbrev "!" (it has mixed index=1 index=2 and | )- then engine returns all tabstops as ${n}.

User avatar
Rickard Johansson
Site Admin
Posts: 6001
Joined: 19 Jul 2006 14:29

Re: FIXED: Emmet abbrev !

Post by Rickard Johansson »

I thought I had already. Doesn't the option "AlwaysReturnIndexedTabStops" work for you?

Alextp
Posts: 69
Joined: 23 Aug 2014 23:36

Re: FIXED: Emmet abbrev !

Post by Alextp »

sorry, I still see not resolved tabstops for "!", emmet.pas, ie result has | and ${x}.
using version 1.16 which must resolve it. and option is on

Code: Select all

function AppEmmetOptions(const ASyntax: string): TExpandOptions;
begin
  FillChar(Result, SizeOf(Result), 0);
  Result.AlwaysAddNewLine:= ASyntax = 'xml';
  Result.AddSlashToEmptyTags:= UiOps.Emmet_AddSlashToEmptyTags;
  Result.CommentTags:= UiOps.Emmet_CommentTags;
  Result.IndentChilds:= UiOps.Emmet_IndentNested;
  Result.SingleLine:= UiOps.Emmet_SingleLine;
  Result.TabSize:= EditorOps.OpTabSize;
  Result.TrimLineMarkers:= UiOps.Emmet_TrimLineMarkers;
  Result.Wordwrap:= UiOps.Emmet_WordWrap;
  Result.WordwrapAt:= EditorOps.OpMarginFixed;
  Result.AlwaysReturnIndexedTabStops:= true;
end;

User avatar
Rickard Johansson
Site Admin
Posts: 6001
Joined: 19 Jul 2006 14:29

Re: FIXED: Emmet abbrev !

Post by Rickard Johansson »

I haven't been able to reproduce it. It seems to work at my end :?

Alextp
Posts: 69
Joined: 23 Aug 2014 23:36

Re: FIXED: Emmet abbrev !

Post by Alextp »

ops, mixed tabstops are fixed. sorry.
I have new issue with ! abbrev.
video shows it.
i press Expand btn several times. and -- tabstops 2nd and 3rd are change on EACH PRESS.
it is demo for Lazarus from
https://github.com/alexey-t/emmet-pascal
Attachments
emmet-bg.zip
(283.56 KiB) Downloaded 75 times

User avatar
Rickard Johansson
Site Admin
Posts: 6001
Joined: 19 Jul 2006 14:29

Re: FIXED: Emmet abbrev !

Post by Rickard Johansson »

Fixed in Emmet Pascal v1.17.

Version 1.17
* Fixed a Lazarus (Free Pascal) string issue in ResolveTabStopsIndex()

Post Reply