Page 1 of 1
File Open Show End Not Start
Posted: 23.09.2025 18:53
by Random Void User
I would like CudaText to open all files at the end, not the start. It would always seek to, and show, the last part of every file opened. I found ui_reload_tail, but think I need a different option. Is one available? I prefer not to use "sessions" or similar data records, I just want a master switch, not a per-file switch. Thanks!
Re: File Open Show End Not Start
Posted: 24.09.2025 03:03
by main Alexey
Here is primitive plugin. it turns Wrap-mode off (it is required for long lines) and scrolls to the end in on_open event.
1. file py/cuda_always_open_at_end/install.inf
Code: Select all
[info]
title=Always Open Files At End
desc=(Fill the description)
type=cudatext-plugin
subdir=cuda_always_open_at_end
homepage=(Fill the GitHub repo URL)
[item1]
section=events
events=on_open
2. file py/cuda_always_open_at_end/__init__.py
Code: Select all
import os
from cudatext import *
class Command:
def on_open(self, ed_self):
nlines = ed_self.get_line_count()
nvis= ed_self.get_prop(PROP_VISIBLE_LINES)
ed_self.set_caret(0, nlines-1)
ed_self.set_prop(PROP_WRAP, False)
ed_self.set_prop(PROP_LINE_TOP, max(0, nlines-nvis+1))
Re: File Open Show End Not Start
Posted: 25.09.2025 03:27
by Random Void User
What about just using the ctrl-end hotkey in that plugin,
Re: File Open Show End Not Start
Posted: 25.09.2025 06:37
by main Alexey
I tried it too, but due to context - on_open event - command don't fully work (caret jumps, but scroll position don't always jump or jumps to last_line-1). It needs investigation why it don't fully work in on_open, not sure I want it.