kokoirc 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/core/irc/events.ts
CHANGED
|
@@ -19,7 +19,8 @@ function isChannelTarget(target: string): boolean {
|
|
|
19
19
|
function getListModes(connectionId: string): Set<string> {
|
|
20
20
|
const conn = useStore.getState().connections.get(connectionId)
|
|
21
21
|
const chanmodes = conn?.isupport?.CHANMODES
|
|
22
|
-
if (chanmodes) return new Set(chanmodes.split("
|
|
22
|
+
if (Array.isArray(chanmodes) && chanmodes[0]) return new Set(chanmodes[0].split(""))
|
|
23
|
+
if (typeof chanmodes === "string") return new Set(chanmodes.split(",")[0])
|
|
23
24
|
return new Set(["b", "e", "I", "R"])
|
|
24
25
|
}
|
|
25
26
|
|
|
@@ -103,10 +103,20 @@ export function CommandInput() {
|
|
|
103
103
|
const text = event.text
|
|
104
104
|
if (!text) return
|
|
105
105
|
|
|
106
|
-
const lines = text.split(/\r?\n/)
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
const lines = text.split(/\r?\n/)
|
|
107
|
+
const nonEmptyLines = lines.filter((l) => l.trim())
|
|
108
|
+
|
|
109
|
+
// Always prevent default to stop OpenTUI input from stripping newlines
|
|
109
110
|
event.preventDefault()
|
|
111
|
+
|
|
112
|
+
// Single line: insert at cursor position
|
|
113
|
+
if (nonEmptyLines.length <= 1) {
|
|
114
|
+
const currentValue = inputRef.current?.value ?? value
|
|
115
|
+
const newValue = currentValue + text
|
|
116
|
+
setValue(newValue)
|
|
117
|
+
if (inputRef.current) inputRef.current.value = newValue
|
|
118
|
+
return
|
|
119
|
+
}
|
|
110
120
|
|
|
111
121
|
// Prepend any existing input text to first pasted line
|
|
112
122
|
const currentInput = inputRef.current?.value ?? ""
|