disable insert mode completely when !type

This commit is contained in:
speedie 2023-05-07 15:38:51 +02:00
parent ffe2af611a
commit 6673afc8b7
4 changed files with 7 additions and 3 deletions

View file

@ -324,7 +324,6 @@ MD5() is deprecated as of OpenSSL 3.0, but this would also make it very
easy to have LibreSSL compatibility.</li> easy to have LibreSSL compatibility.</li>
<li>Image support: Ability to display icons, similar to rofi</li> <li>Image support: Ability to display icons, similar to rofi</li>
<li>Text drawing: Use cairo for text drawing over Xft.</li> <li>Text drawing: Use cairo for text drawing over Xft.</li>
<li>Typing: Disable insert mode completely when !type</li>
<li>Lines: Rofi-like newlines in the same entry <li>Lines: Rofi-like newlines in the same entry
<ul> <ul>
<li>Just need to <code>XMoveResizeWindow()</code> as well as <li>Just need to <code>XMoveResizeWindow()</code> as well as

View file

@ -127,7 +127,6 @@ is deprecated as of OpenSSL 3.0, but this would also make it very easy to
have LibreSSL compatibility. have LibreSSL compatibility.
- Image support: Ability to display icons, similar to rofi - Image support: Ability to display icons, similar to rofi
- Text drawing: Use cairo for text drawing over Xft. - Text drawing: Use cairo for text drawing over Xft.
- Typing: Disable insert mode completely when !type
- Lines: Rofi-like newlines in the same entry - Lines: Rofi-like newlines in the same entry
- Just need to `XMoveResizeWindow()` as well as `mh += bh` and `y += bh` - Just need to `XMoveResizeWindow()` as well as `mh += bh` and `y += bh`
for each added line. for each added line.

View file

@ -468,9 +468,11 @@ void setprofile(Arg *arg) {
void switchmode(Arg *arg) { void switchmode(Arg *arg) {
curMode = !curMode; curMode = !curMode;
if (!type) curMode = 0; // only normal mode allowed
allowkeys = !curMode; allowkeys = !curMode;
strncpy(modetext, curMode ? instext : normtext, 15); strncpy(modetext, curMode ? instext : normtext, 15);
drawmenu(); drawmenu();
} }

View file

@ -688,6 +688,10 @@ int main(int argc, char *argv[]) {
longestedge = MAX(imagewidth, imageheight); longestedge = MAX(imagewidth, imageheight);
#endif #endif
if (!type) {
mode = 0;
}
// set default mode, must be done before the event loop or keybindings will not work // set default mode, must be done before the event loop or keybindings will not work
if (mode) { if (mode) {
curMode = 1; curMode = 1;