Skip to content

Commit 4cab018

Browse files
committed
Merge branch 'gs_531' into 'master'
Fix Ctrl+V for interactive consoles See merge request eng/ide/gnatstudio!863
2 parents 8d8ec3a + 53712ab commit 4cab018

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

kernel/src/interactive_consoles.adb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2034,7 +2034,13 @@ package body Interactive_Consoles is
20342034
-- We also execute empty commands, since they might be relevant
20352035
-- in some contexts (python for instance)
20362036
if Command /= null and then Command.all /= "" then
2037-
Get_End_Iter (Console.Buffer, Last_Iter);
2037+
Get_Iter_At_Mark
2038+
(Console.Buffer, Last_Iter, Get_Insert (Console.Buffer));
2039+
2040+
if Last_Iter = Null_Text_Iter then
2041+
Get_End_Iter (Console.Buffer, Last_Iter);
2042+
end if;
2043+
20382044
Insert (Console.Buffer, Last_Iter, Command.all);
20392045

20402046
-- Execute only if Command ends with a Line Feed.

testsuite/tests/gs.510.paste_to_console/test.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,15 @@ def run_test():
2323
">>> Put_Line",
2424
"Wrong Paste",
2525
)
26+
27+
# test insert at the cursor location
28+
send_key_event(GDK_LEFT)
29+
yield wait_idle()
30+
send_key_event(ord("v"), control=True)
31+
yield wait_idle()
32+
gps_assert(
33+
GPS.Console("Python").get_text(),
34+
">>> Put_LinPut_Linee",
35+
"Wrong Paste",
36+
)
37+

0 commit comments

Comments
 (0)