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

Cursor position not honoured after Comments.shebang #6

Open
openstrike opened this issue Apr 13, 2022 · 2 comments
Open

Cursor position not honoured after Comments.shebang #6

openstrike opened this issue Apr 13, 2022 · 2 comments

Comments

@openstrike
Copy link

Hello,

I've just upgraded vim, perl and perl-support and TBH, things are working surprisingly well. However I have one issue to report regarding the Comments.shebang used in Perl::FileSkeleton::Script. As it stands in the default templates the position of <CURSOR> is not honoured when opening a new *.pl script - the cursor is at the very top left (on the hash of the shebang line) and the user is in insert mode.

Other filetypes (*.t, *.pm, etc) are fine so I was able to narrow it down to the shebang line. Furthermore, if the Comments.shebang is moved to the end of the list in Perl::FileSkeleton::Script, ie.

SetProperty ( 'Perl::FileSkeleton::Script', 'Comments.file description pl; ;Skeleton.script-use;Comments.shebang' )

then the position of <CURSOR> is honoured, but of course the shebang line is now at the end of the file which is no use.

Obviously, I can work around this for now quite simply. However I wanted to raise it in case it was indicative of some wider problem.

I am using a fresh clone of perl-support from this repo (up to f3f5881) with vim 8.2.4649 (and perl 5.34.0). The shebang line it puts in is #!/usr/bin/env perl

Let me know if I can help debugging this further. If you can't reproduce this then it's likely something else odd in my personal config and I am sorry to have troubled you with it.

Pete

@WolfgangMehner
Copy link
Owner

Thank you for your report.

Are you using the standard template library? The shebang template simply does not have a cursor tag, so it defaults to placing the cursor at the beginning of the line. I guess one would expect the cursor after the interpreter command, so you can add further options to it?

Like so:

== Comments.shebang == start, map:csh ==
#!|PERL_INTERPRETER|<CURSOR>
== ENDTEMPLATE ==

Also, there seems to be a bug with the cursor tag, at least on my maschine. If the tag appears on the end of the line, the cursor is placed in the wrong position. I will investigate.

@openstrike
Copy link
Author

I am using the Comments.shebang template unaltered. ie:

== Comments.shebang == start, map:csh ==
#!|PERL_INTERPRETER|
== ENDTEMPLATE ==

The problem is that the cursor should not be on the shebang line at all, but rather in the DESCRIPTION line of the pl file template which I have modified only slightly and looks like this:

== Comments.file description pl == map:chpl, sc:d, start, noindent ==
#===============================================================================
#
#         FILE: |FILENAME|
#
#        USAGE: ./|FILENAME|
#
#  DESCRIPTION: <CURSOR>
#
#      OPTIONS: ---
# REQUIREMENTS: ---
#         BUGS: ---
#        NOTES: ---
#       AUTHOR: |AUTHOR| (|AUTHORREF|), |EMAIL|
# ORGANIZATION: |ORGANIZATION|
#      VERSION: 1.0
#      CREATED: |DATE|
#===========================================================================

Thanks for investigating.

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

2 participants