Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yad
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav
yad
Commits
52eecb26
Commit
52eecb26
authored
May 03, 2022
by
Victor Ananjevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add --line option to text-info dialog
parent
eb4110e9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
8 deletions
+27
-8
yad.1
data/yad.1
+4
-1
uk.po
po/uk.po
+0
-0
main.c
src/main.c
+2
-0
option.c
src/option.c
+3
-0
text.c
src/text.c
+16
-7
yad.h
src/yad.h
+2
-0
No files found.
data/yad.1
View file @
52eecb26
...
...
@@ -978,7 +978,10 @@ Default is \fIleft\fP.
Set text margins to \fINUMBER\fP.
.TP
.B \-\-tail
Autoscroll to end when new text appears. Works only when text is read from stdin.
Autoscroll to end when new text appears. This option works only when text is read from stdin.
.TP
.B \-\-line=\fINUMBER\fP
Jump to specific line at startup. This option works only when filename was specified
.TP
.B \-\-show-cursor
Show cursor in read-only mode.
...
...
po/uk.po
View file @
52eecb26
This diff is collapsed.
Click to expand it.
src/main.c
View file @
52eecb26
...
...
@@ -916,6 +916,8 @@ main (gint argc, gchar ** argv)
notebook_swallow_childs
();
else
if
(
options
.
mode
==
YAD_MODE_PANED
)
paned_swallow_childs
();
else
if
(
options
.
mode
==
YAD_MODE_TEXTINFO
)
text_goto_line
();
else
if
(
options
.
mode
==
YAD_MODE_PICTURE
)
{
if
(
options
.
picture_data
.
size
==
YAD_PICTURE_FIT
)
...
...
src/option.c
View file @
52eecb26
...
...
@@ -653,6 +653,8 @@ static GOptionEntry text_options[] = {
N_
(
"Set justification (left, right, center or fill)"
),
N_
(
"TYPE"
)
},
{
"margins"
,
0
,
0
,
G_OPTION_ARG_INT
,
&
options
.
text_data
.
margins
,
N_
(
"Set text margins"
),
N_
(
"SIZE"
)
},
{
"line"
,
0
,
0
,
G_OPTION_ARG_INT64
,
&
options
.
text_data
.
line
,
N_
(
"Jump to specific line"
),
N_
(
"NUMBER"
)
},
{
"fore"
,
0
,
0
,
G_OPTION_ARG_STRING
,
&
options
.
text_data
.
fore
,
N_
(
"Use specified color for text"
),
N_
(
"COLOR"
)
},
{
"back"
,
0
,
0
,
G_OPTION_ARG_STRING
,
&
options
.
text_data
.
back
,
...
...
@@ -1869,6 +1871,7 @@ yad_options_init (void)
options
.
text_data
.
wrap
=
FALSE
;
options
.
text_data
.
justify
=
GTK_JUSTIFY_LEFT
;
options
.
text_data
.
margins
=
0
;
options
.
text_data
.
line
=
0
;
options
.
text_data
.
hide_cursor
=
TRUE
;
options
.
text_data
.
fore
=
NULL
;
options
.
text_data
.
back
=
NULL
;
...
...
src/text.c
View file @
52eecb26
...
...
@@ -609,13 +609,6 @@ fill_buffer_from_file ()
}
gtk_source_buffer_set_language
(
GTK_SOURCE_BUFFER
(
text_buffer
),
lang
);
#endif
if
(
options
.
common_data
.
editable
)
{
/* move cursor at the beginnging of a buffer */
gtk_text_buffer_get_iter_at_offset
(
GTK_TEXT_BUFFER
(
text_buffer
),
&
iter
,
0
);
gtk_text_buffer_place_cursor
(
GTK_TEXT_BUFFER
(
text_buffer
),
&
iter
);
}
}
static
void
...
...
@@ -635,6 +628,22 @@ text_changed_cb (GtkTextBuffer *b, gpointer d)
text_changed
=
TRUE
;
}
void
text_goto_line
()
{
if
(
options
.
common_data
.
uri
)
{
GtkTextIter
iter
;
while
(
gtk_events_pending
())
gtk_main_iteration
();
gtk_text_buffer_get_iter_at_line
(
GTK_TEXT_BUFFER
(
text_buffer
),
&
iter
,
options
.
text_data
.
line
);
gtk_text_buffer_place_cursor
(
GTK_TEXT_BUFFER
(
text_buffer
),
&
iter
);
gtk_text_view_scroll_to_iter
(
GTK_TEXT_VIEW
(
text_view
),
&
iter
,
0
,
TRUE
,
0
,
0
.
5
);
}
}
GtkWidget
*
text_create_widget
(
GtkWidget
*
dlg
)
{
...
...
src/yad.h
View file @
52eecb26
...
...
@@ -473,6 +473,7 @@ typedef struct {
gboolean
wrap
;
GtkJustification
justify
;
gint
margins
;
gulong
line
;
gboolean
uri
;
gboolean
hide_cursor
;
gchar
*
uri_color
;
...
...
@@ -672,6 +673,7 @@ gboolean file_confirm_overwrite (GtkWidget *dlg);
void
notebook_swallow_childs
(
void
);
void
paned_swallow_childs
(
void
);
void
picture_fit_to_window
(
void
);
void
text_goto_line
(
void
);
void
app_print_result
(
void
);
void
calendar_print_result
(
void
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment