Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4c63695

Browse files
committed
mk insert line 0-indexed and improve note
1 parent02e0c1a commit4c63695

File tree

2 files changed

+101
-99
lines changed

2 files changed

+101
-99
lines changed

‎dialoghelper/core.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ def run_msg(
229229
# %% ../nbs/00_core.ipynb
230230
defmsg_insert_line(
231231
msgid:str,# Message id to edit
232-
insert_line:int,#Linenumberwhereto insert(0-based indexing)
233-
new_str:str,#Textto insert at the specified line
232+
insert_line:int,#The linenumberafter whichto insertthe text (0 for beginning of file)
233+
new_str:str,#The textto insert
234234
dname:str=''# Running dialog to get info for; defaults to current dialog
235235
):
236236
"Insert text at a specific line number in a message"
@@ -351,10 +351,11 @@ def tool_info():
351351
- &`add_msg`: Add/update a message to the queue to show after code execution completes.
352352
- &`update_msg`: Update an existing message.
353353
- &`url2note`: Read URL as markdown, and add a note below current message with the result
354-
- &`msg_insert_line`: Insert text at aspecified line in a message.
354+
- &`msg_insert_line`: Insert text at aspecific location in a message.
355355
- &`msg_str_replace`: Find and replace text in a message.
356356
- &`msg_strs_replace`: Find and replace multiple strings in a message.
357-
- &`msg_replace_lines`: Replace a range of lines in a message with new content.'''
357+
- &`msg_replace_lines`: Replace a range of lines in a message with new content.
358+
- Always first use `read_msg( msgid=msgid, n=0, relative=True, nums=True)` to view the content with line numbers.'''
358359
add_msg(cts)
359360

360361
# %% ../nbs/00_core.ipynb

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp