From bb45294b83205d2dcbb4ae71e4a8bafb12956b14 Mon Sep 17 00:00:00 2001
From: Federico Terzi <federicoterzi96@gmail.com>
Date: Tue, 12 Nov 2019 22:41:24 +0100
Subject: [PATCH 1/4] Version bump 0.3.5

---
 Cargo.lock | 2 +-
 Cargo.toml | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock
index f646459..9f2dae4 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -370,7 +370,7 @@ dependencies = [
 
 [[package]]
 name = "espanso"
-version = "0.3.4"
+version = "0.3.5"
 dependencies = [
  "backtrace 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)",
  "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
diff --git a/Cargo.toml b/Cargo.toml
index e75a34c..1812ac1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "espanso"
-version = "0.3.4"
+version = "0.3.5"
 authors = ["Federico Terzi <federicoterzi96@gmail.com>"]
 license = "GPL-3.0"
 description = "Cross-platform Text Expander written in Rust"

From 58f3ec614f3890133fa20bd0b3c5f04160443484 Mon Sep 17 00:00:00 2001
From: Federico Terzi <federicoterzi96@gmail.com>
Date: Tue, 12 Nov 2019 22:48:27 +0100
Subject: [PATCH 2/4] Fix bug that prevented certain triggers from being
 expanded correctly on Linux

---
 native/liblinuxbridge/bridge.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/native/liblinuxbridge/bridge.cpp b/native/liblinuxbridge/bridge.cpp
index fa36d28..1263b2f 100644
--- a/native/liblinuxbridge/bridge.cpp
+++ b/native/liblinuxbridge/bridge.cpp
@@ -285,6 +285,13 @@ void left_arrow(int32_t count) {
 }
 
 void trigger_paste() {
+    // Before sending the paste shortcut, trigger the press and release of the Shift key
+    // this is needed because for some triggers, for example ending with ":", the user
+    // will still have the Shift key pressed when espanso execute the pasting shortcut,
+    // therefore sending CTRL+Shift+V instead of CTRL+V.
+    // With this call, we force the shift key to be unpressed when pasting.
+    xdo_send_keysequence_window(xdo_context, CURRENTWINDOW, "Shift", 8000);
+
     xdo_send_keysequence_window(xdo_context, CURRENTWINDOW, "Control_L+v", 8000);
 }
 

From bada3cb304e560f8eb42c76d86784b4c903a0613 Mon Sep 17 00:00:00 2001
From: Federico Terzi <federicoterzi96@gmail.com>
Date: Tue, 12 Nov 2019 23:18:09 +0100
Subject: [PATCH 3/4] Add support for Alacritty terminal on Linux

---
 native/liblinuxbridge/bridge.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/native/liblinuxbridge/bridge.cpp b/native/liblinuxbridge/bridge.cpp
index 1263b2f..b757ff4 100644
--- a/native/liblinuxbridge/bridge.cpp
+++ b/native/liblinuxbridge/bridge.cpp
@@ -463,6 +463,8 @@ int32_t is_current_window_terminal() {
             return 1;
         }else if (strstr(class_buffer, "St") != NULL) {  // Simple terminal
             return 1;
+        }else if (strstr(class_buffer, "Alacritty") != NULL) {  // Alacritty terminal
+            return 1;
         }
     }
 

From d5302b3e00a6ab4998432b5a9d0296272b1eb20b Mon Sep 17 00:00:00 2001
From: Federico Terzi <federico-terzi@users.noreply.github.com>
Date: Thu, 14 Nov 2019 18:39:25 +0100
Subject: [PATCH 4/4] Make Windows restart optional. Fix #115

---
 packager/win/setupscript.iss | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/packager/win/setupscript.iss b/packager/win/setupscript.iss
index 169a4f3..0e24a1b 100644
--- a/packager/win/setupscript.iss
+++ b/packager/win/setupscript.iss
@@ -30,6 +30,7 @@ Compression=lzma
 SolidCompression=yes
 WizardStyle=modern
 ChangesEnvironment=yes
+AlwaysRestart = yes
 
 [Languages]
 Name: "english"; MessagesFile: "compiler:Default.isl"
@@ -62,7 +63,7 @@ end;
 
 [Run]
 Filename: {tmp}\vc_redist.x64.exe; \
-    Parameters: "/install /quiet"; \
+    Parameters: "/install /quiet /norestart"; \
     StatusMsg: "Installing Visual C++ 2019 Redistributable";
 Filename: "{app}\{#MyAppExeName}"; Parameters: "start"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent