disable newlines, fix alt+delete
This commit is contained in:
parent
893534935f
commit
91fd81e643
|
@ -416,12 +416,12 @@ namespace telegram {
|
||||||
|
|
||||||
public static void RemoveFromInputLineForward(bool word = false) {
|
public static void RemoveFromInputLineForward(bool word = false) {
|
||||||
var part1 = currentInputLine.Substring(0, currentInputPos);
|
var part1 = currentInputLine.Substring(0, currentInputPos);
|
||||||
var part2 = currentInputLine.Substring(currentInputPos);
|
var part2 = currentInputLine.Substring(currentInputPos).TrimStart();
|
||||||
if (word) {
|
if (word) {
|
||||||
var index = part2.IndexOf(" ", StringComparison.Ordinal);
|
var index = part2.IndexOf(" ", StringComparison.Ordinal);
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
index = part2.Length - 1;
|
index = part2.Length - 1;
|
||||||
part2 = part2.Substring(0, index);
|
part2 = part2.Substring(index + 1);
|
||||||
if (index != 0)
|
if (index != 0)
|
||||||
part2 = " " + part2;
|
part2 = " " + part2;
|
||||||
//if (part2.StartsWith("⏎"))
|
//if (part2.StartsWith("⏎"))
|
||||||
|
|
|
@ -240,7 +240,6 @@ namespace telegram {
|
||||||
break;
|
break;
|
||||||
case ConsoleKey.Delete when currentInputLine.Length >= 1 && currentInputPos < currentInputLine.Length:
|
case ConsoleKey.Delete when currentInputLine.Length >= 1 && currentInputPos < currentInputLine.Length:
|
||||||
if (key.Modifiers.HasFlag(ConsoleModifiers.Alt)) {
|
if (key.Modifiers.HasFlag(ConsoleModifiers.Alt)) {
|
||||||
RemoveFromInputLineForward(true);
|
|
||||||
ScreenUpdate();
|
ScreenUpdate();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -285,10 +284,10 @@ namespace telegram {
|
||||||
case ConsoleKey.DownArrow: break;
|
case ConsoleKey.DownArrow: break;
|
||||||
default: {
|
default: {
|
||||||
switch (key.Key) {
|
switch (key.Key) {
|
||||||
case ConsoleKey.N when key.Modifiers.HasFlag(ConsoleModifiers.Control):
|
//case ConsoleKey.N when key.Modifiers.HasFlag(ConsoleModifiers.Control):
|
||||||
InsertToInputLine("⏎ ");
|
// InsertToInputLine("⏎ ");
|
||||||
ScreenUpdate();
|
// ScreenUpdate();
|
||||||
return;
|
// return;
|
||||||
case ConsoleKey.D when key.Modifiers.HasFlag(ConsoleModifiers.Control):
|
case ConsoleKey.D when key.Modifiers.HasFlag(ConsoleModifiers.Control):
|
||||||
HandleCommand(currentChatId == 0 ? "q" : "c");
|
HandleCommand(currentChatId == 0 ? "q" : "c");
|
||||||
ScreenUpdate();
|
ScreenUpdate();
|
||||||
|
|
Loading…
Reference in a new issue