MCPcopy Index your code
hub / github.com/RustPython/RustPython / newBuf

Function newBuf

wasm/notebook/src/editor.js:82–93  ·  view source on GitHub ↗
(buffers, buffersDropDown, buffersList, primaryEditor)

Source from the content-addressed store, hash-verified

80}
81
82function newBuf(buffers, buffersDropDown, buffersList, primaryEditor) {
83 let name = prompt('Name your tab', '*scratch*');
84 if (name == null) return;
85 if (buffers.hasOwnProperty(name)) {
86 alert("There's already a buffer by that name.");
87 return;
88 }
89 openBuffer(buffers, name, '', 'python', buffersDropDown, buffersList);
90 selectBuffer(primaryEditor, buffers, name);
91 let sel = buffersDropDown;
92 sel.value = name;
93}
94
95export { selectBuffer, openBuffer, newBuf };

Callers 1

index.jsFile · 0.90

Calls 4

alertFunction · 0.85
openBufferFunction · 0.85
selectBufferFunction · 0.85
promptFunction · 0.50

Tested by

no test coverage detected