Skip to content

Commit

Permalink
[REPL] Meta-e: Don't execute the edited code when exiting editor (#46153
Browse files Browse the repository at this point in the history
)
  • Loading branch information
fredrikekre authored Feb 13, 2023
1 parent b4e6b03 commit aaab409
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions stdlib/REPL/src/LineEdit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1357,19 +1357,22 @@ function edit_input(s, f = (filename, line, column) -> InteractiveUtils.edit(fil
col += 1
end

# Write current input to temp file, edit, read back
write(filename, str)
f(filename, line, col)
str_mod = readchomp(filename)
rm(filename)
if str != str_mod # something was changed, run the input
write(buf, str_mod)
commit_line(s)
:done
else # no change, the edit session probably unsuccessful
write(buf, str)
seek(buf, pos) # restore state from before edit
refresh_line(s)

# Write updated content
write(buf, str_mod)
if str == str_mod
# If input was not modified: reset cursor
seek(buf, pos)
else
# If input was modified: move cursor to end
move_input_end(s)
end
refresh_line(s)
end

# return the identifier under the cursor, possibly with other words concatenated
Expand Down

6 comments on commit aaab409

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(isdaily = true)

@vtjnash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your job failed. Consult the server logs for more details (cc @maleadt).

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here.

@maleadt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nanosoldier runtests(isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible new issues were detected.
A full report can be found here.

Please sign in to comment.