Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions plugins/markdown-actions/markdown-actions.vala
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public class Code.Plugins.MarkdownActions : Peas.ExtensionBase, Peas.Activatable
}

private bool parse_ordered_list_item (string line, ref int current_number, out string item_text) {
item_text = "";
int first_point_character = line.index_of_char ('.');
if (first_point_character < 0) {
return false;
Expand Down
16 changes: 12 additions & 4 deletions plugins/terminal/terminal.vala
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,10 @@ public class Scratch.Plugins.Terminal : Peas.ExtensionBase, Peas.Activatable {

public string get_shell_location () {
int pid = (!) (this.child_pid);

try {
return GLib.FileUtils.read_link ("/proc/%d/cwd".printf (pid));
} catch (GLib.FileError error) {
warning ("An error occurred while fetching the current dir of shell");
warning ("An error occurred while fetching the current dir of shell: %s", error.message);
return "";
}
}
Expand Down Expand Up @@ -266,8 +265,17 @@ public class Scratch.Plugins.Terminal : Peas.ExtensionBase, Peas.Activatable {
});

try {
string last_opened_path = settings.get_string ("last-opened-path") == "" ? "~/" : settings.get_string ("last-opened-path");
terminal.spawn_sync (Vte.PtyFlags.DEFAULT, last_opened_path, { Vte.get_user_shell () }, null, GLib.SpawnFlags.SEARCH_PATH, null, out child_pid);
var last_path_setting = settings.get_string ("last-opened-path");
//FIXME Replace with the async method once the .vapi is fixed upstream.
terminal.spawn_sync (
Vte.PtyFlags.DEFAULT,
last_path_setting == "" ? "~/" : last_path_setting,
{ Vte.get_user_shell () },
null,
GLib.SpawnFlags.SEARCH_PATH,
null,
out child_pid
);
} catch (GLib.Error e) {
warning (e.message);
}
Expand Down
6 changes: 4 additions & 2 deletions src/Widgets/SearchBar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -371,12 +371,13 @@ namespace Scratch.Widgets {
}

private bool search_for_iter (Gtk.TextIter? start_iter, out Gtk.TextIter? end_iter) {
end_iter = start_iter;

if (search_context == null) {
critical ("Trying to search forwards with no search context");
return false;
}

end_iter = start_iter;
bool has_wrapped_around;
bool found = search_context.forward (start_iter, out start_iter, out end_iter, out has_wrapped_around);
if (found) {
Expand All @@ -393,12 +394,13 @@ namespace Scratch.Widgets {
}

private bool search_for_iter_backward (Gtk.TextIter? start_iter, out Gtk.TextIter? end_iter) {
end_iter = start_iter;

if (search_context == null) {
critical ("Trying to search backwards with no search context");
return false;
}

end_iter = start_iter;
bool has_wrapped_around;
bool found = search_context.backward (start_iter, out start_iter, out end_iter, out has_wrapped_around);
if (found) {
Expand Down