Bug 447957 - Sendcode integration on sublime text
Summary: Sendcode integration on sublime text
Status: REPORTED
Alias: None
Product: rkward
Classification: Applications
Component: R Console (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: RKWard Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-05 05:35 UTC by Ryan
Modified: 2022-01-06 04:00 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
attachment-5971-0.html (4.73 KB, text/html)
2022-01-06 04:00 UTC, Ryan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan 2022-01-05 05:35:26 UTC
SUMMARY
I am trying to find a replacement for Rstudio as I am now on sway (wayland) on Ubuntu 22.04 and Rstudio does not support wayland.
RKWard seems to work well so far but I cannot send R code from sublime text to RKWard.
Is there something I can do to get this up and running?


STEPS TO REPRODUCE
1.  I installed rkward from the apt repo.
2. I have added the following to my 'sendcode' settings in sublime text, in the hope that it would that simple:
"R": { "bracketed_paste_mode": false, "prog": "rkward", }, "rmd" : { "prog": "rkward", "bracketed_paste_mode": false },

OBSERVED RESULT
I get an error message "rkward is not supported for current syntax'.

EXPECTED RESULT
The code from sublime text is magically transported to the RKWard R console and the code runs. 

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
Linux 5.15.0-14-generic #14-Ubuntu SMP Tue Dec 14 10:08:09 UTC 2021 x86_64 GNU/Linux

Sublime text build 4126

RKWard v0.7.2
Comment 1 Thomas Friedrichsmeier 2022-01-05 09:23:35 UTC
I am not familiar with sublime text / sendcode (*), but had look at some of the documentation just now. It seems sendcode needs specific instructions for each program it has to deal with, even though, at least on linux, most programs could really be treated alike.

After a cursory look, it appears you'll essentially have to duplicate this part (wherever that gets installed):
https://github.com/randy3k/SendCode/blob/master/code_sender/rstudio/__init__.py

At least for linux, no special adjustments should be needed, here. You might want to send "Alt+1", then "Alt+5" before "Ctrl+V" to make sure the R Console window is active inside RKWard.

Apparently, you'll also have to add a few lines, here: https://github.com/randy3k/SendCode/blob/master/code_sender/sender.py
again taking the lines for rstudio as a template.

If that works for you, consider contributing it to sendcode. I am not sure, whether anything special is needed to support sendcode to RKWard on Windows/OS X, but at least for linux, it's the support inside sendcode, not inside RKWard that is missing.

---

(*) Consider giving the integrated editor a try. It's based on kate(part), which provides a really powerful text editing component.
Comment 2 Ryan 2022-01-06 04:00:39 UTC
Created attachment 145149 [details]
attachment-5971-0.html

Hello Thomas

Thank you for the super quick response!
I had a look as well and it seems do-able. I have filed a feature request
with Sendcode.

I can see possible complication that might change the process for Sendcode
on wayland:
- using ydotool instead of xdotool
- the change in clipboard management utils on wayland
- granting privileges to GUIs on sway

Unfortunately I have just moved everything from x to wayland and I am still
putting out all the fires that come with that to get my desktop in working
order so I don't want to be too adventurous with new projects.
For the time being I can use the terminal and sublime text.

*Best Wishes*
Ryan Daniels



On Wed, 5 Jan 2022 at 03:23, Thomas Friedrichsmeier <
bugzilla_noreply@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=447957
>
> Thomas Friedrichsmeier <thomas.friedrichsmeier@kdemail.net> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>                  CC|
> |thomas.friedrichsmeier@kdem
>                    |                            |ail.net
>
> --- Comment #1 from Thomas Friedrichsmeier <
> thomas.friedrichsmeier@kdemail.net> ---
> I am not familiar with sublime text / sendcode (*), but had look at some
> of the
> documentation just now. It seems sendcode needs specific instructions for
> each
> program it has to deal with, even though, at least on linux, most programs
> could really be treated alike.
>
> After a cursory look, it appears you'll essentially have to duplicate this
> part
> (wherever that gets installed):
>
> https://github.com/randy3k/SendCode/blob/master/code_sender/rstudio/__init__.py
>
> At least for linux, no special adjustments should be needed, here. You
> might
> want to send "Alt+1", then "Alt+5" before "Ctrl+V" to make sure the R
> Console
> window is active inside RKWard.
>
> Apparently, you'll also have to add a few lines, here:
> https://github.com/randy3k/SendCode/blob/master/code_sender/sender.py
> again taking the lines for rstudio as a template.
>
> If that works for you, consider contributing it to sendcode. I am not sure,
> whether anything special is needed to support sendcode to RKWard on
> Windows/OS
> X, but at least for linux, it's the support inside sendcode, not inside
> RKWard
> that is missing.
>
> ---
>
> (*) Consider giving the integrated editor a try. It's based on kate(part),
> which provides a really powerful text editing component.
>
> --
> You are receiving this mail because:
> You reported the bug.