Skip to content

New {{cursor}} placeholder for prompts#37

Open
Entaigner wants to merge 1 commit intonvms:mainfrom
Entaigner:main
Open

New {{cursor}} placeholder for prompts#37
Entaigner wants to merge 1 commit intonvms:mainfrom
Entaigner:main

Conversation

@Entaigner
Copy link
Copy Markdown

Text manipulation around the text cursor

  1. {{cursor}}
  • Returns the text cursors current line
  1. {{cursor:2:5}}
  • Returns the text from... 'cursor line-2 at the start of the line' to 'cursor line+5 at the end of the line'
  1. {{cursor:1:1:'[SOME_MARKER]'}}
  • Like 2. but inserts [SOME_MARKER] at text cursor position

Important:

  • When text is selected the cursor position is always at the end of selection
  • Only one {{cursor}} marker may be included in any prompt

Why: https://huggingface.co/stabilityai/stable-code-3b#run-with-fill-in-middle-fim-%E2%9A%A1%EF%B8%8F

Text manipulation around the text cursor
1. {{cursor}}
  - Returns the text cursors current line
2. {{cursor:2:5}}
  - Returns the text from...
      'cursor line-2 at the start of the line' to
      'cursor line+5 at the end of the line'
3. {{cursor:1:1:'[SOME_MARKER]'}}
  - Like 2. but inserts [SOME_MARKER] at text cursor position

Important:
- When text is selected the cursor position is always at the end of selection
- Only one {{cursor}} marker may be included in any prompt

Why: https://huggingface.co/stabilityai/stable-code-3b#run-with-fill-in-middle-fim-%E2%9A%A1%EF%B8%8F
@Entaigner
Copy link
Copy Markdown
Author

The pull request might've been a little rash but i got lost in the moment whilst testing a model.

My implementation lacks a comfortable integration into the rest of the project.

Maybe {{selection_with_marker}} to allow the placement of a marker somewhere in the selection. Or keep {{cursor:1:1:'[SOME_MARKER]'}} but without the line deltas {{cursor:'[SOME_MARKER]'}} and select after. Haven't figured it out.

Anyway, thanks for the awesome project.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant